#Group HVAC actions to trigger a pump

1 messages · Page 1 of 1 (latest)

lyric fox
#

Hi, I have 7 thermostats valves on the same hot water circuit. For any valves to heat the room it's in, it needs to enable the relevant pump controlled by a switch. Each valve has a sensor that returns either "heating" or "idle". I need the pump switch to turn on if any such sensor returns "heating" and to turn it off if all sensors return "idle".

I tried grouping the sensors using a maximum or minimum, but it doesn't work. I guess it only works with numbers.

How can I achieve my above goal?

mossy crown
#

What where you trying with min/max? But you can just make a binary sensor group. Set "all entities" to false.

summer mica
#

If they're binary sensors then a binary sensor group works
If they're just normal sensors, that won't work - you can do this with a label for all the sensors you want to group and a template binary sensor

mossy crown
#

Ah, yeah, As it returned two states I assumed (sorry) that it was a binary sensor device class.

Then indeed a template sensor. Or just use them all in place.

summer mica
#

Yeah I just can't think of a binary sensor that returns heating/idle like that - sounds more like a climate entities hvac_action
Am example of how to do this in a binary sensor (with climate entities) is:

{{ label_entities('Heating Zone') | select('is_state_attr', 'hvac_action', 'heating') | select('is_state', 'heat') | list | length > 0}}
lyric fox
lyric fox
summer mica
lyric fox
#

Ok, I'll try now, thanks.

summer mica
#

just need to set all of the climate entities to have the label 'Heating Zone'

lyric fox
#

I did it, thanks everyone!

#

I just got confused at the start because I added the labels to the Zigbee devices rather than the climate entities.

#

Also, I must set some "Show As" field for the helper and nothing was quite fitting. I chose "Power" as it seemed to be the most neutral thing and it makes the log quite readable.

mossy crown
#

So did you manage to make it or not? As I'm not sure about which "show as" you're talking

lyric fox
#

Yes, I did manage to make it work.

#

There's some field for the helper (template binary sensor) where you choose what the helper should show as. I selected "Power" and the logs shows that it detected power or not. That's kinda weird but that works anyway.

mossy crown
#

just leave it blank 🙂

#

it's optional

summer mica
#

yeah i just leave it as on/off

soft coyote
#

@lyric fox I have the TRVZBs and my template sensor counts how many climate entities have action set to heating. Mode doesn't really matter, what matters is the hvac_action == 'heating'

summer mica
lyric fox
#

I found a solution that removes the need for a helper. I use the template directly in the automation:

alias: pump-rdc-on-off
description: >-
  Turn on or off the ground floor pump when heat is required or not.
triggers:
  - trigger: state
    attribute: hvac_action
    entity_id:
      - climate.r_hall_porte_thermostat
      - climate.r_hall_fond_thermostat
      - climate.r_bureau_thermostat
      - climate.r_cuisine_thermostat
      - climate.r_salon_thermostat
      - climate.r_manger_thermostat
      - climate.r_toilet_rdc_thermostat
actions:
  - alias: turn on if at least 1 climate entity is heating, off otherwise
    service_template: >-
      switch.turn_{{ 'on' if (label_entities('heating-zone-rdc') |
      select('is_state_attr', 'hvac_action', 'heating') | select('is_state',
      'heat') | list | length > 0) else 'off' }}
    target:
      entity_id: switch.pump_rdc
mode: single

It would have been better if I didn't need to explicitly list the climate entities in the trigger section, but the list will never change anyway, so it's fine. Reducing the number of "objects" to know about is more beneficial in my opinion.

If I need to use the same group of climate entities here and there, I'll go back to grouping them in a helper.

summer mica
#

yeah that'll work - personally i prefer using the helper as i am more likely to get something wrong with re-listing everything in multiple places than i am from having an extra entity