# Use an external Zigbee2mqtt in Gladys

**URL:** <https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790>\
**Category:** Demandes livrées\
**Tags:** zigbee2mqtt, feature-integration\
**Created:** [March 24, 2024, 11:38am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790 "2024-03-24T11:38:14Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Alyafride](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alyafride/32/16035_2.png) [@Alyafride](https://community.gladysassistant.com/u/Alyafride)\
**Post date:** [April 30, 2024, 8:16am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/41 "2024-04-30T08:16:27Z")

</div>

> [@pierre-gilles](#):
>
> Ah that’s unfortunate, could you check the error in the Gladys logs?

I’ll do an export a bit later but from a quick glance I see a plethora of these logs in succession:

```auto
2024-04-29T22:59:25+0200 \u003cwarn\u003e handleMqttMessage.js:113 (Zigbee2mqttManager.handleMqttMessage) Zigbee2mqtt device XXXXXXXXX not configured in Gladys.

```

---

<div class="post-metadata">

**Author:** ![McFlyPartages](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mcflypartages/32/15670_2.png) [@McFlyPartages](https://community.gladysassistant.com/u/McFlyPartages)\
**Post date:** [April 30, 2024, 8:27am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/42 "2024-04-30T08:27:04Z")

</div>

I don’t think the goal is to manage the container from Gladys; in that case, you might as well use the integration

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [April 30, 2024, 8:11pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/43 "2024-04-30T20:11:14Z")

</div>

> [@pierre-gilles](#):
>
> The port in your screenshot is 1884, is that the correct port?

Yes, I confirm it’s the correct port.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [April 30, 2024, 8:43pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/44 "2024-04-30T20:43:21Z")

</div>

I tried again but it still doesn’t work for me.  
I even recreated other MQTT and zigbee2mqtt containers and still get the same error.

So I also tried putting the connection info into the MQTT integration. Here there is no connection problem. I can connect fine, so my MQTT broker is working correctly.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/4/f/4f54be058af29e09455051df68de86398b39d2ed.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/e/de5fd116e84f3169e0160e7663d9699bdd0f1cc1.png)

---

<div class="post-metadata">

**Author:** ![McFlyPartages](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mcflypartages/32/15670_2.png) [@McFlyPartages](https://community.gladysassistant.com/u/McFlyPartages)\
**Post date:** [April 30, 2024, 9:22pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/45 "2024-04-30T21:22:56Z")

</div>

Hi,

Same problem for me — it doesn’t work, I can’t activate the service.

`docker logs gladys`

```bash
2024-04-30T23:16:41+0200 <info> init.js:56 (Zigbee2mqttManager.init) Zigbee2mqtt USB dongle not attached
2024-04-30T23:16:41+0200 <info> connect.js:17 (Zigbee2mqttManager.connect) Disconnecting existing MQTT client...
2024-04-30T23:16:41+0200 <info> connect.js:25 (Zigbee2mqttManager.connect) Connecting Gladys to mqtt://192.168.10.13:1883 MQTT broker...
2024-04-30T23:16:41+0200 <warn> connect.js:46 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2024-04-30T23:16:41+0200 <warn> connect.js:53 (MqttClient.<anonymous>) Disconnected from MQTT server

```

I can connect from MQTT Explorer without issue and, like @_Will_71, if I connect an external broker from Gladys it works.

MQTT broker and Z2MQTT installed on a test Home Assistant (HA).

Some screenshots:

 ![Screenshot from 2024-04-30 23-20-46](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/f/1f91fb49d9e3a2904d3a76ab765ff87a3b3d9b0f.png)

 ![Screenshot from 2024-04-30 23-21-12](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/e/3ed30a7490e3ba413086617d4c45aed4dc49c28e.png)

 ![Screenshot from 2024-04-30 23-08-10](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/6/36358a56e65e9353cf698735cf575b15b27cb712.png)

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [April 30, 2024, 9:39pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/46 "2024-04-30T21:39:38Z")

</div>

That reassures me, I feel like I’m the only one with the problem.

---

<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:** [May 1, 2024, 8:42am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/47 "2024-05-01T08:42:10Z")

</div>

I’m currently setting up an environment to try to reproduce it! Thanks for your feedback! 🙂

---

<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:** [May 1, 2024, 9:59am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/48 "2024-05-01T09:59:43Z")

</div>

There was indeed a bug in the handling of login credentials 🙂

I managed to reproduce and fix the bug. It’s been pushed to the Docker image!

To re-test, remember to:

```auto
docker pull gladysassistant/gladys:z2m-setup-external

```

And to remove/recreate the container.

Thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 1, 2024, 10:12am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/49 "2024-05-01T10:12:02Z")

</div>

I confirm it works now

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

And I see my devices

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/6/b6e543aafa8b2ddf2195ad05bd055d35c585cd7b.png)

---

<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:** [May 1, 2024, 10:27am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/50 "2024-05-01T10:27:02Z")

</div>

Great!! Thanks for testing 😊

So, do you approve a release to production?

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [May 1, 2024, 10:32am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/51 "2024-05-01T10:32:56Z")

</div>

I’m not personally affected by this development, but I understand it could be a nice entry point for people already using Home Assistant (HA) or other platforms.

Wouldn’t (if production is launched) this be a good opportunity to do a series of posts on the topic?  
I’m thinking of Reddit in particular, but there are surely lots of other places!

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 1, 2024, 10:45am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/52 "2024-05-01T10:45:24Z")

</div>

> [@pierre-gilles](#):
>
> So do you approve a production release?

Yes, I approve — I just re-tested and also created the containers directly with Gladys, and everything works fine.

---

<div class="post-metadata">

**Author:** ![McFlyPartages](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mcflypartages/32/15670_2.png) [@McFlyPartages](https://community.gladysassistant.com/u/McFlyPartages)\
**Post date:** [May 1, 2024, 10:50am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/53 "2024-05-01T10:50:07Z")

</div>

I will test tonight

---

<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:** [May 1, 2024, 11:42am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/54 "2024-05-01T11:42:47Z")

</div>

> [@guim31](#):
>
> Wouldn’t it (if production is launched) be a good opportunity to do a series of posts on the subject?

Yes, absolutely! I think we need to reach out to users on other platforms everywhere — besides, I’m counting on you for that 😃

We can present it like: «&nbsp;We need to improve the coverage of our Zigbee2mqtt-Gladys integration and we want testers to check whether all their devices are supported by Gladys.&nbsp;»

By making it clear that Gladys can run alongside HA (Home Assistant), so it’s not destructive to use Gladys to test all of this 🙂

---

<div class="post-metadata">

**Author:** ![McFlyPartages](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mcflypartages/32/15670_2.png) [@McFlyPartages](https://community.gladysassistant.com/u/McFlyPartages)\
**Post date:** [May 1, 2024, 12:04pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/55 "2024-05-01T12:04:09Z")

</div>

I’m going to write a short article on my blog that I’ll share on social media.

---

<div class="post-metadata">

**Author:** ![McFlyPartages](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mcflypartages/32/15670_2.png) [@McFlyPartages](https://community.gladysassistant.com/u/McFlyPartages)\
**Post date:** [May 1, 2024, 5:01pm UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/56 "2024-05-01T17:01:35Z")

</div>

I just tested it, it works perfectly, great work @pierre-gilles

---

<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:** [May 2, 2024, 7:44am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/57 "2024-05-02T07:44:47Z")

</div>

Can you test the following case:

- An external MQTT broker for ZigBee on the default port: 1883
- An external z2m container on the default port
- Enable the MQTT container of the Gladys integration  
 ![Screenshot_20240502_094413_com.android.chrome](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/0/c0114b37b012a572f4085a81192593cde1a5cbad.jpeg)

No conflict?

---

<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:** [May 2, 2024, 8:07am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/58 "2024-05-02T08:07:21Z")

</div>

As long as the external MQTT broker is truly external (not on the same machine), there will be no conflict.

If the external MQTT broker is on the same machine, then yes there will be a conflict.

Besides, that’s outside Gladys’s scope because it’s the user who starts the container and therefore chooses the port ^^

---

<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:** [May 2, 2024, 8:25am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/59 "2024-05-02T08:25:59Z")

</div>

Maybe it should be indicated somewhere? A sentence like ‹&nbsp;Warning, if you already have a broker on port 1883, do not let Gladys create a container but configure it manually&nbsp;›?

Or perform a check when creating the MQTT container and prevent its creation?

Or say that you should not create a separate MQTT container unless there is already one for z2m configured manually?

Finally, I think this should be clarified… But I’m just a regular user not concerned 😇

---

<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:** [May 2, 2024, 11:10am UTC](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790/60 "2024-05-02T11:10:00Z")

</div>

I’ve added a message!

 ![Screenshot 2024-05-02 at 13.08.42](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/0/d0673ff3a334534789ab213de6bc2482abd71ab0.png)

[Previous page](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790.md?page=2)

[Next page](https://community.gladysassistant.com/t/pouvoir-utiliser-un-zigbee2mqtt-externe-dans-gladys/8790.md?page=4)
