# Zigbee2mqtt - Debug

**URL:** <https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080>\
**Category:** Développement\
**Tags:** zigbee2mqtt\
**Created:** [February 1, 2021, 12:57pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080 "2021-02-01T12:57:33Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [February 4, 2021, 3:04pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/21 "2021-02-04T15:04:26Z")

</div>

Sure, it won’t hurt 🙂

However, I think there’s a connection that remains open, but I don’t know when 😕

---

<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:** [February 4, 2021, 3:30pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/22 "2021-02-04T15:30:23Z")

</div>

OK.  
I will check what is done on the MQTT side and see if there is not a missing connection.close() when we stop the service

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [February 4, 2021, 3:40pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/23 "2021-02-04T15:40:34Z")

</div>

> [@VonOx](#):
>
> However, I think there is a connection that remains open but I don’t know when 😕

Same here, I don’t know how. Could a reboot of the RPi be the solution?

For pairing:

1. I enabled association
2. I clicked the button on my sensor for 5 seconds
3. I then clicked Scan

Nothing appears.  
After digging a bit, it’s because watchtower redeployed the new image that changes the container names with z2m 😉

I deleted everything and now it works perfectly 🎉

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 11, 2021, 4:43pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/24 "2021-09-11T16:43:35Z")

</div>

Hello everyone,

I notice that there are often requests to integrate new zigbee2mqtt devices.

After some research, I found that the documentation referencing all compatible zigbee2mqqt devices is generated from the npm package `zigbee-herdsman-converters`.

Using the logic to generate the zigbee2mqqt documentation and our way of integrating devices into Gladys, I created a small tool that:

- refreshes the entire list of devices
- generates the files to be placed in Gladys

My tool: [GitHub - atrovato/Gladys-Zigbee2mqtt-tools · GitHub](https://github.com/atrovato/Gladys-Zigbee2mqtt-tools)  
The generated files: [Gladys-Zigbee2mqtt-tools/generated at master · atrovato/Gladys-Zigbee2mqtt-tools · GitHub](https://github.com/atrovato/Gladys-Zigbee2mqtt-tools/tree/master/generated)  
The changes in Gladys: [Zigbee2mqtt devices by atrovato · Pull Request #1294 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1294)

1. Move a method: [Zigbee2mqtt devices by atrovato · Pull Request #1294 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1294/commits/e4b79d3964c47b37ef4df91090f1a5b20a00ffc5)
2. Integration of generated devices: [Zigbee2mqtt devices by atrovato · Pull Request #1294 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1294/commits/71227fb112269ce43de920c7e8bf936add224a14)

The tool is certainly not complete and may generate some inconsistencies,  
but feel free to help me complete it and improve it.

I still have a question pending, is the version of zigbee2mqtt specified?  
Because things are evolving very quickly for them: [Releases · Koenkk/zigbee-herdsman-converters · GitHub](https://github.com/Koenkk/zigbee-herdsman-converters/releases)

@cicoub13 @VonOx @Reno  
I especially have a big doubt about the `button` / `switch_sensor` / `temperature` features.

Hope you like it, and that it helps us generate new compatibilities.

Best regards

EDIT: file generation forces sorting by brand / model / features, which generates many changes.

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 11, 2021, 5:19pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/25 "2021-09-11T17:19:17Z")

</div>

The best of the best would be to exploit what the device exposes.

> **[Exposes | Zigbee2MQTT](https://www.zigbee2mqtt.io/information/exposes.html)**
>
> Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridges

We can make the service a bit smarter and there’s no need to manage the features.  
At my level, I have no idea of the complexity of developing this logic.

In the meantime, your generator is going to save a lot of time 👍

We use the latest version of zigbee2mqtt via their Docker image

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 11, 2021, 5:21pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/26 "2021-09-11T17:21:53Z")

</div>

In the end, the tool also exploits the «&nbsp;exposes&nbsp;», but from the server.  
So it needs to be adapted to make it dynamic for MQTT discovery 👍

---

<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:** [September 12, 2021, 4:24am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/27 "2021-09-12T04:24:41Z")

</div>

In the end, if we are able to generate config files, why generate them? 😄

We can do like Philips Hue, just map on the fly when a new device is returned

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 12, 2021, 7:45am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/28 "2021-09-12T07:45:01Z")

</div>

I started the topic.  
I will try to be as complete as possible.

---

<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:** [September 12, 2021, 7:48am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/29 "2021-09-12T07:48:24Z")

</div>

Great! Keep us updated 🙂

It’s clear that if we no longer have to manually add Zigbee devices, that would be amazing 😄

Thanks for taking the time!

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 12, 2021, 2:27pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/30 "2021-09-12T14:27:19Z")

</div>

OK, I’m at the testing phase, but I don’t have any material on this protocol.  
I’m looking for MQTT payloads from the topic `zigbee2mqtt/bridge/devices` to check that the devices/features are correctly created.

Thanks in advance to everyone for your contributions.

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 12, 2021, 5:49pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/31 "2021-09-12T17:49:45Z")

</div>

A small sample

[https://gist.github.com/VonOx/f47cdcd0550ccd125084a93e6aaca997](https://gist.github.com/VonOx/f47cdcd0550ccd125084a93e6aaca997)

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 12, 2021, 5:54pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/32 "2021-09-12T17:54:01Z")

</div>

Great, I’m going to generate Gladys devices, and we’ll see, once it’s done, if you find all your features again!!!

Thank you!!

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 12, 2021, 6:00pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/33 "2021-09-12T18:00:32Z")

</div>

The correct topic is

zigbee2mqtt/bridge/devices

---

<div class="post-metadata">

**Author:** ![Romuald\_Pochet](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/romuald_pochet/32/6441_2.png) [@Romuald\_Pochet](https://community.gladysassistant.com/u/Romuald_Pochet)\
**Post date:** [September 12, 2021, 7:42pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/34 "2021-09-12T19:42:07Z")

</div>

Good evening,

My small contribution

> <https://gist.github.com/rpochet/a02e1a4c7373c09bd6d46d790442fbb3>

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 13, 2021, 9:07pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/35 "2021-09-13T21:07:51Z")

</div>

@VonOx @Romuald_Pochet

Thank you both.

Here is what I generated from your devices.

> **[Gladys-Zigbee2mqtt-tools/results at generated ·...](https://github.com/atrovato/Gladys-Zigbee2mqtt-tools/tree/generated/results)**
>
> Contribute to atrovato/Gladys-Zigbee2mqtt-tools development by creating an account on GitHub.

Each generated device is in its own file (I think it’s more readable).  
I’m quite satisfied with the result.

If you have other cases with «&nbsp;complex&nbsp;» devices (lights / switches…), I’m interested.

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 13, 2021, 9:27pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/36 "2021-09-13T21:27:14Z")

</div>

I haven’t looked at everything, but I mostly have Aqara sensors, so it’s not very diversified in terms of equipment. (Sensors OK)

I have an unpaired Philips Hue, I’ll add it to the network tomorrow to see how it works with a light.  
And I also have a smoke sensor that I haven’t added yet.

I’ll send you a complete JSON file.

Good job Alex!

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [September 14, 2021, 9:03am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/37 "2021-09-14T09:03:24Z")

</div>

@AlexTrovato I’ve paired the smoke sensor and added a lamp

New revision of the gist  
[https://gist.github.com/VonOx/f47cdcd0550ccd125084a93e6aaca997](https://gist.github.com/VonOx/f47cdcd0550ccd125084a93e6aaca997)

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/ce9c07c46ad97b478e96a41a389b9ad7be58b503.png)

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/9/9b0b2236290eeb13c716194dde5bcf58080b8afd.png)

---

<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:** [September 14, 2021, 10:23am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/38 "2021-09-14T10:23:45Z")

</div>

Here are a few more devices

> <https://gist.github.com/cicoub13/91c5e092fc87fa0a5c8f3c7b0966ea0c>

Great idea to generate the features from the library code, I hadn’t thought of that. I had stopped at the fact that these JSON files did not contain the exposed features.

But as @pierre-gilles said, might as well go further and do it on the fly.

I don’t have much time to look at this week, but if you propose a PR, I’ll take some time in the coming weeks to look at it.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 14, 2021, 11:14am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/39 "2021-09-14T11:14:39Z")

</div>

@cicoub13 the generated ones from your payload come from changes in Gladys, generation on the fly.  
Once the devices are correctly generated, I will propose a test image to validate the integration with MQTT.  
My first task, generate the devices / features according to the data received dynamically.

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [September 14, 2021, 8:22pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/40 "2021-09-14T20:22:48Z")

</div>

@cicoub13  
The payload you provided does not come from the correct MQTT topic:

> [@VonOx](#):
>
> zigbee2mqtt/bridge/devices

[Previous page](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080.md?page=1)

[Next page](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080.md?page=3)
