Last active
December 19, 2022 03:04
-
-
Save zsarnett/e92cb5a699d79fc0815cf247be445c15 to your computer and use it in GitHub Desktop.
Make two lights follow each other
This file contains hidden or 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: "Make two lights follow each other's state and brightness" | |
description: "This automation blueprint makes it so two lights will always be the same" | |
domain: automation | |
input: | |
light_1: | |
name: "Light #1" | |
description: "This will be one of the lights you want to control" | |
selector: | |
entity: | |
domain: light | |
light_2: | |
name: "Light #2" | |
description: T"his will be the other light to control" | |
selector: | |
entity: | |
domain: light | |
mode: restart | |
trigger: | |
- platform: state | |
entity_id: !input light_1 | |
id: '1' | |
- platform: state | |
entity_id: !input light_2 | |
id: '2' | |
variables: | |
light_1: !input light_1 | |
light_2: !input light_2 | |
light_1_device: "{{ device_id(light_1) }}" | |
light_2_device: "{{ device_id(light_2) }}" | |
action: | |
- choose: | |
- conditions: | |
- condition: device | |
type: is_off | |
device_id: "{{ light_1_device }}" | |
entity_id: !input light_1 | |
domain: light | |
- condition: trigger | |
id: '1' | |
sequence: | |
- type: turn_off | |
device_id: "{{ light_2_device }}" | |
entity_id: !input light_2 | |
domain: light | |
- conditions: | |
- condition: device | |
type: is_on | |
device_id: "{{ light_1_device }}" | |
entity_id: !input light_1 | |
domain: light | |
- condition: trigger | |
id: '1' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness: "{{ state_attr(light_1, 'brightness') }}" | |
target: | |
entity_id: !input light_2 | |
- conditions: | |
- condition: device | |
type: is_off | |
device_id: "{{ light_2_device }}" | |
entity_id: !input light_2 | |
domain: light | |
- condition: trigger | |
id: '2' | |
sequence: | |
- type: turn_off | |
device_id: "{{ light_1_device }}" | |
entity_id: !input light_1 | |
domain: light | |
- conditions: | |
- condition: device | |
type: is_on | |
device_id: "{{ light_2_device }}" | |
entity_id: !input light_2 | |
domain: light | |
- condition: trigger | |
id: '2' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness: "{{ state_attr(light_2, 'brightness') }}" | |
target: | |
entity_id: !input light_1 | |
default: [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment