# Button to reset the Zigbee2Mqtt integration

**URL:** <https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097>\
**Category:** Demandes livrées\
**Tags:** zigbee2mqtt\
**Created:** [March 5, 2026, 12:39pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097 "2026-03-05T12:39:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [March 5, 2026, 12:39pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/1 "2026-03-05T12:39:35Z")

</div>

The Zigbee2mqtt integration has an “Enable/Disable” button that stops the containers, but does not clean up either database variables or files on disk. There is no way to start from scratch without manual intervention. The idea is to add a “Reset” button on the setup page, with confirmation (like on matterbridge/node-red), that performs a full reset: disconnection, deletion of variables, deletion of files and containers.

Reset procedure:

1. Call `this.disconnect()` (stop containers + MQTT disconnection)
2. Delete all config variables in the database via `this.gladys.variable.destroy(key, this.serviceId)` for each CONFIGURATION key in `constants.js`:

- `ZIGBEE2MQTT_DRIVER_PATH, Z2M_BACKUP, ZIGBEE_DONGLE_NAME, Z2M_MQTT_MODE, Z2M_TCP_POR, Z2M_MQTT_URL`
- `Z2M_MQTT_USERNAME_KEY, Z2M_MQTT_PASSWORD_KEY`
- `GLADYS_MQTT_USERNAME_KEY, GLADYS_MQTT_PASSWORD_KEY`
- `DOCKER_MQTT_VERSION, DOCKER_Z2M_VERSION`

1. Delete the `zigbee2mqtt/` folder on disk
2. Reset state (`discoveredDevices, usbConfigured`, status flags, etc.)
3. Emit a status event via `this.emitStatusEvent()`

**⚠ Only available in “Install from Gladys” mode**

Design proposal + messages

 ![Screenshot 2026-03-05 at 13.36.35](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/4/442648acb2d7a00721e0d9bdba9b3c2851b11191.png)

 ![Screenshot 2026-03-05 at 13.36.41](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/4/3460cb8fcbd1494f2deb03039faffd98cc171664.png)

With confirmation

 ![Screenshot 2026-03-05 at 13.36.53](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/8/7/87592a44b6b638e1783be205ba68bef86e0a684a.png)

For Gladys devices linked to this integration, I think they should be kept (otherwise, we might break scenes?).

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [March 5, 2026, 4:16pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/2 "2026-03-05T16:16:49Z")

</div>

For what it’s worth, it looks perfect to me. It’s very clear!

Regarding Gladys + backup, if we restore a version with an old dongle, is there any risk? Or conversely, is it an additional safety net because we could restore in case of a mistake?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 5, 2026, 5:29pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/3 "2026-03-05T17:29:41Z")

</div>

> [@GBoulvin](#):
>
> Regarding the Gladys Plus backup, if we restore a version with an old dongle, is there any risk?

That’s something to test, I don’t know how it behaves. In the cases we’ve seen on the forum, it was a different situation: dongle change with files already on the disk.

In the case of a Gladys Plus restore, we don’t restore the Zigbee2mqtt files

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [March 5, 2026, 7:48pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/4 "2026-03-05T19:48:13Z")

</div>

> [@pierre-gilles](#):
>
> we do not restore the Zigbee2mqtt files,

For me, we back up the entire contents of the `zigbee2mqtt` folder (so `configuration.yaml`, `database.db` and `coordinator_backup.json`).

But the restore checks whether a new configuration is present. If you restore a backup made with an old dongle (while a new dongle is plugged in and z2m is not initialized), you will also need to use that button.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 6, 2026, 9:14am UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/5 "2026-03-06T09:14:39Z")

</div>

Ok, I implemented it this morning!

I took the opportunity to strengthen the integration’s robustness, because there were instabilities that became even more apparent with this new feature.

Notably the stopped-container bug: until now, in Gladys, if the Zigbee2mqtt container was already stopped, a 304 error was issued and we never proceeded to remove the container. It’s fixed for all integrations ✅

I tested many cases locally on a mini-PC, and it works really well!

Screenshots:

 ![Screenshot 2026-03-06 at 10.11.37](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/a/3/a32975cebfb800883f9c6bd20a6c76539134ef21.png)  
 ![Screenshot 2026-03-06 at 10.11.43](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/9/d9c62233b42deaaa2efd3c5e1a875560e69e9bbf.png)

The PR:

> <https://github.com/GladysAssistant/Gladys/pull/2482>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affect the code, did you write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new feature/service, did you run the integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (\[forum\](https://community.gladysassistant.com/)) for testing before merging.
> \- \[x\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> 
> \### Description of change
> 
> Implement https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Factory-reset for Zigbee2MQTT with a two-step confirmation flow (visible in local mode)
> \* New user-facing reset UI strings in English, French and German
> \* Reset action available from the integration setup (admin only)
> 
> \* \*\*Bug Fixes\*\*
> \* Corrected i18n/JSON formatting for Zigbee2MQTT messages and links
> \* More robust cleanup handling so reset/disconnect proceeds even if containers are already stopped
> 
> \* \*\*Tests\*\*
> \* Added API and unit tests covering the reset endpoint and workflow

The Docker image:

```auto
gladysassistant/gladys:zigbee2mqtt-reset-button

```

(Already built on x64, [being built](https://github.com/GladysAssistant/Gladys/actions/runs/22756697897/job/66003313427) for arm64)

I’ll do a release this afternoon, if you want to test before then it’s possible 😉

---

<div class="post-metadata">

**Author:** ![cicoub13](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cicoub13/32/4482_2.png) [@cicoub13](https://community.gladysassistant.com/u/cicoub13)\
**Post date:** [March 6, 2026, 11:14am UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/6 "2026-03-06T11:14:13Z")

</div>

Tested on an instance with a dongle but no paired devices. It works well, the states are correct afterwards and the folders/variables/containers are properly deleted ☑

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 6, 2026, 11:59am UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/7 "2026-03-06T11:59:19Z")

</div>

Thanks for the quick test @cicoub13! I’m making a new version of Gladys this afternoon

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 6, 2026, 2:30pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/8 "2026-03-06T14:30:26Z")

</div>

The new button is available in Gladys Assistant v4.70:

> [@Gladys Assistant 4.70 : Réinitialiser l'intégration Zigbee2mqtt](https://community.gladysassistant.com/t/gladys-assistant-4-70-reinitialiser-lintegration-zigbee2mqtt/10103):
>
> Salut à tous slight_smile Je viens de sortir une nouvelle version de Gladys, avec des améliorations d’UX et de stabilité sur l’intégration Zigbee2mqtt et MQTT ? wrench Ce qui change dans cette version Bouton de réinitialisation Zigbee2mqtt Un nouveau bouton «&nbsp;Réinitialiser&nbsp;» fait son apparition dans l’intégration Zigbee2mqtt, pour permettre aux utilisateurs qui ont une intégration corrompue, ou qui souhaitent changer de dongle, de réinitialiser totalement l’intégration en un clic. C’est …

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 6, 2026, 2:30pm UTC](https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097/9 "2026-03-06T14:30:29Z")

</div>


