Antropex

Termo Domoticz

Apr 6th, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. return { on = {
  2. timer = { 'Every 10 minutes' },
  3. },
  4.  
  5. logging = {
  6. level = domoticz.LOG_DEBUG,
  7. marker = "Termostat_"
  8. },
  9. execute = function(dz,domoticz,devices)
  10. local time = 30
  11.  
  12. local went1 = dz.devices('Wentylator Przod')
  13. local went2 = dz.devices('Wentylator Srodek') --definiowanie wyjść
  14. local went3 = dz.devices('Wentylator Koniec')
  15. local Fogger = dz.devices('Fogger')
  16. local controlSwitch = dz.devices('Termostat') --Odczyt stanu foggera i włącznika Termostatu
  17.  
  18. local setPoint1 = dz.devices('Went przod').setPoint
  19. local setPoint2 = dz.devices('Went srodek').setPoint --Odczyt nastaw
  20. local setPoint3 = dz.devices('Went tyl').setPoint
  21.  
  22. local Temp = dz.devices('bme280').temperature --Odczyt temperatury
  23.  
  24. print(setPointTyl)
  25.  
  26. if controlSwitch.state == 'On' then --Czy włączony i czy czasem fog nie włączył się wcześniej
  27. if Fogger.state == 'Off' then
  28. if Temp >= setPoint1 then
  29. went1.switchOn()
  30.  
  31. else
  32. went1.switchOff()
  33. end
  34.  
  35. if Temp >= setPoint2 then
  36. went2.switchOn().afterSec(3) --Ustawianie wyjść
  37. else
  38. went2.switchOff().afterSec(3)
  39. end
  40.  
  41. if Temp >= setPoint3 then
  42. went3.switchOn().afterSec(6)
  43.  
  44. else
  45. went3.switchOff().afterSec(6)
  46. end
  47. end
  48. end
  49. end
  50. }
Add Comment
Please, Sign In to add comment