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
3 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?

1 Like

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.

First, thank you for this. It works but with a 3ish second delay. Is there a way to remove the delay?

hey thanks for this, is there anyway to make this a 1 way sync? I just want light 1 to control light 2, but If I manually change light 2, I don’t want light 1 affected

1 Like

I’ve tried to use this and the brightness changes on the switches themselves seem to fight eachother. If i change the brightness, 1 changes, then it changes back because the 2nd switch is set for the lower brightness, but the 2nd swtich changes, and then forces the 1st switch to change back to the higher brightness, and they fight and fight, to no end.
Any way to fix this?

I’m hoping to do the same with fans at some point too. The idea is I have a dummy switch switch is basically setup the same way as a 3-way, but without physical connection. But both switches have dimming and fan speed control on them.

2 Likes

It probably has to do with dim speed on the swtiches, try throwing in a delay.

Works great! Will there be one which sync colour too?

Great blueprint, how can I make only follow light 1

@chrissalter can you help me to make bond only follow Light_1 or Light_2

I’m getting errors on both the level sync and just regular sync of:
Bond already running…
everything works fine… is this ok or am I doing something wrong?

Logger: homeassistant.components.automation.living_room_bond
Source: helpers/script.py:1453
Integration: Automation (documentation, issues)
First occurred: 7:30:35 PM (3 occurrences)
Last logged: 7:30:35 PM

Living Room BOND: Already running