Automation Consolidation

I have three climate zones in the house and I want to put an automation in place that resets the temperature low/high targets if someone manually adjusts the thermostat outside of a predefined range. What’s the best way to do this for three thermostats in a single automation, or, if necessary, one automation of low and a second for high.

Low Temp Automation

alias: Climate - Low Temp Adjust (Downstairs)
description: ''
trigger:
  - platform: state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_low
condition:
  - condition: numeric_state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_low
    below: '70'
action:
  - service: climate.set_temperature
    data:
      entity_id: climate.tstat_downstairs_main
      target_temp_low: 70

High Temp Automation

alias: Climate - High Temp Adjust (Downstairs)
description: ''
trigger:
  - platform: state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_high
condition:
  - condition: numeric_state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_high
    above: '77'
action:
  - service: climate.set_temperature
    data:
      entity_id: climate.tstat_downstairs_main
      target_temp_high: 77

Thanks!

I figured this out on my own. It may not be the most efficient way to accomplish my goal, but it works. If anyone has suggestions on a better way to do this, please chime in.

Low Temp Automation

alias: Climate - Low Temp Fix
description: ''
trigger:
  - platform: state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_low
  - platform: state
    entity_id: climate.tstat_upstairs_main
    attribute: target_temp_low
  - platform: state
    entity_id: climate.tstat_master_main
    attribute: target_temp_low
condition:
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: climate.tstat_downstairs_main
        attribute: target_temp_low
        below: '70'
      - condition: numeric_state
        entity_id: climate.tstat_upstairs_main
        attribute: target_temp_low
        below: '70'
      - condition: numeric_state
        entity_id: climate.tstat_master_main
        attribute: target_temp_low
        below: '70'
action:
  - service: climate.set_temperature
    data:
      entity_id: '{{ trigger.entity_id }}'
      target_temp_low: 70
      target_temp_high: >-
        {{
        states[trigger.to_state.domain][trigger.to_state.object_id].attributes.target_temp_high
        }}
mode: single

High Temp Automation

alias: Climate - High Temp Fix
description: ''
trigger:
  - platform: state
    entity_id: climate.tstat_downstairs_main
    attribute: target_temp_high
  - platform: state
    entity_id: climate.tstat_upstairs_main
    attribute: target_temp_high
  - platform: state
    entity_id: climate.tstat_master_main
    attribute: target_temp_high
condition:
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: climate.tstat_downstairs_main
        attribute: target_temp_high
        above: '77'
      - condition: numeric_state
        entity_id: climate.tstat_upstairs_main
        attribute: target_temp_high
        above: '77'
      - condition: numeric_state
        entity_id: climate.tstat_master_main
        attribute: target_temp_high
        above: '77'
action:
  - service: climate.set_temperature
    data:
      entity_id: '{{ trigger.entity_id }}'
      target_temp_high: 77
      target_temp_low: >-
        {{
        states[trigger.to_state.domain][trigger.to_state.object_id].attributes.target_temp_low
        }}
mode: single