Trying to get a little handle on some scripting but having a hard time understanding python. My copy/paste/modify skills with other languages could get me by for some things but not now.
What I am trying to do is script my thermostats to only enter Mode Heat when more than one tstat calls for heat. I have zoned baseboard heat using an older model mod/con boiler. In these cool but not cold times of the year the boiler can not modulate down enough and will short fire when only one zone is calling for heat, I want to prevent this. I have 3 zones and would like to have any 1 zone wait for another zone before changing to Mode Heat. I have created variables and tried using triggers but there were so many possibilities between variables that I got lost in creating separate triggers for each.
Here is what I would like. Basement tstat current Mode is Off, temp drops below set point of 68, a trigger fires modifying variable BasementWait to true, both other tstats are Mode Off as well and set points are met. Then Living tstat temp drops below set point firing trigger that modifies variable LivingWait to true. Now that there are two tstats waiting for heat they will both receive commands to Mode Heat On which will open the zone valves and cause boiler to fire. If one zones set point would be reached there would be a delay changing the variable Wait to false, and when that variable is changed if the 3rd zones Wait variable is not also already Wait the script would change the only zone calling for heat to Mode Off. When there are again two zones waiting for heat script would again fire changing appropriate zone to Mode Heat. Hope this makes sense. Here is a little script that I tried cobbling together to control one zone from some examples I found but it doesn't work at all. I get this, 'VariableList' object is not callable at line 1. And I'd bet many more errors if it got past line 1, but at least I tried right. Can anybody help me with this? Thanks
bed = indigo.variables(915602964)
living = indigo.variables(40815081)
base = indigo.variables(915602964)
# get current temp
currentTemp = float(indigo.devices[1007237836].states["temp"])
# temp over 40
if currentTemp >= 40 and living.states['true'] and bed.states['true'] or base.states['true']:
indigo.devices.modeHeat(1643055815)
elif currentTemp < 40 and indigo.variables(40815081).states['true']:
indigo.devices.modeHeat(16430558150)
else:
indigo.devices.modeOff(16430558150)