# 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:** 7

<div class="post-metadata">

**Author:** ![Tolkyen](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/t/ba8739/32.png) [@Tolkyen](https://community.gladysassistant.com/u/Tolkyen)\
**Post date:** [November 30, 2021, 12:35am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/122 "2021-11-30T00:35:42Z")

</div>

Inspired by the tests, I tried to follow the instructions in the section [Launch a Gladys test image?](https://community.gladysassistant.com/t/lancer-une-image-gladys-de-test/6509/7?u=tolkyen) using the following command:

```bash
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-test-atrovato \
-e NODE_ENV=production \
-e SERVER_PORT=8001 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant_test_atrovato:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
atrovato/gladys:zigbee2mqtt

```

I’m stuck at the test stage (access via IP\_RASPBERRY\_PI:8001). Did I miss any prerequisites?  
Should I copy the contents of /var/lib/gladysassistant/ to /var/lib/gladysassistant\_test\_atrovato?

---

<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:** [December 2, 2021, 9:37am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/123 "2021-12-02T09:37:43Z")

</div>

> [@Tolkyen](#):
>
> This is where I’m stuck for the test (access via IP\_RASPBERRY\_PI:8001), did I miss any prerequisites?

I don’t think so, if you followed my little tutorial normally there’s nothing more to do.

When you run `docker ps`, do you see the container running? Without errors (it’s not constantly restarting?)

---

<div class="post-metadata">

**Author:** ![Tolkyen](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/t/ba8739/32.png) [@Tolkyen](https://community.gladysassistant.com/u/Tolkyen)\
**Post date:** [December 2, 2021, 10:36pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/124 "2021-12-02T22:36:38Z")

</div>

Here are the containers that are running:

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

I can successfully connect to the test container. I have re-entered the MQTT credentials as those from the Gladys container.

Once Zigbee2MQTT is enabled, the connections do not seem to work

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

And as a result, it is impossible to enable «&nbsp;Allow Association&nbsp;» in Zigbee 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:** [December 3, 2021, 9:24am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/125 "2021-12-03T09:24:29Z")

</div>

Ah, are you trying to launch a Zigbee2mqtt + MQTT container in addition to your existing classic installation?

I don’t know if that’s possible. @AlexTrovato correct me if I’m wrong, but I think the name of these containers is fixed and therefore it’s one Zigbee2mqtt installation per machine?

I didn’t have the context, I thought you couldn’t launch a test container, but it seems to work!

---

<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:** [December 3, 2021, 11:08am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/126 "2021-12-03T11:08:06Z")

</div>

Yes the names are fixed, eclipse-mosquito is the MQTT integration, not the same port.

Therefore, launching the integration from a test image on the same machine is not 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:** [January 2, 2022, 1:47pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/127 "2022-01-02T13:47:26Z")

</div>

Hello everyone!

I’m looking for a USB Zigbee dongle, what do you recommend?

I’m looking for the most «&nbsp;consumer friendly&nbsp;» possible: USB, in a case, no firmware to flash, it must be plug and play. And if possible with an affordable price 🙂

So far I’ve found:

- This [CC2531](https://www.amazon.fr/firmware-OpenHAB-ioBroker-zigbee2mqtt-antenne/dp/B08HDBBY91)
- This [Sonoff Zigbee 3.0 Dongle Plus](https://www.amazon.fr/CC2652P-Coordinator-Universelle-Passerelle-Assistant/dp/B09KXTCMSC/ref=sr_1_3?keywords=sonoff+zigbee+3.0+usb+dongle+plus%5Cu0026qid=1641131026%5Cu0026s=electronics%5Cu0026sprefix=sonoff+zig%2Celectronics%2C52%5Cu0026sr=1-3)

Both seem compatible with Zigbee2mqtt, but I’m open to feedback 🙂

---

<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:** [January 2, 2022, 3:11pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/128 "2022-01-02T15:11:40Z")

</div>

I use this one mainly for two reasons:

1. It is factory flashed
2. It can be updated directly from the Rpi, no need for specific hardware

> **[CC2652R stick - slae.sh](https://slae.sh/projects/cc2652/)**
>
> iot stuff and other cool hacks

I already have 42 Zigbee devices and I have not had any stability issues so far.

For information, here is how I flash the Zigbee2mqtt firmware updates, it’s super simple and fast, and could be automated by Gladys itself.

> **Script**
>
> ```bash
> #!/bin/sh
> 
> #echo "Installing pip3 and dependencies"
> #pip3 install pyserial intelhex --upgrade
> 
> echo "Updating USB Firmware"
> cd /home/pi/flash-usb/Z-Stack-firmware
> git pull
> cd ..
> 
> echo "Unzip Z stack firmware"
> rm /home/pi/flash-usb/CC2652RB_coordinator_*.hex
> unzip Z-Stack-firmware/coordinator/Z-Stack_3.x.0/bin/CC2652RB_coordinator_*.zip
> 
> echo "Updating cc2538-bsl git repo"
> cd /home/pi/flash-usb/cc2538-bsl
> git pull
> cd ..
> 
> echo "Shutting down Gladys"
> docker stop gladys-z2m-zigbee2mqtt
> 
> version=$(ls | grep *.hex)
> 
> echo "Flashing new version: ${version}"
> /home/pi/flash-usb/cc2538-bsl/cc2538-bsl.py -p "/dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_41_DF-if00-port0" -evw "${version}"
> 
> echo "Starting again Gladys"
> 
> ```

---

<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:** [January 2, 2022, 4:45pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/129 "2022-01-02T16:45:54Z")

</div>

Thanks @lmilcent! After that, I’m looking for something more «&nbsp;mainstream&nbsp;». I want to make a video showing how to use Zigbee in Gladys, and I want to use the most mainstream brand equipment possible so that it’s easy to reproduce and the tutorial is timeless 🙂

---

<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:** [January 2, 2022, 5:15pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/130 "2022-01-02T17:15:42Z")

</div>

Ok, I see the idea. Do you have stats on the number of Zigbee users on Gladys?

---

<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:** [January 2, 2022, 5:43pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/131 "2022-01-02T17:43:03Z")

</div>

Not at all 🙂 After that, it’s the integration that rises the most for me, and we clearly lack resources to explain how to get started with Zigbee in Gladys!

---

<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:** [January 3, 2022, 8:36am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/132 "2022-01-03T08:36:59Z")

</div>

Given the positive feedback I’ve seen on the Home Assistant forum, I went with the Sonoff, sold for €8.99 on Domadoo!

At this price, you shouldn’t miss out 😃

[https://www.domadoo.fr/fr/interface-domotique/5976-sonoff-cle-usb-zigbee-30-antenne-externe-20dbm-compatible-zha-zigbee2mqtt.html?domid=17](https://www.domadoo.fr/fr/interface-domotique/5976-sonoff-cle-usb-zigbee-30-antenne-externe-20dbm-compatible-zha-zigbee2mqtt.html?domid=17)

---

<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:** [January 3, 2022, 10:15am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/133 "2022-01-03T10:15:02Z")

</div>

Check only the number of devices it can support in a Zigbee network. Or at least indicate this in the tutorials.

Because on the Zigbee2MQTT project they indicate that some adapters are limited to a maximum of 50 and become unstable. Others, on the other hand, can support 100+.

---

<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:** [January 7, 2022, 7:12am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/134 "2022-01-07T07:12:48Z")

</div>

@cicoub13 or @AlexTrovato have you seen this?

> <https://github.com/GladysAssistant/Gladys/issues/1403>
>
> I just wonder why not to use well established solution for ZigBee which is also …used by home assistant integration?
> 
> https://github.com/koenkk/zigbee-herdsman
> 
> It has good API and already has wide range of devices.

---

<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:** [January 7, 2022, 4:22pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/135 "2022-01-07T16:22:22Z")

</div>

Hello everyone! I received my Sonoff Zigbee 3.0 USB stick and was able to test the end-to-end integration!

First of all, kudos to everyone who worked on it, generally it works great, and I’m amazed by the Zigbee experience in general: it works, nothing to say 👏

Some feedback on the configuration experience:

- It wasn’t very clear to me whether I should first configure the USB port of my Zigbee key or if I should configure the Zigbee2mqtt service first. I did the USB port first, but I could have started with the other and I don’t know if that would have caused a problem, but I think Zigbee2mqtt would have started incorrectly!

- When launching the Zigbee2mqtt service, it’s not very clear that something is happening in the background. No spinner, no message telling me that the installation is in progress. I’m on fiber optics and on a Raspberry Pi 4, and all in all it took about 5-8 minutes. As I know what I’m doing, I monitored the installation progress in htop by watching the processes that were running, but for someone in the UI it’s very long, and as there are red crosses in the UI at the beginning, one might think that there was an error, whereas in fact you just have to wait 🙂 😊

I think a message should be added explaining that it can take up to 10 minutes, and that something is happening with a spinner 🙂 The red crosses can be left, but maybe by clearly explaining that it’s «&nbsp;in progress&nbsp;» and that it will connect gradually.

- Once Zigbee2mqtt is configured, I was a bit lost: how to add a device? Place it next to the USB hub? Click on it?

The Zigbee2mqtt documentation helped me, maybe a small message and a link would suffice!

- When you click on «&nbsp;enable pairing&nbsp;», it only enables pairing for 250 seconds, but after that time, Gladys still displays that pairing is enabled, whereas on the Zigbee2mqtt side it’s no longer in pairing mode.

- The Zigbee2mqtt UI is still freely accessible, not great in terms of security 😄

Apart from that, I have my devices in Gladys, and everything works.

It’s really a great integration.

Great job @cicoub13 @Reno @AlexTrovato @VonOx and @lmilcent (I hope I didn’t forget anyone)!

---

<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:** [January 8, 2022, 11:44am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/136 "2022-01-08T11:44:12Z")

</div>

Thanks for the feedback. This is a great collaborative integration that adds a large number of devices 🚀 😄

I’ve created the GitHub issues to track (and allow anyone to make changes)

> <https://github.com/GladysAssistant/Gladys/issues/1405>
>
> In case of USB device not configured:
> \- show a \*\*message\*\* in the Integration \>… Configuration like "You should first configure your USB dongle" with a link to the Parameters page
> \- \*\*disable\*\* the button "Activate Zigbee2Mqtt" in Integration \> Configuration

> <https://github.com/GladysAssistant/Gladys/issues/1406>
>
> When the User is clicking on the Activate Zigbee2Mqtt in Integration \> Configura…tion page :
> \- display a \*\*warning message\*\* explaining that this operation could last until 10 minutes (especially the first time) AND that services and connection will start step by step (to explain the red crosses)
> \- display a \*\*spinner\*\* until the operation is done

> <https://github.com/GladysAssistant/Gladys/issues/1407>
>
> Add a password to protect the zigbee2mqtt on port 8080 when the service is up.
> …- \*\*Generate a password\*\* during the first activation and save it in database in t\_variable (use variable service)
> \- \*\*Display\*\* the password hidden in the Configuration page (like into the MQTT integration)
> \- Use this password in the \`gladys-z2m-zigbee2mqtt\` container \*\*configuration\*\* file to protect the interface (see \`auth\_token\` here https://www.zigbee2mqtt.io/guide/configuration/frontend.html#frontend)

> <https://github.com/GladysAssistant/Gladys/issues/1408>
>
> When you click on \*\*Authorize association\*\* under Discover page, the Association… is activated by default for 250 seconds.
> When this period is over, the button stays active, \*\*whereas\*\* it's not active anymore in zigbee2mqtt.
> 
> Check if we receive a message in this topic https://github.com/GladysAssistant/Gladys/blob/master/server/services/zigbee2mqtt/lib/handleMqttMessage.js#L64
> 
> \<img width="1247" alt="CleanShot 2022-01-08 at 12 39 21@2x" src="https://user-images.githubusercontent.com/1773153/148642740-2184a6d3-8768-4292-9b38-df32b45497b5.png"\>

For the documentation, there is already a link to [Connect Zigbee devices with an USB Zigbee dongle and Zigbee2mqtt | Gladys Assistant](https://gladysassistant.com/docs/integrations/zigbee2mqtt) from the service page (and specifically the **Add devices** section). Isn’t that enough and should we add links to the zigbee2mqtt pages?

---

<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:** [January 9, 2022, 11:04am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/137 "2022-01-09T11:04:33Z")

</div>

Thanks @cicoub13 for creating the issues!

> [@cicoub13](#):
>
> For the documentation, there is already a link to [Zigbee2Mqtt | Gladys Assistant](https://gladysassistant.com/docs/integrations/zigbee2mqtt) from the service page (and especially the **Add devices** section). Isn’t this sufficient, and should we add links to the Zigbee2Mqtt pages?

I think two things are missing:

- In Gladys, it would be helpful to explain (even in one sentence) that to pair a device, you should refer to its documentation, and possibly add a direct link to the Zigbee2Mqtt documentation within Gladys.
- On the Gladys documentation side, in the section where we explain how to pair a device, adding a link to the Zigbee2Mqtt documentation would be a good idea!

On my side, I will try to create content related to the Zigbee2Mqtt integration (YouTube video, and maybe an article on the blog with 🙂 ).

---

<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:** [February 18, 2022, 1:25pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/138 "2022-02-18T13:25:50Z")

</div>

@AlexTrovato I saw that there are several Zigbee2mqtt PRs, what would be the ideal order to merge all of this?

> <https://github.com/GladysAssistant/Gladys/pull/1383>
>
> Use the device/feature property name to set value (instead of default "state" pr…operty).
> 
> Linked to: https://github.com/GladysAssistant/Gladys/issues/1333

[https://github.com/GladysAssistant/Gladys/pull/1420](https://github.com/GladysAssistant/Gladys/pull/1420)

Thanks again for these PRs! 🙏

---

<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:** [February 18, 2022, 5:58pm UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/139 "2022-02-18T17:58:46Z")

</div>

Alarm first, set value second.  
But I would like a regression check on any Zigbee actuator on the set value PR.  
Thanks ❤

---

<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:** [February 21, 2022, 10:24am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/140 "2022-02-21T10:24:00Z")

</div>

Ok I’ve merged the PR from alarme 🙂

For this one, I’m waiting for someone to test with real devices and provide feedback:

> <https://github.com/GladysAssistant/Gladys/pull/1383>
>
> Use the device/feature property name to set value (instead of default "state" pr…operty).
> 
> Linked to: https://github.com/GladysAssistant/Gladys/issues/1333

---

<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 7, 2022, 10:03am UTC](https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/141 "2022-03-07T10:03:50Z")

</div>

For information, we are still open to feedback from @AlexTrovato on this PR:

> <https://github.com/GladysAssistant/Gladys/pull/1383>
>
> Use the device/feature property name to set value (instead of default "state" pr…operty).
> 
> Linked to: https://github.com/GladysAssistant/Gladys/issues/1333

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

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