Cold is coming, and I'm a bit late in my heating system....

To resume the situation
I have X number of eurotronic valve, I can control them with a script to open and close as below. This script is link to a dummy called "heat_demand_X" which this one is triggered by the plugin virtual Thermostat. This work perfectly. https://www.domoticz.com/wiki/Plugins/S ... ostat.html
Code: Select all
return {
on = {
devices = {
'heat_demand_saloon' extra comment this is not in the actual script (The idx is entered in the virtual thermostat)
}
},
execute = function(domoticz, device)
if (device.active) then
domoticz.devices('Saloon valve mode').updateMode('Manufacturer Specific')
domoticz.devices('Heating Kitchen').switchOn()
domoticz.log('Valve open and Heater under kitchen ON!')
else
domoticz.devices('Saloon valve mode').updateMode('Off') .afterMin(5)
domoticz.devices('Heating Kitchen').switchOff() .afterMin(5)
domoticz.log('Valve closed and Heater under kitchen OFF!!')
end
end
}
Hers is the script
Code: Select all
return {
on = {
devices = {
'heat_demand_saloon',
'heat_demand_study',
'heat_demand_parent',
'heat_demand_lilou',
'heat_demand_djimo',
'heat_demand_hall'
}
},
execute = function(domoticz, switch)
if
domoticz.devices('heat_demand_saloon').switchOn().checkFirst()
or
domoticz.devices('heat_demand_study').switchOn().checkFirst()
or
domoticz.devices('heat_demand_parent').switchOn().checkFirst()
or
domoticz.devices('heat_demand_lilou').switchOn().checkFirst()
or
domoticz.devices('heat_demand_djimo').switchOn().checkFirst()
or
domoticz.devices('heat_demand_hall').switchOn().checkFirst()
then
domoticz.devices('Boiler').switchOn().checkFirst()
else
domoticz.devices('Boiler').switchOff().checkFirst()
end
end
}


Why? Because is first in the list...I might miss a separator or something.
I'm sure it is a stupid thing, but checked the forum which help me a lot alreday to get the script for the valve. But how to have a script with condition? So actually the boiler should be off only if all the zone are off. And if let say two zone are ON and one stop it should not send an off command to the boiler.
Please some help
Thanks