Last active
January 15, 2023 17:17
-
-
Save allistera/50dcc34066b8f2841b1fdca29d9a95d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Switch-activated Light | |
description: Turn on a light on/off following a switch. | |
domain: automation | |
input: | |
switch_entity: | |
name: Switch | |
selector: | |
entity: | |
light_target: | |
name: Light | |
selector: | |
target: | |
entity: | |
domain: light | |
mode: restart | |
max_exceeded: silent | |
condition: | |
- condition: template | |
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}' | |
trigger: | |
platform: state | |
entity_id: !input switch_entity | |
action: | |
- alias: "Turn on/off the light" | |
service: "light.turn_{{ trigger.to_state.state }}" | |
target: !input light_target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment