Skip to content

Instantly share code, notes, and snippets.

@deg0nz
Last active January 10, 2026 21:25
Show Gist options
  • Select an option

  • Save deg0nz/5f607898040c4359c541fe15c9d7f1c0 to your computer and use it in GitHub Desktop.

Select an option

Save deg0nz/5f607898040c4359c541fe15c9d7f1c0 to your computer and use it in GitHub Desktop.
HA Lights sync
blueprint:
name: Master Light Sync
description: >-
Syncs power state, brightness, and color temperature from a single master light
to one or more follower lights. Only the master triggers updates — changes to
followers do not propagate back.
domain: automation
homeassistant:
min_version: 2024.10.0
input:
master_light:
name: Master Light
description: The light that controls the followers.
selector:
entity:
filter:
- domain: light
follower_lights:
name: Follower Lights
description: Lights that will mirror the master light's state.
selector:
entity:
filter:
- domain: light
multiple: true
transition_time:
name: Transition Time
description: Transition duration in seconds when syncing changes.
default: 0.5
selector:
number:
min: 0
max: 10
step: 0.1
unit_of_measurement: seconds
mode: queued
max: 2
triggers:
- trigger: state
entity_id: !input master_light
variables:
master: !input master_light
followers: !input follower_lights
transition: !input transition_time
conditions:
# Only proceed if the state actually changed (not just attribute update with same values)
- condition: template
value_template: >-
{{ trigger.from_state is not none and
(trigger.to_state.state != trigger.from_state.state or
trigger.to_state.attributes.get('brightness') != trigger.from_state.attributes.get('brightness') or
trigger.to_state.attributes.get('color_temp') != trigger.from_state.attributes.get('color_temp') or
trigger.to_state.attributes.get('color_temp_kelvin') != trigger.from_state.attributes.get('color_temp_kelvin')) }}
actions:
- choose:
# Master turned off
- conditions:
- condition: template
value_template: "{{ trigger.to_state.state == 'off' }}"
sequence:
- action: light.turn_off
target:
entity_id: "{{ followers }}"
data:
transition: "{{ transition }}"
# Master turned on or attributes changed while on
- conditions:
- condition: template
value_template: "{{ trigger.to_state.state == 'on' }}"
sequence:
- action: light.turn_on
target:
entity_id: "{{ followers }}"
data:
transition: "{{ transition }}"
brightness_pct: >-
{% set brightness = state_attr(master, 'brightness') %}
{% if brightness is not none %}
{{ (brightness / 255 * 100) | round(0) }}
{% else %}
{{ none }}
{% endif %}
color_temp_kelvin: >-
{% set kelvin = state_attr(master, 'color_temp_kelvin') %}
{% if kelvin is not none %}
{{ kelvin }}
{% else %}
{{ none }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment