I expected two events. At sunrise and at sunset. But in the log I can see that I got four events. Before and After Sunset en Sunrise. Is there an option to only get two triggers? I've tried "1 minutes after sunrise" trigger, but I can't find where to check on in my code.
Code: Select all
return {
active = true,
on = {
timer = {
--At sunrise en at sunset doesn't work because then you get to events. Before AND after sunset/sunrise
'at sunrise', -- uses sunset/sunrise info from Domoticz
'at sunset'
}
},
execute = function(domoticz, device, triggerInfo)
local IsHetDonkerBuiten = domoticz.devices('IsHetDonkerBuiten')
if (timerInfo.trigger == 'at sunset')
then
IsHetDonkerBuiten.switchOn()
domoticz.log('IsHetDonkerBuiten device is switched ON by dzVentz scripts TRIGGER 1');
elseif (timerInfo.trigger == 'at sunrise')
then
IsHetDonkerBuiten.switchOff()
domoticz.log('IsHetDonkerBuiten device is switched OFF by dzVentz scripts TRIGGER 2');
end
}