Skip to content

Instantly share code, notes, and snippets.

@jvmahon
Last active August 18, 2024 12:50
Copy Light State to Multiple Controlled Devices
blueprint:
name: Controlling Device Sets Controlled Device brightness states
description: Synchronize the on/off state of 2 entities
domain: automation
input:
controlling_light:
name: Controlling Light
selector:
entity:
filter:
- domain:
- light
multiple: false
target_light:
name: Target Light
selector:
entity:
filter:
- domain:
- light
multiple: true
source_url: https://gist.github.com/jvmahon/39ca2d1995446b02bc7266bf2678e1b8
mode: restart
max_exceeded: silent
variables:
entity_1: !input controlling_light
entity_2: !input target_light
trigger:
- platform: state
entity_id: !input controlling_light
- platform: state
entity_id: !input controlling_light
attribute: brightness
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: !input controlling_light
state: "on"
sequence:
- data:
brightness: |
{{ state_attr(entity_1, 'brightness') }}
action: light.turn_on
target:
entity_id: !input target_light
- conditions:
- condition: state
entity_id: !input controlling_light
state: "off"
sequence:
- data:
entity_id: !input target_light
action: light.turn_off
default:
- target:
entity_id: !input target_light
action: light.turn_on
data: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment