I have now managed to migrate most of my scripts to dzVents and all have so far been more efficient with dzVents, thx!
Now I have a few left that I'm struggling with.
For starter, I want the script to run from 05:45 in the morning until 3 hours after sunrise.
I have tried below but think it might have some mistake in the code..
I realize that it's possible to use a fixed time instead of the sunrise but it looks nicer with the dynamic sunrise
Code: Select all
on = {
timer = {'05:45 - 180 minutes after sunrise'}How do I accomplish above? I guess below is wrong but to give you a clearer picture of what I try to achieve.
Code: Select all
and domoticz.time.matchesRule(> '20 minutes after sunrise')Code: Select all
return {
active = true,
on = {
timer = {'05:45 - 180 minutes after sunrise'}
},
execute = function(domoticz, device)
local Morgon = domoticz.groups(1) ----- Lampor som tänds tidigt
local Alla = domoticz.groups(2) ----- Alla lampor inne
local Ute = domoticz.groups(5) ----- Alla lampor Ute
if Morgon.state ~= 'On' and domoticz.time.matchesRule(> '20 minutes after sunrise') then
Morgon.switchOn()
domoticz.variables('EventStatus').set('Morgon')
end
if domoticz.time.isDayTime and Ute.state ~= 'Off' then
Ute.switchOff()
end
if Hall_pir.lastUpdate.minutesAgo > 20
and Kok_pir.lastUpdate.minutesAgo > 20
and Alla.state ~= 'Off'
and domoticz.time.matchesRule('150 minutes after sunrise') then
Alla.switchOff()
end
end
}
R/lennart