How to fully synchronize status: smart switch and the smart light it controls

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:

  1. Creating automation will lead to an endless loop
  2. Find the light configuration and modify its turn_on and turn_off to smart switches.
  3. Create a custom entity, call the light dimming and switch
  4. Create a light group and disable the turn_on and turn_off of light

You may search for template light which can provide a solution to your scenario.