EMQX Is the Perfect MQTT Broker to View Your Traffic

EMQX Is the Perfect MQTT Broker to View Your Traffic

In Home Assistant, I have been using the core available Eclipse MQTT Mosquitto Broker for a long time and it has been working flawlessly. The problem with that broker is that in order to view traffic and troubleshoot issues, I have to go to external software OR use different screens in Home Assistant to watch what is going on.

Home Assistant Mosquitto Broker

Enter the EMQX Mosquitto Broker and the add-on that makes it possible to easily install it and use it in Home Assistant. Installing the add-on is as simple as going to the add-on store, searching for EMQX, and clicking install. You do need to make sure you set up an authentication method and add a user(s) as required for your setup. This is a necessary step in order for Home Assistant to integrate with this add-on. Watch my video for details.

EMQX Add-On Details

There are some known issues and limitations. One specific issue that I ran into when trying to start up EMQX was a port conflict. My WebRTC stuff runs on port 8083, which is the same port that EMQX uses for web sockets. In cases such as this, temporarily shutting down the conflicting service, starting up EMQX and changing the settings, and then restarting the original service fixes that issue. Other known issues are listed in the documentation in the add-on and the official page.

Besides being capable of processing massive amounts of MQTT traffic at scale, the benefit of using this over the Eclipse broker is the convenient interface that allows the ability to configure, manage, and debug your MQTT broker, clients, and traffic.

My EMQX main dashboard showing incoming and outgoing traffic along with dropped messages.

Something that became immediately apparent is that I have a continuous stream of dropped messages that I need to troubleshoot. I'll be getting on that right after finishing this article! It is also possible to see real-time messaging rates, which is helpful to debug noisy devices. You also get a view of how many connections, topics, and subscriptions your broker is handling.

Incoming and Outgoing Message Rates
Connection, Topic, and Subscription Metrics

In addition to overviews, viewing detailed information on connections, topics, and subscriptions is available.

Connection Details

Subscription details.

Subscriptions

Topic details.

Topics

There is so much more available in EMQX and I just scratch the surface. Take a look at the EMQX site for more on what it can do. For setting this up and using it in Home Assistant, watch my video where I go over the install of the add-on, install of the integration, and basic setup/configuration. While you are over there, please hit that subscribe button. I would really appreciate it!