return { on = { devices = {'PIRLEDKuchnia'} }, logging = { level = domoticz.LOG_DEBUG, marker = 'PIR LED Kuchnia', }, execute = function(domoticz, device) --local variables local PIRLED = domoticz.devices('PIRLEDKuchnia') local LEDLight = domoticz.devices('LEDKuchnia') local Night = domoticz.devices('Noc') --local Movment = domoticz.devices('Wykrywanie Ruchu') local LightingTime = 1 if (Night.state =='On') then if (LEDLight.state == 'On') then LEDLight.switchOff().afterMin(LightingTime) else LEDLight.switchOn().forMin(LightingTime) end end end }