-
-
Save creedda/31d391e007b978aed3879fcc1d0fb22c to your computer and use it in GitHub Desktop.
Synchronize States Between Two Lights
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: Synchronize brightness states and rgb states | |
description: Synchronize the on/off state of 2 entities | |
domain: automation | |
input: | |
entity_1: | |
name: First entity | |
selector: | |
entity: {} | |
entity_2: | |
name: Second entity | |
selector: | |
entity: {} | |
source_url: https://gist.github.com/creedda/31d391e007b978aed3879fcc1d0fb22c | |
mode: restart | |
max_exceeded: silent | |
variables: | |
entity_1: !input entity_1 | |
entity_2: !input entity_2 | |
trigger: | |
- platform: state | |
entity_id: !input entity_1 | |
- platform: state | |
entity_id: !input entity_1 | |
attribute: brightness | |
- platform: state | |
entity_id: !input entity_1 | |
attribute: rgb_color | |
- platform: state | |
entity_id: !input entity_2 | |
- platform: state | |
entity_id: !input entity_2 | |
attribute: brightness | |
- platform: state | |
entity_id: !input entity_2 | |
attribute: rgb_color | |
condition: [] | |
action: | |
- choose: | |
- conditions: | |
condition: template | |
value_template: "{{ is_state(trigger.to_state.entity_id, 'on') }}" | |
sequence: | |
- service: light.turn_on | |
data: | |
rgb_color: '{{ state_attr(trigger.to_state.entity_id, "rgb_color") }}' | |
brightness: '{{ state_attr(trigger.to_state.entity_id, "brightness") }}' | |
entity_id: '{% if trigger.from_state.entity_id == entity_1 %} {{ entity_2 }} {% else %} {{ entity_1 }} {% endif %}' | |
default: | |
- service: light.turn_off | |
target: | |
entity_id: '{% if trigger.from_state.entity_id == entity_1 %} {{ entity_2 }} {% else %} {{ entity_1 }} {% endif %}' |
I had issues so ended up with my own mechanism. I'm linking it here in case it helps others :)
https://gist.github.com/thiswillbeyourgithub/5471d6a48648a8b83020150cad66b8b6
I had issues so ended up with my own mechanism. I'm linking it here in case it helps others :)
https://gist.github.com/thiswillbeyourgithub/5471d6a48648a8b83020150cad66b8b6
What issues?
I don't remeber I'm sorry. I had much trouble setting up my lights and I had just arrived to the world of HA so it might be me or a quirck of my lights.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also created a Volume Version for Media Players:
https://gist.github.com/creedda/a346d0c1ef3a883caeb7207e83ecf58c