Can anyone tell me what I am doing wrong?
Code: Select all
return {
on = {
devices = { ['Voordeur Entry Sensor'] = { 'at nighttime' } }
},
execute = function(domoticz, device)
domoticz.log('Hal licht aan/uit.', domoticz.LOG_INFO)
if ( device.status == "open" ) then
-- turn light on
domoticz.devices('Ganglicht BG').setState("On")
elseif ( device.status == 'closed' ) then
-- turn light off after one minute
domoticz.devices('Ganglicht BG').setState("Off").afterMin(1)
end
end
}