Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return { on = {
- timer = { 'Every 10 minutes' },
- },
- logging = {
- level = domoticz.LOG_DEBUG,
- marker = "Termostat_"
- },
- execute = function(dz,domoticz,devices)
- local time = 30
- local went1 = dz.devices('Wentylator Przod')
- local went2 = dz.devices('Wentylator Srodek') --definiowanie wyjść
- local went3 = dz.devices('Wentylator Koniec')
- local Fogger = dz.devices('Fogger')
- local controlSwitch = dz.devices('Termostat') --Odczyt stanu foggera i włącznika Termostatu
- local setPoint1 = dz.devices('Went przod').setPoint
- local setPoint2 = dz.devices('Went srodek').setPoint --Odczyt nastaw
- local setPoint3 = dz.devices('Went tyl').setPoint
- local Temp = dz.devices('bme280').temperature --Odczyt temperatury
- print(setPointTyl)
- if controlSwitch.state == 'On' then --Czy włączony i czy czasem fog nie włączył się wcześniej
- if Fogger.state == 'Off' then
- if Temp >= setPoint1 then
- went1.switchOn()
- else
- went1.switchOff()
- end
- if Temp >= setPoint2 then
- went2.switchOn().afterSec(3) --Ustawianie wyjść
- else
- went2.switchOff().afterSec(3)
- end
- if Temp >= setPoint3 then
- went3.switchOn().afterSec(6)
- else
- went3.switchOff().afterSec(6)
- end
- end
- end
- end
- }
Add Comment
Please, Sign In to add comment