Skip to content

Instantly share code, notes, and snippets.

@ryankshaw
Last active December 4, 2022 06:08
Show Gist options
  • Save ryankshaw/cddc29dec8b37ddac58161646ed8c433 to your computer and use it in GitHub Desktop.
Save ryankshaw/cddc29dec8b37ddac58161646ed8c433 to your computer and use it in GitHub Desktop.
blueprint:
name: Lamp Follows Swicth
description: Turn on or aff a lamp every time a switch state changes
domain: switch
input:
master_switch:
name: the Master Switch
description: This sensor will be synchronized with the light.
selector:
entity:
domain: switch
target_light:
name: follower
description: The lights to keep in sync.
selector:
target:
entity:
domain: switch
trigger:
- platform: state
entity_id: !input master_switch
action:
- service: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target: !input target_light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment