Set temperature of one thermostat to another in automation

Hi all,

I have 2 thermostats in my home and they are both recognised by home assistant because I can set up the temperature of one or the other in the lovelace UI.

If I use the developper tools, when I set the temperature for one or the other, it works fine.

Now I would like that when I set manually and physically on the device the temperature that the other sets itself to the same temperature.

I don’t really understand how to set the temperature on the thermostat to the value that is coming from the other thermostat.

I am using Home Assistant version: 2021.12.10

Believe it would be done like this

action:
  - service: climate.set_temperature
    target:
      entity_id: climate.upstairs
    data:
      temperature: {{ state_attr('climate.main_floor', 'temperature') }}

Hi,

Thanks for that, I’ll try this…

did you get this to work ? how ? I wont work in my automation

Have you tried something like this? This will keep two thermostats in synch.

alias: Set Temperatures Equal
description: Keep two thermostats in sync
trigger:
  - platform: template
    value_template: >-
      {{ state_attr('climate.main_floor', 'temperature') >
      state_attr('climate.upstairs', 'temperature') }}
    id: Greater
  - platform: template
    value_template: >-
      {{ state_attr('climate.main_floor', 'temperature') <
      state_attr('climate.upstairs', 'temperature') }}
    id: Less
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Greater
        sequence:
          - service: climate.set_temperature
            data:
              temperature: '{{ state_attr(''climate.main_floor'', ''temperature'') }}'
            target:
              entity_id: climate.upstairs
      - conditions:
          - condition: trigger
            id: Less
        sequence:
          - service: climate.set_temperature
            data:
              temperature: '{{ state_attr(''climate.upstairs'', ''temperature'') }}'
            target:
              entity_id: climate.main_floor
    default: []
mode: single       

I have tested on my system and it works

Here is a screenshot of the debugger when I set main floor > upstairs

2 Likes

@AllHailJ
Hi there, I know its an old post, but how do I manage that the changes are not a loop between the 2 thermostats?

The easiest way is to make one thermostat dominant and one thermostat subservient. What I mean by that is you can control one thermostat with a schedule (dominant) and the other thermostat with an automation.

Does this make sense to you?

Thanks for the reply. No, doesnt make much sense, sorry. I want to controll one or the other to set the temperature, but I think there is no way to say: if temp changed on x, this will be the master, and y is slave and do the same. A pitty :frowning:

I mean, your automation works, but only if I raise the Temp from 19° to 20° for example. But If I want to lower the Temp on one of the thermostats, it doesnt work

If your goal is to keep two thermostats in sync then here is a way to do it.

alias: Make Main Floor Master
description: Keep two thermostats in sync
trigger:
  - platform: template
    value_template: {{ state_attr('climate.main_floor', 'temperature') <>  state_attr('climate.upstairs', 'temperature') }}
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: '{{ state_attr(''climate.main_floor'', ''temperature'') }}'
    target:
      entity_id: climate.upstairs
mode: singletype or paste code here

The trigger looks to see if the two temperatures are the same. If they are not equal, set the upstairs to the main floor temperature. This makes the main floor the dominant thermostat. If you only want this from say 18:00 to 22:00 in the evening, you can add that to the condition.

I have not run the automation through debug, so there could be typo’s

But that defines a Master by default, right? What If I choose to change the temps from the slave? will the master follow?

edit: automation doesnt work

No. You cannot have two masters. There is no way the system can know the master at a specific point in time unless you tell it.

Not even with a time-delay or something like that? I mean, the trigger is the manual change of the target-temp, is it possible to use that info as indicator to become master?