return { on = { timer = {'every 3 minutes and between 05:30 and 21:29', 'at 21:30'}, }, execute = function(domoticz, triggeredItem) --nazwy urzadzeƄ local PM10=tonumber(domoticz.devices('pm10').state) local PM25=tonumber(domoticz.devices('pm2,5').state) local czerwona=domoticz.devices('Czerwony') local zielona=domoticz.devices('Zielony') if domoticz.time.matchesRule('between 05:30 and 21:29') then if (PM10<=60 and PM25<=36) then czerwona.switchOff() zielona.switchOn() end if ((PM10>61 and PM10<=140) or (PM25>=37 and PM25<=84)) then czerwona.switchOn() zielona.switchOn() end if (PM10>140 or PM25>84) then czerwona.switchOn() zielona.switchOff() end else czerwona.switchOff() zielona.switchOff() end end }