return { on = { devices = {'PIR czujnik'} -- nazwa PIR }, logging = { level = domoticz.LOG_INFO,ERROR, }, execute = function(dz, device) --local variables local PIR = dz.devices('PIR czujnik') local Lampa = dz.devices('Przełącznik') local Lux = dz.devices('Lux czujnik') local LUX = Lux.lux --local Movment = domoticz.devices('Wykrywanie Ruchu') local LightingTime = 60 if (LUX <= 10) then if (Lampa.state == 'On') then Lampa.switchOff().afterSec(LightingTime) else Lampa.switchOn().forSec(LightingTime) end end end }