Sunset and sunrise trigger troubles
Posted: Thursday 24 August 2017 10:18
I'm trying to close and open my curtains with the timer triggers sunset and sunrise. With sunset it's working, but with sunrise it won't. I've testing if the state is Open\Closed or On\Off and know that it's Open\Closed. So the curtains are closed with the sunset trigger after 20 minutes, but in the morning the curtains won't open automatically. Is there something I miss?
This is my script:
I'm running Domoticz on a RPi 2 with version V3.8300.
This is my script:
Code: Select all
-- Script wat gordijnen open en dicht doet.
--
return {
active = true,
on = {
timer = {'at sunset'},
{'at sunrise'}
},
execute = function(domoticz, gordijnen)
local mswitch = domoticz.devices('Masterswitch') -- Masterswitch die script laat uitvoeren of niet
local gordijnen = domoticz.devices('Gordijnen voor')
if (gordijnen.state == 'Open') and (mswitch.levelName == 'Automatisch') then
gordijnen.close().afterMin(20)
elseif (gordijnen.state == 'Closed') and (mswitch.levelName == 'Automatisch') then
gordijnen.open().afterMin(15)
end
end
}