Sync state of switch and a climate entity. Used to control climate from a remote switch and reflect the climate state on the switch LED indicator.
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the forum topic URL:
blueprint:
name: Sync climate with a switch entity
description: |
Sync states of a climate entity and a switch.
Useful when you want to track the state of the climate entity on, for example, a switch with a LED indicator and control the heater from the same switch.
domain: automation
input:
switch:
name: Choose switch device
selector:
entity:
domain: switch
climate:
name: Choose climate device
selector:
entity:
domain: climate
mode: single
max_exceeded: silent
variables:
climate: !input climate
switch: !input switch
trigger:
- platform: state
entity_id: !input climate
- platform: state
entity_id: !input switch
condition:
- condition: template
value_template: >-
{{ states(climate | replace("idle", "on") | replace("heat", "on") | replace("cool", "on") | replace("dry", "on")) !=
states(switch) }}
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.entity_id == climate }}'
sequence:
- service: >-
switch.turn_{{ "on" if trigger.to_state.state != "off" else "off" }}
target:
entity_id: !input switch
- conditions:
- condition: template
value_template: '{{ trigger.entity_id == switch }}'
sequence:
- service: 'climate.turn_{{ trigger.to_state.state }}'
target:
entity_id: !input climate