I’m trying to make some kind of night eco solution for my thermostats, where I can select via a group of input_booleans which thermostats to alter the temperature on.
I just can’t wrap my head around how to do this.
I’ve tried with the code below, but HA won’t eat it
The main problem is you can’t define multiple YAML lines via a Jinja for loop. But you can provide the climate.set_temperature service a list of entity_id’s. I would do it something like this:
This will create a comma separated list of climate entity_id’s whose states are not ‘off’ and that are in your group. It will set all these climate entities to a particular temperature (i.e., replace ECO_TEMP with whatever value you want to set them to.)
Ok, that seems unusual. The climate devices I’m familiar with have a state that tells if they’re off, or if they’re on, what mode they’re in (e.g., heat, cool, etc.) Does your’s not work that way? What climate platform are you using?
It’s probably possible to build up an entity_id list using a for loop, but before going down that path I’d like to verify that indeed your climate device does not show on/off status in its state.
EDIT: Also, I should ask, in your original post, you seemed to be trying to set each climate device’s temperature setting to its current temperature setting, which wouldn’t actually do anything. Is that what you wanted? Or, to put that another way, when this runs, what temperature do you want to set the thermostats to?
Ok, thanks for the info. FWIW, to me, that doesn’t seem right. I mean, that climate platform doesn’t seem to be doing what it’s supposed to. It should be indicating the mode (off, heat, cool, etc.) as the state, but it’s not. Oh well.
So, let me see if I understand now. The on/off state of each system is shown/controlled via an input_boolean. Your group contains the input_booleans. For each input_boolean there is a corresponding climate entity that shows/controls the temperature set point.
If that’s right, then you were close in your OP. I think this is what you need: