Scheduling with dzVents
Posted: Tuesday 07 November 2017 21:29
Hi guys,
First, thanks again for these great tools (Domoticz+dzVents) !
I am not a coder. At all. Or I am the worst ever
But I try.
I have read the wiki in all directions and I lack some info (and scripting skills obviously).
I am building a script to switch on a device (zwave relay controlling my heating device) depending on the temperature. That I managed
And I want it on during specific period of the day. I did manage that part as well.
But, with my script, if the device is switched on 1 minute before the active timeframe ends, it will never be switched of ...
So I wanted to have a condition on the temperature and on the time but I just cannot figure it out ...
I went though this part of the wiki (https://www.domoticz.com/wiki/DzVents:_ ... ime_object) many times but I do not get it.
To be honest, I am not even capable to print in the log any value for domoticz.time
And I am not even sure this is the best way to go when I think about it ...
I ended up with switching the device to a non heating status using the timers button ....
Here is the disaster :
First, thanks again for these great tools (Domoticz+dzVents) !
I am not a coder. At all. Or I am the worst ever

But I try.
I have read the wiki in all directions and I lack some info (and scripting skills obviously).
I am building a script to switch on a device (zwave relay controlling my heating device) depending on the temperature. That I managed

And I want it on during specific period of the day. I did manage that part as well.
But, with my script, if the device is switched on 1 minute before the active timeframe ends, it will never be switched of ...
So I wanted to have a condition on the temperature and on the time but I just cannot figure it out ...
I went though this part of the wiki (https://www.domoticz.com/wiki/DzVents:_ ... ime_object) many times but I do not get it.
To be honest, I am not even capable to print in the log any value for domoticz.time
And I am not even sure this is the best way to go when I think about it ...
I ended up with switching the device to a non heating status using the timers button ....
Here is the disaster :
Code: Select all
return {
active = true,
on = {
timer = {
'every 10 minutes between 05:50 and 08:00',
'every 10 minutes between 19:00 and 21:00'
},
},
execute = function(domoticz, device)
local sdbtemp = domoticz.devices(623) -- sdb temp
local relais1 = domoticz.devices(236) -- sdb relais 1 mode confort si OFF et relais 2 off aussi
local relais2 = domoticz.devices(243) -- relais 2 - toujours off.
if (sdbtemp.temperature < 20 ) then
relais1.switchOff()
relais2.switchOff()
domoticz.notify('Chauffage Sdb en mode confort')
else
relais1.switchOn()
relais2.switchOff()
end
end
}