I'am new to the world of dzVents and with some solutions I found on this forum I have made my own little script.
The goal is to turn on the outside lights at 7.00 unless the sun is already up. I have made a group with al the lights that I want to turn on named Buitenverlichting. Could somebody advise me if this script triggers the lights how I would like? The lights are turned off with Homekit at sunrise. So no need to included that in the script.
Code: Select all
return {
on = {
timer = {
function(domoticz)
return (domoticz.time.matchesRule('at 07:00') and domoticz.time.matchesRule('before sunrise'))
end
}
},
execute = function(domoticz, triggeredItem, info)
local d = dz.groups("Buitenverlichting")
if (d.state ~= 'On') then
d.switchOn()
end
end
}