ZHA light state bounces and often not reflected accurately

Has anyone noticed that when lights are turned on or off that the state change is not reflected correctly in HA? When I turn off lights via the UI, the light actually turns off, but the state in HA bounces off and back on. Usually it just sticks at on after the first attempt and I have to just click to turn it off again (I’m assuming another Zigbee command is sent out) to make the state show properly. Sometimes I have to click it a few times in order to get it to properly show that the light is off.

If turning the light on, it usually correctly shows that the state is on, but it often gets the brightness state wrong - sometimes bouncing around before finding it, sometimes just never showing it correctly.

Alternatively, I have remotes paired with LL that control light groups directly, and when using those to turn the lights on or off or dim, the state doesn’t reflect in HA.

This seems to be more on the state of light groups, but I see it on individual lights as well.

I’m switching from Deconz to ZHA on Conbee II - Deconz was always accurate. Having the state bouncing around is tripping up some of my automations where I’m triggering on light state.

Nobody is seeing this?

I’ve not seen this behavior, but to me it sounds like your Zigbee mesh might be having issues passing state back to the controller. deCONZ is much better when it comes to abstracting things like this versus the native ZHA stack.

Is this with all your lights or just a few?

Seems like most if not all. Definitely more frequently on the zigbee groups than on the individual entities.

Sorry about the long delay; If it’s happening more with your groups versus individual lights, I’d recommend beefing up your mesh by adding some repeaters. Usually when you get strange things like this, it’s due to either a really low signal and/or bad signal quality. Adding some additional repeaters should help with that.

I’ve noticed this as well on 0.117… also using ZHA on Conbee II. I migrated all of my Philips Hue devices from Hue to ZHA. Can’t say how it was prior to 0.117, as I’ve only recently moved it all over…

In my experience, I turn off (or on) a group of lights and in real life the lights are turned on or off correctly, but in HA the state for the individual lights sometimes hang in the old state.

I’ve tried with both a normal group of lights as well as an actual ZigBee group, results seem to be the same.

As an example, I made some screenshots, these lights are less than 1m away from the controller:

The below is the initial state:
Initial

I then turn on the top entity, which in this case is a Zigbee group, notice how not all of the lights turned on:
turn_on

I then proceed to turn off the group. However, the group state jumps back to on, the state of one light does not change, while the rest all turn off.
turn_off

I then turn off the group again, and finally it goes back to the initial state. Which lights do / don’t reflect is totally random. It’s not specific devices.

Yes, that’s the type of thing I’m seeing. It’s a bit annoying. It also trips up some of my automation I have set to trigger on light state changing - since the state of the group initially flips to off, then bounces back to on, it triggers automation for those state changes.

If you leave it alone, it’ll eventually get the state correct since it occasionally polls the lights for their state and updates accordingly, but it should definitely do a better job of reporting the correct state as you’re turning lights on/off.

I’ve logged an issue for this.