Heating Trigger Automation

I am using several Aqara E1 Radiator valves - all work well and controllable within HA. I also use a Nest Thermostat. I trying to create automations that request that the Nest is turned on or off depending on the demands from the E1s.

I am trying initially with one radiator to prove the logic works, but would also like to know how incorporate other radiators in the automation.

I’ve checked this in the Developer Tools and it works as expected:

{{state_attr('climate.dining_room_radiator_4', 'temperature')|float(0) -
      state_attr('climate.dining_room_radiator_4',
      'current_temperature')|float(0) <= 0 }}

I think (!) I’m nearly there, but the following never triggers?

TIA

alias: "Heating: Turn Heating OFF"
description: ""
trigger:
  - platform: template
    value_template: >-
      {{state_attr('climate.dining_room_radiator_4', 'temperature')|float(0) -
      state_attr('climate.dining_room_radiator_4',
      'current_temperature')|float(0) <= 0 }}
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: 5
    target:
      device_id: fe96ad84846b5e889c4f91a66cf715e3
mode: single

The example’s Template Trigger is incorrect.

alias: "Heating: Turn Heating ON"
description: ""
trigger:
  - platform: template
    value_template: >
      {% set x = 'climate.dining_room_radiator_4' %}
      {{state_attr(x, 'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) > 0 }}
condition: []
action:
  - service: climate.set_temperature
    data:
      hvac_mode: heat
      temperature: 25
    target:
      device_id: fe96ad84846b5e889c4f91a66cf715e3
mode: single

Thank you, a reboot finally fixed it :slight_smile:

Are you able to share how to incorporate additional radiators.

Heat OFF should lower the thermostat if all radiators are up to target temperature and

Heat ON should turn up the thermostat if one radiators needs heat.

You designed your Template Trigger to trigger when the value of the temperature attribute is greater than the value of the current_temperature attribute.

I had the same need and solved it differently by using triggers state

To SWITCH ON your central heating

  - platform: state
    entity_id:
      - climate.vanne_e1_salon
    attribute: hvac_action
    from: idle
    to: heating
    for:
      hours: 0
      minutes: 0
      seconds: 10

you repeat the trigger for each of your TRV you want to trigger your central heating

To SWITCH OFF your central heating,
you do the opposite with a trigger for each TRV

  - platform: state
    entity_id:
      - climate.vanne_e1_salon
    attribute: hvac_action
    from: heating
    to: idle
    for:
      hours: 0
      minutes: 0
      seconds: 10

And add a condition also for each TRV

condition:
  - condition: state
    entity_id: climate.vanne_e1_salon
    attribute: hvac_action
    state: idle

in other word you transform a OR for your trigger into a AND

  1. you need for any TRV that goes to ‘heat’ (OR) → Turn on your central heating

  2. you need a TRV to go to ‘idle’ if all others are already in ‘idle’ (AND) → Turn off your central heating

Hi - I am trying to use your automation but I’ve got 2 rooms that have a total of 3 Aqara TRVs.
How can the ‘Turn heating ON’ and ‘Turn heating OFF’ be adapted to take an ‘ON’ request from either of the TRVs, and the ‘OFF’ to trigger when all 3 TRVs are above or at desired temp?

Thank you.

Here you go…


alias: "Heating: Turn Heating ON"
description: ""
trigger:
  - platform: template
    value_template: >
      {% set x = 'climate.m_and_d_small_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.m_and_d_big_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.landing_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_landing_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_1' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_2' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_3' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.dining_room_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.hallway_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.toilet_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) >
      0 }}
condition:
  - condition: state
    entity_id: input_boolean.heating_master_switch
    state: "on"
action:
  - service: climate.set_temperature
    data:
      hvac_mode: heat
      temperature: 32
    target:
      entity_id: climate.nest_thermostat
mode: single

That is perfect, thank you for this. Would you be able to amend the OFF automation as well, so it takes inputs from multiple TRVs? Thank you!

Here you are…

alias: "Heating: Turn Heating OFF"
description: ""
trigger:
  - platform: template
    value_template: >
      {% set x = 'climate.m_and_d_small_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.m_and_d_big_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.landing_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.xxxx_landing_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_1' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_2' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.lounge_radiator_3' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.dining_room_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.hallway_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
  - platform: template
    value_template: >
      {% set x = 'climate.toilet_radiator' %} {{state_attr(x,
      'temperature')|float(0) - state_attr(x, 'current_temperature')|float(0) <=
      0 }}
condition:
  - condition: and
    conditions:
      - condition: template
        value_template: >
          {% set x = 'climate.m_and_d_small_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.m_and_d_big_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.xxxx_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.landing_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.xxxx_landing_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.lounge_radiator_1' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.lounge_radiator_2' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.lounge_radiator_3' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.dining_room_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.hallway_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
      - condition: template
        value_template: >
          {% set x = 'climate.toilet_radiator' %} {{state_attr(x,
          'temperature')|float(0) - state_attr(x,
          'current_temperature')|float(0) <= 0 }}
action:
  - service: climate.set_temperature
    data:
      temperature: 9
    target:
      entity_id: climate.nest_thermostat
mode: single

Thank you!

hvac_action does not work with Aqara E1 :frowning: or have you managed to male it work? It always reports heating.

That’s nothing to do with the E1’s - it’s whatever you need to set your thermostat or boiler switch to.