I've been trying to get my script working correctly, but strangely enough, my script isn't getting started.
I currently have this code:
Code: Select all
return {
active = true,
on = {
timer = {
'at Sunset',
'at Sunrise'
}
},
execute = function(domoticz, device, triggerInfo)
local AchterTuin_Licht = domoticz.devices('Sonoff_Tuinlicht')
local Voortuin_Licht = domoticz.devices('Buitenlamp_Voor')
if (triggerInfo.trigger == 'at Sunset')
then
AchterTuin_Licht.switchOn().withinMin(15)
Voortuin_Licht.switchOn().withinMin(15)
domoticz.log('Sunset, tuinverlichting gaat random aan binnen 15 minuten.');
domoticz.notify('Domoticz Notification', 'Sunset, tuinverlichting gaat random aan binnen 15 minuten.', 'domoticz.PRIORITY_NORMAL')
elseif (triggerInfo.trigger == 'at Sunrise')
then
AchterTuin_Licht.switchOff().withinMin(15)
Voortuin_Licht.switchOff().withinMin(15)
domoticz.log('Sunrise, tuinverlichting gaat random uit binnen 15 minuten.');
domoticz.notify('Domoticz Notification', 'Sunrise, tuinverlichting gaat random uit binnen 15 minuten.', 'domoticz.PRIORITY_NORMAL')
end
end
}
Am I missing something for the sunset and sunrise to work?
My location has been set in Domoticz and I can see the sunset and rise times.
Version information:
Version: 3.9530
Build Hash: 30295913
Compile Date: 2018-05-29 14:27:24
dzVents Version: 2.4.6
Python Version: 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124]