Bond 2 Light entities with brightness sync

Configure 2 Light entities to operate in unison with brightness sync

NB. Not to be confused with the “group” object, this is for control from physical entities

blueprint:
  name: Light Bonding with Brightness Sync
  description: Bind 2 light entities together to act in unison
  domain: automation
  source_url: https://community.home-assistant.io/t/bond-2-light-entities-with-brightness-sync/264492
  input:
    light_1:
      name: Light 1
      selector:
        entity:
          domain: light
          
    light_2:
      name: Light 2
      selector:
        entity:
          domain: light
      
trigger:
- entity_id:
  - !input light_1
  - !input light_2
  platform: state
- entity_id:
  - !input light_1
  - !input light_2
  platform: state
  attribute: brightness
action:
- entity_id:
  - !input light_1
  - !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_1
  - !input light_2
  condition: state
  state: 'on'
- service: light.turn_on
  data:
    brightness: '{{ trigger.to_state.attributes.brightness }}'
  entity_id:
    - !input light_1
    - !input light_2
2 Likes

There are two State Triggers for each entity (the second State Trigger includes attribute). However, the second State Trigger is unnecessary because the first State Trigger monitors changes to the light’s state and its attributes (i.e. brightness).

From the documentation for State Trigger:

Fires when the state of any of given entities changes. If only entity_id is given trigger will fire for all state changes, even if only state attributes change.

What he said :+1:

When testing it wasn’t replicating the brightness as the “state” of the light hadn’t changed, only the brightness, but whatever works

An unspecified ‘state’ trigger for an entity (ie no to: ‘on’ or from: ‘off’ etc.)
Will fire when it’s state or ANY of its attributes changes
I have a similar automation used for tieing two independent lamps together whilst the TV is on (at the transition it checks if either is on, using that (else lamp1) as the master)

I’ve posted the code used for this (do a search)
But would agree that a light group would be simpler (but I couldn’t use one).

Preface: I’m fairly new to HA. Running HAOS on an old laptop. Not much of a programmer.

I have two Jasco Zigbee dimmers, each of which runs half the lights in my kitchen. I wanted to sync them and make them one large group of lights controllable by either dimmer or Home Assistant.

This blueprint seems to work perfectly with one exception: Sometimes when I activate the “light 2” dimmer (for example to shut off the lights), the bank of lights attached to it will turn off momentarily and then immediately turn back on (as though the state of the “light 1” entity is overriding the action). It can take up to three tries with the physical switch to actually turn both banks of lights off.

Any suggestions?

Works great! Thanks for this, it is exactly what I needed to control and set the brightness in both halves of my family room lights from either of the dimmer switches.