Code: Select all
return {
active = true,
on = {
devices = {
'Motion_Boven'
}
},
execute = function(domoticz, sensorboven)
local lichtoverloop = domoticz.devices('Licht_Overloop')
if (sensorboven.state == 'On' and domoticz.time.matchesRule('between sunset and sunrise') ) then
lichtoverloop.switchOn().forMin(1)
end
end
}
with this code the light stay on and sometimes it's go off after 1 min so it's random
Code: Select all
return {
active = true,
on = {
devices = {
'Motion_Boven'
}
},
execute = function(domoticz, sensorboven)
local lichtoverloop = domoticz.devices('Licht_Overloop')
if (sensorboven.state == 'On' and domoticz.time.matchesRule('between sunset and sunrise') ) then
lichtoverloop.switchOn()
else
lichtoverloop.switchOff()
end
end
}
But why stay the switch on even if i say forMin(1)?