I now have stability, the two switches are in Home Assistant are triggered by Xiaomi motion sensors.
- Motion Sensor “on” = light service “turn_on”
- Motion Sensor “off” = light service “turn_off”
It works great for us during the night as we can “hands off” and not touch the wall switches (and just rely on the automation). It’s reliable, they turn on and off every time and the state is accurate in Home Assistant since it called the command.
During the day though, we switch off the “Auto Lights” automation - so the lights can only be operated manually. The same problem exists - when a light is switched on at the wall, it doesn’t reflect in Home Assistant.
I’m thinking a dirty workaround might be to check the state of the switch on a loop every 10-60 seconds (in case it has been switched at the wall), then update the status in Home Assistant. Would this work?