Coming from LUA, but willing to learn dzvents, I have still difficulty to understand how to write trigger the right way.
I have this current script that works well (thanks to support here):
Code: Select all
return {
on = {
timer = {'at 5:00', 'at 11:00', 'at 19:00'}
},
data = {
temp = { initial = 20 } --20 comme level pas comme temperature, correspond à 45°C
},
execute = function(domoticz, timer)
print ("Avant:" .. domoticz.data.temp)
if (timer.trigger == 'at 5:00') then
print ("Passage de la consigne a 20°C")
domoticz.devices('Ballon ECS Bas').switchSelector(0)
elseif (timer.trigger == 'at 11:00') then
domoticz.devices('Ballon ECS Bas').switchSelector(domoticz.data.temp)
print("Retour de la consigne d origine")
elseif (timer.trigger == 'at 19:00') then
domoticz.data.temp = domoticz.devices('Ballon ECS Bas').level
print ("prise en compte de la consigne de temperature")
domoticz.devices('Ballon ECS Bas').switchSelector(10)
print("Chauffage de l'ECS moins important la nuit")
end
print ("Apres:" .. domoticz.data.temp)
end
}Now, I would like to trigger a new action when many conditions are met:
(between 11:05 and 16) and (consommation == 0) and (Production Eau Chaude == 'Off')
Obviously i would like to avoid the script to be triggered every minute between 11:05 and 16, so would be better to trigger it first from "Production Eau Chaude" which is the parameter that will change the least. But I have no idea how to do that!
In LUA, I would have done a time script and check if the conditions are met every minute...