Thermostat Automation set temperature the same as another thermostat

Hello,
I have a Generic Thermostat set up in the Basement and another set up in the Study. I would like to make an automation that would set the basement thermostat to the same temperature as the study thermostat whenever the slider is changed on the study thermostat.
I am just starting out and not sure how to do this.

#Thermostat Automation - Set basement temp same as study
- alias: Set basement temp same as study
  trigger:
  - platform: state
    entity_id: climate.Study
    to: "{{set_temperature.value, Temp}}" # Not sure how to get the value from the Study Thermostat
  action:
    service: climate.set_temperature
    entity_id: climate.Basement
    data_template:
      set_temperature: "{{trigger.set_temperature.Temp}}" # Not sure how to set the value from the Study thermostat
#Thermostat Automation - Set basement temp same as study
- alias: Set basement temp same as study
  trigger:
    platform: state
    entity_id: climate.study
  action:
    service: climate.set_temperature
    data_template:
      entity_id: climate.basement
      set_temperature: "{{ state_attr('climate.study' , 'temperature' }}"

Trigger on all changes to the first one, set the second one to the temperature of the first one. Please note I don’t use climate so I don’t know the name of the attribute, might be ‘target_temp’ or something.

Also, in the event that the state of the first one doesn’t change, rather just an attribute changes, you’ll need a template trigger to monitor the attribute instead.

Hope this helps.

1 Like

Thank you Marc. Finally got it to work after some syntax changes. This is the Automation:

#Thermostat Automation - Set basement temp same as study
- alias: Set basement temp same as study
  trigger:
  - platform: state
    entity_id: climate.Study
  action:
  - service: climate.set_temperature
    data_template:
      entity_id: 
        - climate.Basement
      temperature: "{{ state_attr('climate.Study' , 'temperature')}}"
1 Like