The script below has always worked fine, but it stopped working a week ago.
The script only switches On both during the day and at night.
When I switch the lines nighttime and daytime, the script only switches Off.
How is this possible? Restoring from a backup didn't help either.
Code: Select all
--isDonker (Dummy switch) dzVentz
--Nighttime dummy switch is on (check every xx minutes)
--Daytime dummy switch is off (check every xx minutes)
--After a power failure or reset the dummy always comes back in the right position
return
{
active = true,
on = {
timer = {
'every 2 minutes at daytime',
'every 2 minutes at nighttime'
}
},
execute = function(domoticz, device, triggerInfo)
local donker = domoticz.devices('isDonker')
if (triggerInfo.trigger == 'every 2 minutes at nighttime')
then
donker.switchOn().checkFirst()
domoticz.log('isDonker device is switched ON by dzVentz scripts TRIGGER 1');
elseif (triggerInfo.trigger == 'every 2 minutes at daytime')
then
donker.switchOff().checkFirst()
domoticz.log('isDonker device is switched OFF by dzVentz scripts TRIGGER 2');
end
end
}