Created a blueprint for linking On/Off/Brightness for smart switch and shelly dimmers

Hi Guys

I created a new blueprint for linking my smart switches as well as shelly dimmer together.
So far I am very happy with it, seems to do its job.

Please feel free to comment on it, if you think there are things missing, or whatever.

Description below

Synchronize Entities for On, Off, and Brightness Control

This blueprint allows you to synchronize multiple entities for controlling their on/off state and brightness level. It simplifies the experience of managing devices by ensuring they respond consistently, regardless of which entity you use.

Overview

Imagine you have two wall switches in your corridor. Turning on the first one will also indicate the light’s status on the second switch. You can adjust brightness from any device, whether it’s a mobile app or a physical switch.

Key Features

 - When one entity is turned on or off, the others will follow suit.
 - Changing brightness on one entity will update the brightness for all linked entities.

Requirements

 - Brightness attribute must be a numeric brightness value, not a step up/down indicator.
 - All selected entities MUST support `homeassistant.turn_on` and `homeassistant.turn_off`.
 - Tested on Home Assistant version 2023.09.

Tested Devices

 - Moes wall smart switch (non-dimmer)
 - Moes wall smart switch with dimmer functionality
 - Shelly Dimmer 2

Credits

- Inspiration and starting point from @aderusha's [Link On/Off State of Multiple Devices](https://gist.github.com/aderusha/4d2c8600a2e4771b91b8efc555946413)
1 Like

Thank you for the amazing contribution @bthuree.

I have tested this using a couple of Shelly Dimmer2 devices. Only one of these devices is connected to physical switches.

When turning the devices on or off, or changing brightness levels, in the Shelly App, using HA or directly on the Shelly devices’ web page, it all works perfectly.

When using the physical buttons, there is an odd rebound effect. For example, when you use the physical button to turn the attached lamps on, it does this for a very short duration, then the second device turns on, then first device turns off, followed by the second device. It is the same effect when changing brightness or turning off using the physical buttons.

Would it be possible to modify the code to have a master/ slave relationship rather than them both synced together?