MQTT - Creating a pure MQTT device

This request concerns this discussion

and doesn’t seem quite the same as this one because here it’s in the scenes, hence this request

So the idea would be to have the ability to create a device in the MQTT integration that would react to a dedicated MQTT subscription to transform it and use it in Gladys and allow Gladys to publish to it without having to go through Node-RED

so move from a « text » device


to a pure MQTT device

There you go — I hope I’ve been clear! Cast your votes :wink:

I don’t know if this request is very clear and if it makes sense…

I’m replying here; it seems more appropriate :wink:
Hello @pierre-gilles,

I’m not mixing everything up, at least I hope so :exploding_head:…But as Lao-Tzu said « If you give a man a fish, he will eat for a day. If you teach him to fish, he will eat forever. » :thinking: :blush:

The idea is that, via this feature request, it would allow using any device that isn’t yet integrated without having to go through Node-RED (now, if it’s hard to do or not part of the short-term objectives I understand that it won’t be done; there’s no ambiguity about that).

There, I hope I’ve been clearer and have given some meaning to this request… :slight_smile:

You’re confusing the MQTT integration and the Zigbee2mqtt integration :slight_smile:

These two integrations are not connected to each other; you would like the user to be able to send manual commands to the Zigbee2mqtt server.

I don’t think that’s in the project’s philosophy — why not just add the missing siren (which is a small task)?

So unless I’ve already slipped into senility and am a candidate for a nursing home, but when I reread

I understand that on one side we have devices (sensors, plugs, etc.) that communicate using a radio protocol, Zigbee, which is hardware-wise to a gateway dedicated to the vendor or to a generic dongle (Conbee, Deconz, Sonoff) which allows bypassing the vendor gateways to a TCP protocol which is MQTT (similar to a network card on a PC).
I understand that this MQTT protocol transmits TCP frames to a broker (dedicated http server) MQTT and does so bidirectionally.
That this broker works in the manner

  • I receive such an MQTT message (topic) with content (payload) I forward to the people who subscribed to that message(topic) in the list of subscriptions that I have the value of the message (payload).
    In the case of the alarm, looking at the docs I see

So you must send (publish) to the topic
zigbee2mqtt/FRIENDLY_NAME/set
the message
{"warning": {"duration": 10, "mode": "emergency", "strobe": false}}
Isn’t it?

No, I would like the user to be able to send manual commands to the MQTT server

I sometimes feel like I’m annoying you @pierre-gilles :thinking: :face_with_thermometer: :wink: :blush:

Currently the MQTT broker of the MQTT integration is not connected to the MQTT broker of zigbee2mqtt.
These are two completely different integrations with no link between them

@_Will_71

However, if I look at the docs…

Or maybe I don’t understand everything :upside_down_face:

[quote=« cce66, post:7, topic:8455 »]
Or else I don’t understand everything :up

To summarize, yes there are 2 MQTT brokers.
1 dedicated to zigbee2mqtt and another for the MQTT integration.

Indeed, I thought the configuration in zigbee2mqtt pointed to the MQTT server installed by Gladys, but in fact it points to the MQTT server that the container itself hosts.
By looking at the open ports I understood that there was port 1883 for the MQTT broker of the MQTT docker


and port 1884 for the MQTT broker of the Zigbee2Mqtt container

I hadn’t grasped the need for the duplicate MQTT broker, then I understood by looking at the different integration codes on GitHub that the MQTT broker of the zigbee2mqtt docker only serves to translate between Gladys’s own syntax and that coming from zigbee2mqtt in the zigbee2mqtt container.
So basically, when a device is integrated in the zigbee2mqtt integration of Gladys there is a correspondence made between (to reuse the alarm example) the Gladys syntax

gladys/master/device/mqtt:Heiman/feature/mqtt:Heiman/text

and the zigbee2mqtt syntax
the sending (publish) to the zigbe2mqtt broker with the topic
zigbee2mqtt/FRIENDLY_NAME/set
and payload
{"warning": {"duration": 10, "mode": "emergency", "strobe": false}}
at least when the device has been integrated, is that correct?

To repeat @spenceur’s sentence

There is the MQTT integration which has its broker to communicate with Node-RED or else with Gladys itself with its virtual devices.

The MQTT integration serves as a kind of API or means of communication between Gladys and Node-RED, am I right?

Whatever the devices created in the different integrations (Hue, Xiaomi, zigbee2mqtt, MQTT, etc.) they become and are treated as virtual devices inside Gladys, the integration layer serving as an interface (like an API) between Gladys and external protocols — is that correct or am I still mistaken?

I’m sorry for being a pain, but understanding how the internal workings operate also helps to grasp the external functionality and to know what can be requested or obtained as features or even to try to help with the code! This may seem obvious to those who have understood Gladys’s internal workings, but for others it’s not easy to apprehend… Knowing how Gladys works can also attract competent developers to join the current team.
I looked at the code on GitHub and I must say that it’s not very explicit or not well documented, that’s my opinion and mine alone…

Don’t take it the wrong way, but sometimes you jump into threads where a beginner asks a simple question with a very simple answer, and you respond with a very complicated and incorrect answer :grimacing:

In Gladys 4 I really had the goal of simplification and of building a consumer product without developer jargon. Sometimes in your interventions you steer new users in the opposite direction which as a result can indeed irritate me a little (but I try to remain courteous :slight_smile: ).

I don’t take it badly; when I step in to answer it’s also with what I think I understood (on the MQTT container / Zigbee2MQTT side I screwed up, I admit) and in the solution I propose I can be wrong (the forum is made for that, to make progress, right?), in this case suggesting to go through Node-RED seems appropriate (but your approach of saying it would be better to develop it further is the right one) but in the meantime how does @Isage do it? With my IPX800V5 I struggled to interface it with Gladys via MQTT, I found and made a mini-tutorial for that while waiting for this integration to be done someday if it is (it exists in Home Assistant (HA) and Jeedom), by making this mini-tutorial which I also published on the IPX800 forum, it’s to introduce Gladys and show that even if the hardware is not supported by Gladys you can work around it by going through Node-RED just like for this alarm.
I know the forum can be time-consuming for you sometimes but it’s also a source of inspiration

  • hey, a good idea!
  • hey, someone didn’t understand, maybe they’re not the only one or it’s unclear

My almost sixty :sob: :ambulance: you know it (but I wonder about the « courteous », is it about the term « irritate » or about me? No, I’m joking but it shows that between what we express and what is interpreted there’s plenty to debate and to digress about! :wink:)

1 Like

I am closing this request in favor of: