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…