# Gladys and external MQTT broker

**URL:** <https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741>\
**Category:** Configuration\
**Created:** [February 27, 2024, 4:54pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741 "2024-02-27T16:54:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [February 27, 2024, 4:54pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/1 "2024-02-27T16:54:41Z")

</div>

Hello

I’m reinstalling Gladys once again..

I have an external MQTT broker and when I try to connect Gladys to it, it doesn’t work… the only solution is to use a container in Gladys, which works, but if I want to return to my original setup, it’s impossible.

Has anyone experienced this?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [February 27, 2024, 5:28pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/2 "2024-02-27T17:28:02Z")

</div>

Hello,

Could you maybe give a bit of detail:

- Which external broker?
- How is it installed?
- Is it on the same network as Gladys?
- Can you connect to it via an app like MQTTBox or another?

As an example:  
I use a Mosquitto installed via Docker and accessible via IP on my internal network or via an authenticated mqtts URL for external access.

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [February 27, 2024, 6:07pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/3 "2024-02-27T18:07:42Z")

</div>

yes, I’m on the same network, and I can connect to the broker with a client (user aldi, with MQTT Explorer or from the command line, auchan )

it’s a perfectly normal Mosquitto broker, I’d say. I’m using a Raspberry Pi and the distribution is DietPi, so it was installed using the menus

in the broker’s logs you can see that it doesn’t even try

```auto
Feb 27 14:32:56 jakku mosquitto[11748]: 1709044376: New client connected from 10.8.0.2:37682 as mqtt-explorer-a8b51e9f (p2, c1, k60, u'aldi').
Feb 27 15:02:56 jakku mosquitto[11748]: 1709046176: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
Feb 27 15:04:52 jakku mosquitto[11748]: 1709046292: New connection from ::1:39908 on port 1883.
Feb 27 15:04:52 jakku mosquitto[11748]: 1709046292: New client connected from ::1:39908 as auto-E16CFA39-A5B7-7115-BE34-3929FAC7C5F9 (p2, c1, k60, u'auchan').
Feb 27 15:04:52 jakku mosquitto[11748]: 1709046292: Client auto-E16CFA39-A5B7-7115-BE34-3929FAC7C5F9 disconnected.
Feb 27 15:32:57 jakku mosquitto[11748]: 1709047977: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
Feb 27 16:02:58 jakku mosquitto[11748]: 1709049778: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
Feb 27 16:32:59 jakku mosquitto[11748]: 1709051579: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
Feb 27 17:03:00 jakku mosquitto[11748]: 1709053380: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
Bonjour Protz

Feb 27 17:33:01 jakku mosquitto[11748]: 1709055181: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

```

I’ve done numerous tests between 2:30 PM and now

Olivier

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [February 28, 2024, 8:24pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/4 "2024-02-28T20:24:11Z")

</div>

Hi @bong101,

That’s strange, I’ve been using this configuration (mosquitto installed on another Pi) for years and have never had any issues. How did you configure it in Gladys?

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 1, 2024, 8:48am UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/5 "2024-03-01T08:48:14Z")

</div>

Like this:

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

Name resolution works correctly from the Gladys server

```auto
root@raspberrypi:~# ping jakku.openwarp.lan
PING jakku.openwarp.lan (10.16.5.20) 56(84) bytes of data.
64 bytes from jakku.openwarp.lan (10.16.5.20): icmp_seq=1 ttl=64 time=0.542 ms

```

Port 1883 is open

```auto
root@raspberrypi:~# openssl s_client -connect jakku.openwarp.lan:1883
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 324 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

```

In the Gladys logs, well, nothing…

> 2024-03-01T09:30:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:30:00 GMT  
> 2024-03-01T09:30:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:30:00 GMT  
> 2024-03-01T09:31:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:31:00 GMT  
> 2024-03-01T09:31:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:31:00 GMT  
> 2024-03-01T09:31:18+0100 lan-manager.scan.js:19 (LANManager.scan) LANManager starts scanning devices…  
> 2024-03-01T09:31:32+0100 lan-manager.scan.js:66 (NmapScan.onSuccess) LANManager discovers 8 devices  
> 2024-03-01T09:31:32+0100 lan-manager.stop.js:12 (LANManager.stop) LANManager stops scanning devices  
> 2024-03-01T09:32:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:32:00 GMT  
> 2024-03-01T09:32:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:32:00 GMT  
> 2024-03-01T09:33:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:33:00 GMT  
> 2024-03-01T09:33:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:33:00 GMT  
> 2024-03-01T09:33:18+0100 lan-manager.scan.js:19 (LANManager.scan) LANManager starts scanning devices…  
> 2024-03-01T09:33:32+0100 lan-manager.scan.js:66 (NmapScan.onSuccess) LANManager discovers 8 devices  
> 2024-03-01T09:33:32+0100 lan-manager.stop.js:12 (LANManager.stop) LANManager stops scanning devices  
> 2024-03-01T09:34:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:34:00 GMT  
> 2024-03-01T09:34:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:34:00 GMT  
> 2024-03-01T09:35:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:35:00 GMT  
> 2024-03-01T09:35:00+0100 scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Fri, 01 Mar 2024 08:35:00 GMT

I made at least 5 attempts between 9:30 and 9:35

and in the Mosquitto logs, no connection attempts

```auto
Mar 01 08:58:30 jakku mosquitto[465]: 1709279910: New connection from 10.8.0.2:55308 on port 1883.
Mar 01 08:58:30 jakku mosquitto[465]: 1709279910: New client connected from 10.8.0.2:55308 as mqtt-explorer-a8b51e9f (p2, c1, k60, u'aldi').
Mar 01 09:10:58 jakku mosquitto[465]: 1709280658: Client mqtt-explorer-a8b51e9f disconnected.
Mar 01 09:11:20 jakku mosquitto[465]: 1709280680: New connection from 10.8.0.2:34648 on port 1883.
Mar 01 09:11:20 jakku mosquitto[465]: 1709280680: New client connected from 10.8.0.2:34648 as mqtt-explorer-a8b51e9f (p2, c1, k60, u'aldi').
Mar 01 09:18:41 jakku mosquitto[465]: 1709281121: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
root@jakku:~#

```

no trace of a connection from 10.16… but I am connected via my VPN

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

I think it’s more a bug, because in the configuration screen, when I go back to Integrations/MQTT/Configuration, the toggle gets stuck on ON for «&nbsp;Broker in a Docker container/Use a broker in a Docker container.&nbsp;»

Am I the only one experiencing this?

Thanks

Olivier

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 1, 2024, 1:20pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/6 "2024-03-01T13:20:57Z")

</div>

I should mention that this malfunction occurs on

- a Raspberry Pi 3, Raspberry Pi OS
- a Raspberry Pi 4, DietPi
- a Nano R4S, DietPi

---

<div class="post-metadata">

**Author:** ![ProtZ](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/protz/32/1641_2.png) [@ProtZ](https://community.gladysassistant.com/u/ProtZ)\
**Post date:** [March 1, 2024, 3:28pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/7 "2024-03-01T15:28:20Z")

</div>

How strange … you can try with :

- mqtt://jakku.openwarp.lan (without the port)
- mqtt://j10.16.5.20
- mqtt://j10.16.5.20:1883  
?

---

<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 1, 2024, 8:47pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/8 "2024-03-01T20:47:13Z")

</div>

> [@ProtZ](#):
>
> mqtt://j10.16.5.20

Without the ‹&nbsp;j&nbsp;›, I suppose 😇

By any chance, any autocomplete issue on your Gladys configuration page?

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 5, 2024, 10:56am UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/9 "2024-03-05T10:56:08Z")

</div>

I’ve tried everything!!

No disrespect to the people who want to help, I’m an IT specialist, and I install and configure applications, etc., but I’m not immune to making a mistake

What would be great would be for someone to kindly test a Raspberry Pi, an installation of an MQTT broker, and off we go!!!

Thanks again!!  
Olivier

---

<div class="post-metadata">

**Author:** ![Terdious](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/terdious/32/6316_2.png) [@Terdious](https://community.gladysassistant.com/u/Terdious)\
**Post date:** [March 5, 2024, 12:06pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/10 "2024-03-05T12:06:07Z")

</div>

Hi @bong101,

As mentioned above, I have exactly this setup, my mosquitto broker is 12.5.0.100, my Gladys and most of my devices are on 12.5.0.xxx and some devices on 12.1.0.xxx and I have no issues by specifying the broker address in Gladys `mqtt://12.5.0.100:1883`.

As suggested above, are you sure your browser is not auto-filling the fields? (Really to rule out that possibility)  
Because usually fields that appear in yellow like in your photo are autocompleted:

> [@bong101](#):
>
> ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/5/550d9dc311ceef314ab6e485663cce249e8327e0.png)

And from other conversations on the forum, some browsers would replace the password when clicking Save, from what I understood.

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 5, 2024, 12:57pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/11 "2024-03-05T12:57:53Z")

</div>

Does it matter whether the browser replaces the yellow fields or not? In the sense that on the broker I don’t see the connection attempt arriving, and it doesn’t seem to occur in Gladys either.

@Terdious, which version of Gladys have you been running like this since?  
@all has anyone tested on a recent version of Gladys?

Olivier

---

<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, 2024, 1:05pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/12 "2024-03-05T13:05:47Z")

</div>

Can you try to contact your MQTT server from the Gladys docker (and not from the host Raspberry Pi)? Maybe the domain name `jakku.openwarp.lan` is not known to Gladys 🤔

`docker exec -it gladys /bin/sh`

`ping jakku.openwarp.lan`

`openssl s_client -connect jakku.openwarp.lan:1883`

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 5, 2024, 1:10pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/13 "2024-03-05T13:10:21Z")

</div>

ah, interesting, I’ll test it as soon as I get home !!

---

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [March 5, 2024, 1:50pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/14 "2024-03-05T13:50:07Z")

</div>

Hello @bong101,

There is already a discussion about Docker Node-RED where when you put «&nbsp;localhost&nbsp;» in the «&nbsp;mqtt in&nbsp;» node it doesn’t work; you had to put the IP (DNS resolution doesn’t happen outside the container).

So in your case put «&nbsp;mqtt:xxx.xxx.xxx.xxx:1883&nbsp;» — all the x’s = the IP of your MQTT broker, that should work

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 9, 2024, 6:53pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/15 "2024-03-09T18:53:56Z")

</div>

re,

> [@cicoub13](#):
>
> openssl s\_client -connect jakku.openwarp.lan:1883

```auto

root@raspberrypi:~ $ sudo su -
root@raspberrypi:~# docker exec -it gladys /bin/sh
/src/server # ping jakku.openwarp.lan
PING jakku.openwarp.lan (10.16.5.20): 56 data bytes
64 bytes from 10.16.5.20: seq=0 ttl=64 time=1.287 ms
^C
--- jakku.openwarp.lan ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.610/0.760/1.287 ms
/src/server # openssl s_client -connect jakku.openwarp.lan:1883
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 320 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
This TLS version forbids renegotiation.
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
/src/server #

```

This is a bug, isn’t it?

---

<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 9, 2024, 7:48pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/16 "2024-03-09T19:48:37Z")

</div>

Thanks for checking.  
Actually, it works for several people (myself included) and it doesn’t work for you.  
So it could be a bug, but we need to find a lead or a way to reproduce it; otherwise we won’t be able to fix it.

---

<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:** [March 14, 2024, 3:05pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/17 "2024-03-14T15:05:20Z")

</div>

Hello everyone,

I have the same problem with Gladys installed in Docker on a Proxmox VM. I’m testing Gladys.

I’m trying to connect to the Mosquitto Broker of my Home Assistant. The connection works fine via MQTT Explorer.

I’m attaching a GIF; the toggle automatically switches to a Docker container.

![gladys mqttbroquer](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c8fef475da5c08f2462e4a923b6c2d8e13792580.gif)

Thank you in advance

Gladys version 4.38  
PS: If you prefer that I open another thread, I can do so.

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 14, 2024, 3:18pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/18 "2024-03-14T15:18:47Z")

</div>

Ah,welcome @McFlyPartages !!!

and thank you, I feel less alone

---

<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:** [March 14, 2024, 3:23pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/19 "2024-03-14T15:23:35Z")

</div>

Does the toggle switch back by itself when saving the settings, like it does for me?

---

<div class="post-metadata">

**Author:** ![bong101](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bong101/32/9808_2.png) [@bong101](https://community.gladysassistant.com/u/bong101)\
**Post date:** [March 14, 2024, 3:23pm UTC](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741/20 "2024-03-14T15:23:57Z")

</div>

yes!!! as if we didn’t have a choice

[Next page](https://community.gladysassistant.com/t/gladys-et-broker-mqtt-externe/8741.md?page=2)
