Zigbee2MQTT The app is not running. Do you want to start it now?

Whenever i disconnect my zigbee hub (SLZB-06M), when i reconnect, Z2M does not start up and i see the message Zigbee2MQTT The app is not running. Do you want to start it now?

I does start if I click on ok but I don’t understand why the watchdog does not automagically restart it. I have the watchdog set as 1,2,3,4,5,7,10,15,20,30,45,60.

Is there some way to get this restarted without intervention?

I’m not certain of an answer for your question, but why and how often is that happening?

It happens often enough to be a nuisance. If, for any reason, I lose network connection, upon return z2m does not reconnect.

Do you have the watchdog enabled in the App startup screen?

Read the post…

OK. I don’t know what that was referring to other than a watchdog thing you used that I wasn’t aware of I guess.
Assuming you are running in HAOS, I was referring to the watchdog button in the info section of the Z2M App that is supposed to restart the App if it stops. This doesn’t have options that I am aware of.
That’s what is in the screenshot.

I think the watchdog for Z2M actually does nothing unless you have the intervals set in the options like sdegonge has.

@sdegonge I don’t have a reliable Watchdog for Z2M either, but I’ve created an automation that looks for unavailable zigbee devices and then triggers a restart of the Z2M addon. You could try that.

  - data:
      addon: 4xjsj2_zigbee2mqtt
    action: hassio.addon_restart

That said, you should look into why it goes offline, I have two SLZB-06p7 and one SLZB-06m and neither goes offline often. I run Thread on the 06M though.

Are you plugging it through the router provided by your ISP or your own router with DHCP?

yes, it is set.

I’ll use your logic to recover - thanks.
The loss of network is usually due to power blips that briefly drop the network.

@sdegonge here, catch. I think you can use the same automation I do instead of the watchdog, since I found it to be unreliable too.
You’ll need to do 2 simple things:

  • Create a ping sensor for your router so that you know when it’s back online
  • Enable the (disabled by default) binary_sensor.zigbee2mqtt_running by going to Settings > Devices & Services > Devices Tab > Zigbee2Mqtt, then clicking on Disabled Entities under the Sensors section:
alias: Zigbee2MQTT Watchdog
description: Reloads Z2MQTT when it isn't running after internet outage
triggers:
  - entity_id:
      - binary_sensor.ping_sensor
    to: "on"
    trigger: state
conditions:
  - condition: state
    entity_id: binary_sensor.zigbee2mqtt_running
    state: "off"
actions:
  - repeat:
      until:
        - condition: state
          entity_id: binary_sensor.zigbee2mqtt_running
          state: "on"
          for:
            hours: 0
            minutes: 5
            seconds: 0
      sequence:
        - if:
            - condition: state
              entity_id: binary_sensor.zigbee2mqtt_running
              state: "off"
          then:
            - data:
                addon: 45df7312_zigbee2mqtt
              action: hassio.addon_start
            - delay:
                hours: 0
                minutes: 1
                seconds: 0
                milliseconds: 0
            - data: {}
              target:
                entity_id: binary_sensor.zigbee2mqtt_running
              action: homeassistant.update_entity
          else:
            - delay:
                hours: 0
                minutes: 0
                seconds: 30
                milliseconds: 0
            - data: {}
              target:
                entity_id: binary_sensor.zigbee2mqtt_running
              action: homeassistant.update_entity
mode: single