Climate group and automation action

Hi! I’m fairly new to HA, but I’m starting to have quite a few automations implemented and am curious whether the following is possible.

I have 11 electric heating baseboards in my house, each one related to a thermostat. Thermostats work perfectly with HA. I’m now wanting to group thermostats and perform actions on those groups via automations.

For example, for the group:

group_basement_living_thermostats:
  name: Basement Living Thermostats
  entities:
    - climate.stelpro_stzw402_electronic_thermostat_heating_1_2
    - climate.stelpro_stzw402_electronic_thermostat_heating_1_3
    - climate.stelpro_stzw402_electronic_thermostat_heating_1_4

I would like to automate changing the temperature with an automation like this:

- id: 'temp_weekday_morning_basement_living'
  alias: Temperature Weekday Morning Basement Living
  trigger:
  - platform: time
    at: '05:30:00'
  condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  action:
  - service: climate.set_temperature
    data :
      entity_id: group.group_basement_living_thermostats
      temperature: 22

The automation above works if the entity_id in the action’s data is a specific entity, or a list of entities, but fails when using the group. Is this expected or am I doing something wrong?

Does this work…

 - service: climate.set_temperature
    data :
      entity_id:
         - thermostat 1
         - thermostat 2
         - etc
      temperature: 22

?

Some services can’t iterate through so you have to do one service call per entity.

1 Like

Interesting! Yes, what you posted does work, and if I use this format with groups, it also works! For example, the following will correctly change the temperature for the 3 thermostats in the group_basement_living_thermostats defined in my original post:

- id: 'temp_weekday_morning_basement_living'
  alias: Temperature Weekday Morning Basement Living
  trigger:
  - platform: time
    at: '05:30:00'
  condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  action:
  - service: climate.set_temperature
    data : 
      entity_id:
         - group.group_basement_living_thermostats
      temperature: 22

So the key was to separate out the entity_ids instead of specifying them on the same line as entity_id.

Thanks very much for your help!

2 Likes