Skip to content

Instantly share code, notes, and snippets.

@aderusha
Created September 12, 2022 21:19
Show Gist options
  • Save aderusha/4d2c8600a2e4771b91b8efc555946413 to your computer and use it in GitHub Desktop.
Save aderusha/4d2c8600a2e4771b91b8efc555946413 to your computer and use it in GitHub Desktop.
Select multiple entities to link their on/off state. If any selected entity is turned on or off, the other selected entities will be sent a matching on or off command.
@dbrand666
Copy link

I did an analysis here:
https://community.home-assistant.io/t/synchronize-the-on-off-state-of-2-entities/259010/81?u=dbrand666
I think I went a little overboard - assuming there are multiple controllers. In HA, there's only one queue we really need to worry about.

@RhavoX
Copy link

RhavoX commented Apr 1, 2024

There is a bug in this blueprint. If you turn lights on and off in quick succession they desynchronize sometimes and keep turning on and off... Fast... This could wear out the switches if this happens randomly or at night where you might not notice. I guess some small delays could be introduced to double check the state?

@RhavoX
Copy link

RhavoX commented Apr 1, 2024

After some tweaking it seems that the mode is the issue for me. Changing this to restart fixed the issue. Perhaps some improvements could be made here?

@prezes210
Copy link

When iam using this automation getting this error from

The automation "Link Staircase Light Switches" (automation.link_staircase_down_up_l1_light_switches) has an action that calls an unknown service: homeassistant.turn_unavailable.

This error prevents the automation from running correctly. Maybe this service is no longer available, or perhaps a typo caused it.

HA version 2024.5.4

@ChrisMD123
Copy link

I have an idea/feature request. One of the lights that I sync using this blueprint is connected to a conventional wall switch. When I turn off the switch, the light goes to Unavailable status.

It would be great if there were a selection option in the setup for the blueprint to set the behavior if one of the synced objects goes unavailable. I'm thinking three options:

  • Turn all off
  • Turn all on
  • Do nothing

I'd give it a try myself but I'm not familiar enough with blueprints to be confident with it.

@rubenhak
Copy link

rubenhak commented Mar 14, 2025

Hi, I'm trying out this blueprint. It works most of the times. Testing out with two switches. The failure scenario:

  1. Manually turn on Light 1
  2. Light 2 turns on
  3. Within 3 seconds turn off Light 2
  4. Light 1 stays turns on.
  5. HA dashboard always reflects the correct state.
    NOTE: If I wait longer then the automations would work.

How can I debug this?
I noticed the same behavior with a very similar automation that uses mode: restart mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment