Code: Select all
return {
active = true,
on = {
devices = {
'Voordeur',
'Pir_Gang2',
'Pir_Gang'
}
},
execute = function(domoticz,Voordeur)
local Pir_gang = domoticz.devices('Pir_Gang')
local Pir_gang2 = domoticz.devices('Pir_Gang2')
local BridgeLamp = domoticz.devices('Bridge Lamp')
local gang = domoticz.devices('Gang')
local zonondergang = domoticz.devices('zonondergang')
if (Voordeur.state == 'Open') and (zonondergang.state == 'On') then
gang.switchOn()
BridgeLamp.switchOn()
else
BridgeLamp.switchOff()
gang.switchOff().afterSec(30)
end
if (Voordeur.state == 'Open') and (zonondergang.state == 'Off') then
BridgeLamp.switchOn()
else
BridgeLamp.switchOff()
end
end
}