Make Zigbee2MQTT Keep Restarting When Cannot Reach Coordinator

Hello all,

I’ve got a TubesZB network-connected hub that I’m using as my Zigbee coordinator.

The issue I’m running into is that if Zigbee2MQTT loses its connection to the coordinator, it will stop running. Even with Watchdog enabled, it’ll just try to restart once (maybe 2 or 3 times, I don’t know), and then give up. Once the coordinator is back online, I have to manually start the service. Not at all a reliable way to have designed it.

Any idea how to make the Watchdog keep restarting the add-on, or have the add-on itself keep running and periodically checking in with the coordinator when it is offline?

Thank you

Watchdog will give up if it hits 5 restart failures in a half an hour period. At that point it assumes something is wrong which requires manual user intervention and stops trying to restart it.

What I’m not understanding is why is your coordinator not always available? Shouldn’t it be? How is your system working if you can only talk to your zigbee devices sometimes?

If you really want the coordinator to only be online at times then is there a way to tell when it is online? Some kind of signal that could be sent to HA? Then you could start the addon when HA receives that signal via an automation and turn off watchdog entirely.

I seem to recall it giving up in a lot less than a half an hour - I’d need to re-test, though. This is in my homelab, so when I’m messing with stuff, things can go offline periodically. I don’t want to have to manually re-enable crap when it would be ideal for it to just keep trying to communicate until things are back online.

The main issue is when HomeAssistant starts, it seemed that it would give up in a very short period of time if the coordinator was not already online.

For anyone else that wants this to keep trying until the coordinator is back online, I’ve come up with an automation to do so:

2 Likes