Button Mapping to Scenes [Home Assistant » Zigbee2MQTT]

Correct, because you stated above your automation wasn’t triggering. Plus, the automation is only triggered on a physical button press so you will need to update it with more triggers if you want it to toggle the bulb when the switch is controlled remotely as well.

I don’t believe you answered the above question though. When you turn the switch off by pressing down on the switch, your video shows the bulb turns off. Can you then toggle the bulb back on with the entity in HA without physically touching the switch?

Yes, sorry @MRobi! Once I turn the bulb off my pressing down on the switch, I can turn the bulb back on via the Hue light entity in HA, but not by turning the switch entity on in HA. The switch entity becomes unresponsive after the bulb has been turned off. Does that make sense?

That actually confirms smart bulb mode is working properly. Smart bulb mode keeps power to the fixture when the switch is off. This is why you can still toggle the bulb in HA after turning the switch off. If it weren’t working, the bulb would not respond because it would have no power.

This means the issue is likely somewhere in the automation, and I’m just not seeing it. You mentioned in the traces of the automation you’re not seeing any of the turn on events. This is what’s striking me as odd. If down_single works, there’s no reason up_single wouldn’t.

Can you humour me and change the turn on action in the automation from up_single to up_double and try a double tap on the swtich to turn the bulb on. You should at least see the automation being triggered in traces which will give a better idea of why the bulb isn’t turning back on.

Alright, so I’ve changed it to up_double. When the smart bulb is already on and I press up_double on the switch, I am able to trace the automation:

However, when the smart bulb (light.hue_color_lamp_1) is off and I do up_double I don’t see any events in the trace. Basically, nothing I do on the physical switch (while the smart bulb is off) is registered by HA. :man_shrugging:

You’ve got me stumped. The bulb should have no bearing on the switch. They’re not even speaking the same language. And your automation doesn’t have a condition set that requires the bulb to be on for it to fire. And even if it did, you’d see the trigger event. You should be able to put that bulb in literally any socket in the house and control it through that switch via that automation.

The ONLY other thing I can think of is the mode of the automation is set to single. You can try changing it to queued with a queue limit of 4 or 5. This would only matter if you were to turn off the switch then almost instantly turn it back on. If the on event triggered before the off automation completed it would not run. You’d get a warning in your logs (Settings → System → Logs) that would say “Inovelli Kitchen ON/OFF (smart bulb): Already Running”.

I’ve asked a few other HA guys to take a look at this thread to see if they’ve got any ideas.

@stu1811 and @nathanfiscus have a few ideas. Tagging them for credit :slight_smile:

It’s possible with a 300ms delay you may not be tapping it fast enough. You should be able to see the events in z2m in the logs tab. You may have to bump up the log level temporarily for that. This should confirm that the switch is sending the action to HA.

It may be possible too that you have the line and load swapped on the switch and toggling it is sending the switch into a reboot.

@MRobi thank you so much again for helping me and inquiring with @stu1811 and @nathanfiscus. Per your suggestion, I moved away from the smart bulb setup and paired the switch with a Zigbee hue bulb instead. But I wish that was the end of my troubles…

If you could see where I’m going wrong here — I created a Zigbee group called kitchen_light and added the one bulb to it:

Then I binded the switch to that group:

After that, the oddest thing happens, the switch manages to turn the bulb off, but not on once off (sounds familiar? :sweat_smile:)… Here is a video of the experience: Inovelli to Zigbee Bulb - YouTube

Is smart bulb mode enabled?

Yup, it’s on. Starting to think I might have screwed up the wiring somehow…

Pull all the wires out in post photos

You have to add the switch to the group.

And then bind your switch to the group.

And at a minimum disable the automation you had created earlier.

And if you want to completely rule-out SBM as a cause of any issue, you can put that bulb in another socket in a different room and the switch should still directly control it. If it works that way but not when it’s back in the kitchen socket, that’s when I’d start looking at SBM or wiring.

Alright, taking it from the top — added the switch to the same group, though I couldn’t get the endpoints to match (not sure if that matters).

Confirming that the prior automations (dumb bulb & smart bulb) had been disabled.

Binded the group to the switch, though unlike in your screenshot @MRobi my binding does not have OnOff enabled. I was going off this guide.

Having done all that, the issue persists (able to turn off, but not back on). Next, I moved the bulb to a different part of the house and the switch no longer is able to control the bulb.

While there I tried to enable localProtection because heck why not… and get the following error:
image

Sounds like I’ll be taking some wiring photos.

OK, 2 things here. Enabling local protection prevents you from being able to control the switch from the switch itself. So if it is enabled and then you moved the bulb, no matter what you press on the switch you will get no response. If it is not enabled, remember the circuit the bulb is moved to needs to be powered ON. I would be taking a little lamp, turning it on, then testing the binding of the switch.

Now the error here is a timeout error. This means the hub was not able to communicate to the switch. This error actually brings up questions but may also provide answers…

Is the switch resetting itself? (you would typically see LED flashing). If yes, this could be inverted wiring as mentioned above. It could also be loose wiring. It could also be a faulty switch.

If it is not resetting, then you need to start looking at network issues. Is there something interfering with your zigbee network (#1 culprit is usually WiFi and overlapping channels). Does the switch have a good connection to the hub? Is the Zigbee network robust enough where commands will get properly routed from the hub to the switch? If the issue is with the Zigbee network, this actually answers why you were not seeing all of the actions in HA and why the previous automation was not triggering properly.

Some take-away questions here…

  • Have you tested the wiring to ensure it’s A) Securely connected and B) you have line/load in the proper spots?
  • Do you have other zigbee devices on your network?
  • What channel does your WiFi network run on?
  • What channel does your Zigbee network run on? (In z2m it’s Settings → Advanced → Zigbee Channel)?
  • How does your network map look as far as connectivity goes? Are there devices that have dropped off? (In z2m it’s the Map tab on top)

Alright gang, here is the wiring:



@MRobi to your specific callouts:

Confirming this was the case. I attempted to enable local protection after moving the bulb, but was unable to do so since it would timeout. Also confirming there was power running to the bulb.

I’ve not seen random LED flashing, only when I manually reset the bulb pulling the stick in the bottom.

I would be surprised if so — I’ve got a very small Zigbee network and the hub is less than 10 feet from the switch. It was odd that I could see the off triggers reliably, but only not the on trigger. I was also able to reliably get the two/three taps to trigger other lights in the house, just not the primary bulb connected to the switch :sweat_smile:

About 13 devices total.

149 for Wifi
image

Looks like 11

This is what it looks like:

Any winners?

(after writing all this, I see the switch (and bulb) are completely unresponsive… might have broken something while unscrewing/photo-shooting, ah!)

First, you need to get a ground wire to that switch! Grounding these through the mounting screw isn’t adequate. This may actually be your issue.

As for the channels, check your 2.4ghz channel. That’s the one that is in the Zigbee frequency range.

Now looking at your map, it looks like the switch is showing an LQI of 0. It still shows as connected, but I wouldn’t be surprised if it was dropping off. You may need to look into a repeater. Or depending on your coordinator you may be able to turn up the gain on it. But LQI of 0 = bad

EDIT: It may be showing a 0 LQI because the switch is powered off. If you didn’t screw it back in, the lack of a grounding wire would make the switch not turn on at all. And since the switches are powder coated black, you don’t get a great ground through the mounting screw to start with which is why I say this may be your problem.

1 Like