#Z2M Crashing workaround

1 messages · Page 1 of 1 (latest)

regal basin
#

So I have an issue with Zigbee2MQTT that I'm pretty sure isn't a bug, but it might be an oversight.

So, I have a SLZB-MRW10 connected to my network that deals with my Zigbee and Z-Wave stuff. It's all configured correctly and doing the things it needs to do.

However, my TPLink AX6000 reboots nightly at 2am, which causes Z2M to randomly just crash because it can't communicate with the MRW10 while the router is rebooting.

This doesn't happen every night though. it can go for a few weeks without any issues, but then randomly it'll just fail with flames and fireworks and then nothing on my zigbee network can communicate with my HA instance. Starting the addon fixes this issue.

I also have the watchdog enabled. However, because it fully crashes the addon, it can't recover and restart itself.

So I need to find a way to detect when Z2M crashes, and then reboot it. I did a bit of digging and I couldn't find anything that I would think would be useful to do this. I'm going to tinker with MQTT and see if I can't send pings and if I can and then don't get a response, try to start the addon somehow, but people here are smarter than I and hopefully have figured out how to fix this issue before I duct tape together something awful to "fix" it myself

quaint geyser
#

Definitely not the answer to your question, but why does your router reboot nightly?

regal basin
#

I'm honestly not super thrilled with how this router aged and I'm actively looking for a replacement but I haven't found anything yet

quaint geyser
#

I was gonna say, I'd suggest replacing it honestly lol. That being said, I don't run HA OS but I'm pretty sure there's a hassio.addon_restart service you could use to automate restarting the add-on

regal basin
#

I did find that, now I just need to find a way to see if an addon is currently running

regal basin
#

looks like if I listen to the zigbee2mqtt/bridge/state topic, I can tell when the bridge itself stops, which I hope happens when the add-on crashes

regal basin
#

Figured it out:

#

So, Zigbee2MQTT exposes that state as a binary sensor already. I just set up an automation where if that state goes from Connected to Disconnected for more than 5 minutes, it'll start the add-on

warm bobcat
#

update HA and Z2M

#

released a few hours ago, people reporting fixes.