Linked Entities - keep mutlple entities binary state in sync (lights, switches, etc.)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Linked Entities v1.2 :on:

(changelog below)

This blueprint allows you to easily create/maintain an automation that links the state of multiple entities:

  • turn ANY linked entity ON, it will turn ON ALL linked entities.
  • turn ANY linked entity OFF, it will turn OFF ALL linked entities.
  • set the brightness of any light entity, it will set the same brightness of ALL linked light entities.
  • set the color temp of any light entity, it will set the same color temperature of ALL linked light entities.
  • set the speed (percentage) of any fan entity, it will set the speed of ALL linked fan entities.

NOTE: You can select any entity with an ON/OFF state (switches, lights, etc.)

My main use-case was for multiple light switches in the house controlling the same light, but I also use it for other things:

  • at dawn, when I turn on the external lights (a shelly switch), I also link the pool light mqtt switch.
  • when I want to open the external gate, I can use several linked switches in multiple rooms of the house
  • when I want to manually turn on/off the irrigation system, I use two switches (internal and external) to activate my RainMachine cycle

I’m sure you’ll find many more use-cases. :slight_smile:

CHANGELOG:

  • 1.2: (2024-01-28 - thanks @phrak / @TimU for the PR)

    • Changed the action to a “Choose” building block to support fan, light and future attributes
    • Added support for linked fan speeds
    • Added support for linked light brightness and light color temperature
  • 1.1: 2024-01-08T23:00:00Z

    • Optimized service call leveraging trigger.id
    • Introduced max_exceeded to avoid warnings in log due to possible self-triggering
    • Introduced a small delay after the service call to throttle the automation
  • 1.0: 2023-12-28T23:00:00Z

    • First official release

If you like to show your support please hit the :heart: button and click here:

contributions - welcome

Source:
alexdelprete - ha-blueprints stars - ha-blueprints forks - ha-blueprints

Support:
HA Community - Topic

7 Likes

@alexdelprete This is great.

Just used it to turn on and off the indicator lights on the ZEN32 5 button switch.

Recently utilized the ZEN32 Scene Controller blueprint to use the small Scene buttons to control other devices. However, using that you do not want the indicator LED lights to just follow the button presses on the ZEN32, what you really want is for the indicator lights to follow the state of the other device being controlled.
Your blueprint makes that easy.

How To: Set one of the entities in this blueprint automation to one of the “XXX Button Y indication - Binary” entries where
XXX is your ZEN32 device name
Y is the button that you want the LED light to be synced
where 1 = the big button, 2 is top left little button, 3 is top right, 4 is bottom left, 5 is bottom right. NOTE: This is NOT the same as the scene name numbers where Scene 005 is the big button.

Thanks Chris. For more than a year I had a custom automation based on groups, but it was difficult to maintain (I had 20 groups with 20 automations). The main use-case was Sonoff TX3 light switches. I use them to control lights and relays, but often I need to manage a single light or relay from several rooms.

Lately I used it to link the pool lights, that are managed through a Shelly relay, with the internal relay of my new Hayward Aquarite salt chlorinator, which also has internal relays for lights, etc. So instead of rewiring the lights and connect them to the Aquarite light relay, I simply linked the Shelly with the Aquarite relay entity. So a “virtual” connection, and it works perfectly. Now when I use the Aquarite to turn on the lights, when I turn its relay ON, the Shelly goes ON and the lights are turned ON.

It’s really a simple thing, and I think that the HA Group entity should offer this kind of functionality natively. But since it doesn’t, I created this simple Blueprint.

Glad it helped you. :slight_smile:

1 Like

Brilliant, this is exactly what I was after!
Thank you :two_hearts:

v1.1 released. See changelog in OP.

1 Like

Please paste the link in the browser and show me the first lines…

It’s a caching issue, or you were trying before I fixed it. You should these 4 lines at the beginning of the file, and with my name without @, that was the cause of the problem.

blueprint:
  name: Linked Entities
  author: alexdelprete
  description: >-

Actually, the message says the key “author” doesn’t exist and should be removed.

HA Docs: About the blueprint schema - Home Assistant

I can reimport it without errors here. What version of HA are you using?

I think the @ screws the parsing, so it interprets my name as a key, not as a value.

UPDATE: checked HA Core sources, the blueprint integration has author in the structure, it was implemented 2y ago:

Probably that is it… I am using 2022.9.7

Thanks!

1 Like

I removed the author key so you and other users with very old versions will be able to use it without issues.

Let me know if it works. :slight_smile:

1 Like

Yes, it worked now. Thanks again.

1 Like

Glad it worked. Please let me also know if the automation works, if there’s something in the logs, etc. Unfortunately I’m the only one who tested it extensively, and I want to be 99% sure everything’s ok. :slight_smile:

Thank you.

1 Like

Hi Alex, thank you for building this Blueprint! It is so simple and it works very well.

I have created a pull request to add a few enhancements for your consideration:

    - Changed the action to a "Choose" building block to support fan (and future) attributes
    - Added support for linked fan speeds
    - Added support for linked light brightness and light color temperature

Happy to discuss here on on GitHub as you wish.

Keep up the great work.

Great idea. Thanks a lot for your contribution. I can only test the lights, I have no fans. Did you test it 100%? No issues? If so, I will merge it, please let me know. :slight_smile:

I’m a firm believer that the best things are the simple ones. Less is more… :slight_smile:

2 Likes

Yes, I have tested it on a pair of ceiling fans with dimmable lights and selectable colour temps.

Works perfectly for any fan that uses “percentage” as the speed attribute - This should be most fans.

I’m happy to release it into the wild :smile:

Well, I guess nothing will explode, so let’s merge it and see what happens. :smiley:

1 Like

I’ve had issues with similar blieprints if I accidently press the switch twice in a row very fast, both switches end up in an infinite loop with no ability to stop toggling

shouldn’t happen with this, but feel free to try.

i tried with a swith and dimmable smart led bulb’s group. It really can enter an endless loop if you change the switch state twice in a raw faster than light transition time is :frowning: