I have a smart light and a smart switch. The switch controls the switching of the smart light using the “lingdong mode/凌动模式”
I don’t know the exact English term for “lingdong mode,” but it refers to a mode where the switch doesn’t directly control the circuit’s on/off state. it sends commands to the smart light through a double-click action to turn it on or off.
The switch can control the light, but the light cannot control the switch. This creates a problem where, in Home Assistant, the light may be on when the switch is off, or the light may be off when the switch is on.I would like to see both devices’ states fully synchronized in Home Assistant.
I have some ideas and tried hard, but they all failed:
Creating automation will lead to an endless loop
Find the light configuration and modify its turn_on and turn_off to smart switches.
Create a custom entity, call the light dimming and switch
Create a light group and disable the turn_on and turn_off of light
To leave a reference for future users, I used a template to create a lamp.
Its on/off function is controlled by a switch, and its switch state, color temperature, and brightness are synchronized with the lamp light. This lamp will replace two entities. In theory, this approach can replace any combination of smart light and smart switch.
However, there are still some flaws. When the lamp is turned off, adjusting certain parameters will still trigger the lamp to turn on. In this case, the state of the lamp and the switch will still be opposite.