Skip to content

Instantly share code, notes, and snippets.

@garbled1
Last active May 6, 2023 19:15
Show Gist options
  • Save garbled1/8477f610a04511cbcc6aa61f5f9d6caa to your computer and use it in GitHub Desktop.
Save garbled1/8477f610a04511cbcc6aa61f5f9d6caa to your computer and use it in GitHub Desktop.
Homeassistant Blueprint - Directional Light Bonding with Brightness Sync
blueprint:
name: Directional Light Bonding with Brightness Sync
description: Bind light entity B to entity A's state
domain: automation
input:
light_1:
name: Controller Light A
selector:
entity:
domain: light
light_2:
name: Slave Light B
selector:
entity:
domain: light
trigger:
- entity_id:
- !input light_1
platform: state
- entity_id:
- !input light_1
platform: state
attribute: brightness
action:
- entity_id:
- !input light_2
service: '{% if trigger.to_state.state == "on" %} light.turn_on {% elif trigger.to_state.state == "off" %} light.turn_off {% endif %}'
- entity_id:
- !input light_2
condition: state
state: 'on'
- service: light.turn_on
data:
brightness: '{{ trigger.to_state.attributes.brightness }}'
entity_id:
- !input light_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment