Automating Zigbee Light Status with "Dumb" Switches Using Zigbee2MQTT

Hey,

I have a bunch of Zigbee light bulbs, but we have “dumb light switches” at home. A lot of times the power to the bulb is cut by a “dumb switch”, but Home Assistant still thinks that the light is on.

Is there any way to make automation or some script that, if connection to a Zigbee lightbulb is lost, assumes it’s off?

For example, all of these lights are actually off, but Home Assistant disagrees. Imgur: The magic of the Internet

I’m using MQTT Broker and Zigbee2MQTT to control my lights.

First things first - I hope you realise that cutting power to a zigbee light is a bad idea. If it’s a router, you’ll cause issues with your mesh.
To avoid this issue, you could install a zigbee module behind the dumb switch so that it sends an off command to the lights when the dumb switch is turned off.

Now, onto your current problem - there’s a setting in Z2M to (almost) get the behaviour you want. It will mark your lights as unavailable though, not off, because that’s the real state of the device.

Go to the Z2M frontend > Settings > Availability > select Availability (Advanced) in the dropdown. Now you’ll see Timeout options for Active (your bulbs) and Passive (battery powered devices). Change the Active setting for Timeout to 10 (minutes) and hit Submit at the bottom. I don’t suggest setting it lower than that because you might spam your network.

1 Like

My apologies for the very late reply; apparently I missed the email notification, and then life got in the way and I forgot about this post.

Yes, I know that turning off routing Zigbee devices is a bad idea. I have a couple strategically placed Zigbee repeaters/routers, which basically guarantee a stable enough network. I can control devices that are furthest away from my Zigbee dongle even if the rest of the network is technically “down”.

I’ll try this!