Force Zigbee2MQTT restart with Home Assistant automation

One problem that bothers me now for a long time was that my Zigbee Devices were unavailable when my Home Assistant restarted. I couldnt figure out why exactly that was the case but it might be a problem with the used Mosquitto MQTT Broker. But honestky i dont want to change that.

What i have seen was that restarting Zigbee2MQTT solved that problem. So i went the lazy way generating a Home Assistant automation which sends a MQTT message to the topic which tells Zigbee2MQTT to restart that bridge. Works without issues, you maybe have to adjust the delay.

alias: "Zigbee2MQTT reboot"
description: "Reboots Zigbee2MQTT when HA has started"
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - delay:
      seconds: 30
  - service: mqtt.publish
    data:
      topic: "zigbee2mqtt/bridge/request/restart"
      payload: ""
mode: single

Björns Techblog
Björns Techblog
@blog@blog.sengotta.net
362 Beiträge
83 Folgende
Fediverse-Reaktionen

Kommentare

  • @blog Zigbee2MQTT would randomly crash and not restart for me often enough that I ended up moving it and Mosquitto Broker off of Home Assistant and onto a separate host.

    Home Assistant runs everything in Docker containers, so, yes, I could have dug through the logs and found the issue, but this was a quicker and easier solution.

  • Die Kommentare sind geschlossen.