The real reasons so many people use MQTT in Home Assistant

Home Assistant Analytics shows that the MQTT integration is used in nearly half of all active Home Assistant installations. This places it eleventh on the list of the most installed integrations for users of the smart home software. What is it that makes this integration quite so popular?

What is MQTT in Home Assistant?

MQTT stands for Message Queuing Telemetry Transport, which arguably makes even less sense than the initialism. It’s a messaging protocol designed for lightweight messaging, making it perfect for smart home devices.

It uses a publish/subscribe model. The “publisher” is the device that sends out a message, and a “subscriber” receives any messages to which it is subscribed. Neither device communicates directly; all the messages are handled by a broker.

The MQTT settings in Home Assistant.

In Home Assistant, there’s a native MQTT integration. In order for it to work, however, you also need to install a broker to handle all the messages. The Mosquitto Broker app (formerly an add-on) is a common choice; you can choose to automatically set up and configure the Mosquitto Broker app when you first set up the MQTT integration.

The broker accepts and authenticates connections from publishers and subscribers, receives any published messages from connected publishers, and sends them out to the appropriate subscribers. It’s like a post office where letters come in from some devices and are sent out to other devices.

A Home Assistant Connect ZBT-2 on a shelf.-1

Home Assistant’s new product isn’t perfect—here’s why I bought it anyway

Sometimes you need to give a little back.

MQTT helps your smart home communicate

All of this sounds fairly complicated. Why can’t devices just communicate directly with one another, without the need for a broker in the middle?

The problem is that for this to happen, every smart home device would need to find, connect to, and understand every other device in your home. With MQTT, devices don’t even need to know that other smart home devices exist. They all just send their data to the broker, which makes sure that the messages reach the right subscribers.

Nuki Smart Lock being opened with a smartphone. Credit: Nuki

For example, I used to have a Nuki smart lock that could communicate over Wi-Fi. Integrating it with Home Assistant meant connecting to Nuki’s cloud to determine when the door was locked or to unlock it remotely.

My new Nuki smart lock has MQTT support and can publish events, such as when the door unlocks, as soon as they happen. It also happens completely locally, without the need to communicate with the cloud.

This makes automations faster and more reliable, and works even if Nuki’s servers are down. Using MQTT also exposes more information, such as whether the door was unlocked by the physical button, the app, the keypad, or a fob.

Zigbee2MQTT makes MQTT a must

If you use Zigbee devices in your smart home, you have two main options in Home Assistant. You can use the native Zigbee Home Automation (ZHA) integration, or the alternative Zigbee2MQTT integration. Many people choose the latter, as it’s more powerful, can expose some additional features of Zigbee devices that ZHA may not expose, and can be run on a separate device so that your Zigbee network doesn’t go down every time Home Assistant restarts.

Zigbee2MQTT running in Home Assistant.

As the name suggests, Zigbee2MQTT translates messages from your Zigbee devices into MQTT messages. Home Assistant subscribes to those messages, so it can react immediately when a device reports a change of state. Home Assistant can also push MQTT messages to Zigbee2MQTT, which then sends the relevant commands to your devices over the Zigbee network.

The popularity of Zigbee2MQTT is one of the reasons why so many people have the MQTT integration installed in Home Assistant. If you don’t have MQTT and a broker installed, Zigbee2MQTT won’t work.

MQTT helps to keep things local

One of the key principles of Home Assistant is to be able to control your smart home locally, without having to rely on third-party cloud services. This is exactly what MQTT allows. Your smart home devices communicate with your broker over your local network, with none of the data leaving your home.

A smart home product box with a zigbee certified product label on it. Credit: Adam Davidson / How-To Geek

This means that even if your internet service is down, smart home devices can carry on communicating with the MQTT broker, as long as your local network is still up and running. Your Zigbee motion sensors can still turn your Zigbee light bulbs on when you walk into the room, even if you can’t get online.

Local communication also offers far more privacy. The more data that leaves your home, the more data that can be intercepted or used by third parties. Using MQTT, it’s possible to build a completely local smart home that doesn’t rely on any cloud services at all.

When you don’t need MQTT (and when you do)

That’s not to say that MQTT is the be-all and end-all of smart home communication. There are plenty of reasons why you might not want it or need it. If your devices already have strong native Home Assistant integrations, for example, they will be able to communicate with your server without the need for an MQTT broker in the middle.

A Home Assistant Connect ZBT-2 on a shelf. Credit: Adam Davidson/How-To Geek

If your smart home is fairly small and you’re not mixing a lot of different smart home ecosystems, MQTT might also not be necessary. If you have a few Zigbee devices, and they work fine with ZHA, then installing MQTT isn’t something you need to do.

However, there are plenty of reasons why you might need it. If you’re planning to use Zigbee2MQTT, it’s a prerequisite. If you have devices that predominantly communicate by publishing MQTT messages, you’ll need to use MQTT to talk to them.

If you want a fully local smart home, MQTT can also be very useful. Some smart home devices that usually rely on the cloud can be flashed with open-source firmware such as Tasmota that can give those devices MQTT capabilities, allowing you to control them completely locally.


MQTT can seem intimidating, but it’s essentially just a way for your smart home devices to drop messages into a message mailbox. The broker then delivers those messages to the appropriate places. You don’t need to understand how it works to take full advantage of the benefits that it can offer.

Share this post:

Leave a Reply

Your email address will not be published. Required fields are marked *

From the latest gadgets to expert reviews and unbeatable deals — dive into our handpicked content across all things tech.