Use a target value from one climate as target for another climate

Hi there,

I am using Fritz! dect 301 radiator thermostats (along with fritz! dect 440 temperature sensors), but I can’t get a ‘readout’ on when they are actually heating, only when heat mode is one. I like to know when they are heating, e.g. open so hot water can flow through, so I can send a command to the boiler to run. I have this method working for my underfloor heating, but not for the radiators.

Now I got the following solution:

  • I create an extra thermostat, e.g. bathroom-2 (“badkamer” in Dutch)
  • I use the sensor from the corresponding 440 temperature sensor (in fritz! box assigned to the 301 radiator thermostat).
  • I now know when the thermostat-2 is heating, so I can control the boiler with an input_boolean helper.
  • I want to use the the target temperature of the thermostat-2 as the target temperature for the radiator thermostat. Here I can’t get it to work, see below:

What works:

- platform: generic_thermostat
    name: Badkamer_thermostaat-2
    unique_id: "Badkamer_thermostaat-2"
    min_temp: 12
    max_temp: 35
    target_temp: 16
    hot_tolerance: 0.5
    target_temp_step: 0.5
    heater: input_boolean.thermostat_status_badkamer-2
    target_sensor: sensor.current_temp_badkamer-2

  - platform: template
    sensors:
      current_temp_badkamer:
        friendly_name: "Current T badkamer"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('climate.badkamer', 'current_temperature') }}" 
  - platform: template
    sensors:
      target_temp_badkamer:
        friendly_name: "Target T badkamer"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('climate.badkamer', 'temperature') }}" 
  - platform: template
    sensors:
      target_temp_badkamer_2:
        friendly_name: "Target T badkamer 2"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('climate.badkamer_thermostaat-2', 'temperature') }}"

What doesn’t work:
An automation to copy the target temperature from badkamer-2 to badkamer, I wanted it like this:

alias: Target_badkamer
description: Van target temp badkamer 2 naar target temp badkamer
trigger:
  - platform: state
    entity_id:
      - sensor.target_temp_badkamer_2
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: sensor.target_temp_badkamer_2
    target:
      entity_id:
        - climate.badkamer
mode: single

However, I can’t get this to work, when I change the target badkamer-2 it doesn’t change target badkamer. If for example I use this:

alias: Target_badkamer
description: Van target temp badkamer 2 naar target temp badkamer
trigger:
  - platform: state
    entity_id:
      - sensor.target_temp_badkamer_2
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: 10
    target:
      entity_id:
        - climate.badkamer
mode: single

Then it does work, e.g. changing target badkamer-2 changes target badkamer to 10 degrees.
So the automation itself works, but using a sensor / value as new temperature just doesn’t.

Any tips on how I can get this to work?

You can definitely use a state to replace the 10 in your last automation.
Pick your favorite syntax:

action:
  - service: climate.set_temperature
    data:
      temperature: "{{ states('sensor.target_temp_badkamer_2') }}"

or

action:
  - service: climate.set_temperature
    data:
      temperature: >
        {{ states('sensor.target_temp_badkamer_2') }}
alias: Target_badkamer
description: Van target temp badkamer 2 naar target temp badkamer
trigger:
  - platform: state
    entity_id:
      - sensor.target_temp_badkamer_2
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: '{{ trigger.to_state.state }}'
    target:
      entity_id:
        - climate.badkamer
mode: single

Reference: Automation Trigger Variables

Hey @123 Taras,

Does the trigger.to_state.state works now?
Because in my memory, that was not reliable like one or 2 years ago.
I remember it because I had to change some of my automations to deal with it.
Might be fixed now thou.

All I can say is it has always worked in my automations (since I started using Home Assistant in 2018).

NOTE

Any automation whose condition or action references the trigger variable cannot be tested by manually executing the automation (either via its ‘Run’ menu command or the automation.trigger service call). Manual execution doesn’t exercise the automation’s trigger(s) so the trigger variable is undefined anywhere it is referenced.

Reference: Testing your automation

Thank you very much Olivier :slight_smile: works great!