Gateway/Bridge for MQTT Devices?

Hey all,

Currently using Zigbee and trying to understand more of how MQTT works. If I have a Zigbee device, I know I just need a Zigbee hub/dongle to get the Zigbee messages in/out of HA. I also (probably?) understand I can flash that hub/dongle with Zigbee2MQTT, so the hub will translate data back and forth between Zigbee and MQTT inside HA.

But what about devices advertised as MQTT directly? Do I need to find another hub/bridge that specifically works with MQTT? Or would the hub flashed with Zigbee2MQTT work? I had assumed that Zigbee2MQTT speaks Zigbee on the “outside” (radio), and MQTT on the “inside” (usb / HA).

How do these MQTT devices actually talk to a regular server running HA?

For MQTT you need to set up an MQTT broker which handles the communication from the different clients to each other.

I assume you use HAOS (I don’t but I have a little knowledge of it) so there should be an MQTT broker add-on available.

Or you can use any MQTT broker you want on any machine.

The MQTT broker is just software or app that runs on a machine and uses your local IP network to communicate between devices.

the MQTT clients connect to the broker (zigbee2mqtt is a client and so is HA) and they subscribe and publish to MQTT topics. The broker keeps track of which clients are subscribed to the different topics and routes the MQTT topic payload data to the appropriate clients when another client publishes data to the topic.