[closed] problem using two different time triggers
Posted: Saturday 04 March 2023 12:23
Hi,
Below my code.
This code is intended to open/close window-shutter.
The (somfy) shutter can be controlled using pushbuttons from domoticz.
The pushbuttons do avtivate the shutter using code:
http://192.168.2.18/control?cmd=pulse,14,1,500 for shutter up
and
http://192.168.2.18/control?cmd=pulse,13,1,500 for shutter down
That worked as expected. But as dzVents has better time possibilities for trigger I want to use dzVents.
As seen in the code shutter has to go up 10 min after sunrise and close 30 min after sunset.
But as a matter of facts nothing happens.
What is wrong in my code? Or are my expectations wrong ?
TIA
-Bart
Below my code.
Code: Select all
return {
on = {
timer = {
'10 minutes after sunrise',
'30 minutes after sunset',
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'template',
},
execute = function(dz, timer)
if (timer == "10 minutes after sunrise") then
dz.openURL({
url = "http://192.168.2.18/control?cmd=pulse,14,1,500" --luik omhoog
})
end
if (timer == "30 minutes after sunset") then
dz.openURL({
url = "http://192.168.2.18/control?cmd=pulse,13,1,500" --luik omlaag
})
end
dz.log('Timer event was triggered by ' .. timer.trigger, dz.LOG_INFO)
end
}The (somfy) shutter can be controlled using pushbuttons from domoticz.
The pushbuttons do avtivate the shutter using code:
http://192.168.2.18/control?cmd=pulse,14,1,500 for shutter up
and
http://192.168.2.18/control?cmd=pulse,13,1,500 for shutter down
That worked as expected. But as dzVents has better time possibilities for trigger I want to use dzVents.
As seen in the code shutter has to go up 10 min after sunrise and close 30 min after sunset.
But as a matter of facts nothing happens.
What is wrong in my code? Or are my expectations wrong ?
TIA
-Bart