How to restart zigbee2MQTT after a Home Assistant Restart

Thanks for the response - much appreciated.

New to Home Assistant …

Is this yaml? and do I just create an automation, edit in yaml and paste it in there?

Do you have it set to start on boot?

It’s still interesting though since the add-on shouldn’t be affected by a restart of Home Assistant. It would be affected by a reboot of the host though.

it is an automation, so this should work:

1 Like

yeh

It is a consistent issue, took me while to understand why my graphs on Dashboards were failing, I am using Node Red from my standalone zigbee2MQTT days so the Home Assistant automations, I have very few of them, were not having an impact.

I don’t always remember to restart zigbee2MQTT so a bit of a pain

Is this useful

from the zigbee2MQTT log

[16:39:08] INFO: Preparing to start…
[16:39:09] INFO: Socat not enabled
[16:39:09] INFO: Starting Zigbee2MQTT…

Sorry to be a pain - where do I find the add-on name for my installation?

Could be a misconfiguration

MQTT config :

and Zigbee2MQTT status

So Zigbee2MQTT knows HA has restarted.

1 Like

Settings → Add-ons → Zigbee2MQTT. Look in the URL

I found it in the url - I use the Mac App - would never in a million years found that! Thanks.

It doesn’t like something - sorry for being a noob.

Screenshot 2024-02-26 at 17.44.03

zigbee2MQTT config looks good without any changes - default install

Where MQTT config options above? I cannot find that config page

You could simple paste it in automations.yaml. Sorry, I don’t use the automation editor.

Ok… that will be a first for me :slight_smile:

Setting → Devices & Services → MQTT → Configure → Reconfigure MQTT , second page.

Thanks you ar taking me to dark corners of config I had not previously seen :slight_smile:
Looks Ok

I took everything default install

But it can…

And in case you want to import yanl:

description: “”
mode: single
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service:hassio.addon_restart
    metadata:
    data: 
      addon: 45df7312_zigbee2mqtt

2 Likes

You are barking up the wrong tree as z2m does not need to be restarted on HA restart.

1 Like

Ok

How do you get Home Assistant to not lose all the zigbee2MQTT devices after Home Assistant restarts?

At the moment every time Home Assistant restarts, short of a complete shutdown, restart, Home Assistant loses all zigbee2MQTT devices.

Everything is setup as default, so if any ideas on how to get Home Assistant to behave as you stated I would be greatly appreciated.

Perfect!,

Done and dusted, will keep on trying to work out how get Home Assistant to not lose zigbee2MQTT devices after a restart, but this will keep it going in the meantime.

Many thanks all!

Mike

8552b81e931d55cd2a0bed5db2c7f094a114826d_2_293x500

Here you have homeassistant/status, in Zigbee2MQTT you have hass/status. These have to be the same.

If they are the same, Zigbee2MQTT resends the MQTT discovery messages on HA restart, and it does not need to be restarted.

2 Likes

I suspect you have hit the nail on the head.

Although mine has different (same as @Busta999x hass/status in z2m and homeassistant/status in the mqtt config. And yet mine works.