I have a Blue switch as single pole, controlling an overhead light in the dining room. On/off mode (not dimming). The switch works fine locally. I have it connected to Home Assistant via Z2M, and it works fine remotely as well.
I added a small battery powered Zigbee button to my network, so that when I press the button, it turns the dining room light on, and if I press the button again it turns it off. So far so good. In my HA automation, I use “button single press” as a trigger, and the action is sent to the Blue 2-1 as “Toggle Dining Room Light.”
The problem is that it only works 30% of the time. I can confirm that every button press is received by Home Assistant. It also sends an “action successful” message. The problem is that the light doesn’t always respond to the toggle command. Sometimes nothing happens at all. Sometimes HA reports the light is on, but the actual light doesn’t turn on and the Blue’s LEDs don’t light up as on either.
If I change my automation action to an if-then – “if dining room lights are on, turn them off;” and “if they’re off, turn them on,” then it works perfectly. So messages are being sent by the button correctly, Home Assistant is receiving them correctly, and Home Assistant is communicating with the Blue 2-1 correctly.
Am I misunderstanding how the “Toggle” function works, or is there something wrong with either HA or the Blue switch?
The automation logs report the action is successful (it thinks the light has toggled). The automation is set to single. But I’ve changed the device in the same automation to my other Blue switches, and this seems to be the only one that doesn’t respond reliably to the toggle command.
Also, on testing, this isn’t limited to automation triggers actually, if I create an entity or light card with a toggle action, it will also show the light as activated (but the light doesn’t turn on).
The reason I think this is a switch error and not a HA or bulb issue is when HA sends the toggle command (and reports the light has turned on), the switch’s LEDs never change to the “on” mode, they stay in the “off” color scheme, and at this point, the switch will be stuck at off, and no longer respond to toggle commands until I turn the light on locally/manually).
It will also fail with Dev Tools → Services in the same way–it will work 3-5 times and then stop working when the light is off, it won’t turn on until I hit the switch manually. The Service button will still show the green checkmark that the service has been called successfully.
Have you updated to the latest firmware? I remember there was an issue with an early version of firmware where the switch and entity status weren’t in sync because it wasn’t binding to the controller by default. The workarounds was to manually bind the 2, but this was fixed in the next firmware release
At the end of the day, there is nothing hardware related that would differentiate between a toggle command and a turn on/off command. That’s all on the software side. So if the switch responds correctly to on/off there’s something else causing toggle not to work
This switch shipped with 2.11, and 2.14 was pulled from OTA before I had it set up.
My other switches on 2.11 attached to different lights don’t exhibit this problem.
Is the workaround the delete and then re-pair the switch to Z2MQTT? I have another set of Blues coming in today so I may try swapping out with a new switch and seeing if it still happens.
Discrete on/off commands work just fine, it’s only the toggle that seems to fail.
At that point I’d factory reset it and re-join it to the network.
My personal preference has always been z2m over zha but that’s a matter of preference. There should be no difference in functionality between the 2.
The only other thing I can think of is that the commands may be dropping due to interference or poor LQI.