MQTT — short for Message Queuing Telemetry Transport — is the messaging protocol that keeps most smart home systems running. It’s the reason your motion sensor can trigger a light in under a second, or your Tibber Pulse can push live energy readings directly into Home Assistant without touching a cloud server.
MQTT works on a publish/subscribe model — the opposite of how a normal web request works. Instead of a device asking “do you have any updates?”, every device connects to a central hub called a broker. Devices that have something to say publish a message to a topic (for example: home/sensor/temperature). Devices that care about that topic subscribe to it and receive the message instantly. The broker — typically Mosquitto in a Home Assistant setup — handles all routing in between.
What makes MQTT unusually well-suited to smart home use is its efficiency. The protocol was originally designed for remote oil pipeline monitoring in the 1990s — environments where bandwidth was scarce and connections unreliable. A typical MQTT message payload can be just a few bytes. The protocol runs over TCP, supports three Quality of Service (QoS) levels (0 = fire and forget, 1 = at least once, 2 = exactly once), and keeps connections alive with a configurable keepalive ping. In a local network with a Raspberry Pi running Home Assistant and Mosquitto as the broker, latency is typically under 10 ms.
Pro Tip: Use Retained Messages for Sensor State
Enableretain: trueon sensor topics so the broker stores the last known value. When Home Assistant restarts, it immediately receives the current state of every device — no waiting for the next update cycle.
MQTT topics follow a hierarchy separated by forward slashes, which makes it easy to structure your smart home logically: home/livingroom/lamp/state, home/garden/soil-moisture. Wildcards are also supported — # matches everything below a level, + matches a single level — which is how integrations like Zigbee2MQTT expose hundreds of devices under a single subscription pattern.
⚡ Fun Fact: MQTT was invented in 1999 by Andy Stanford-Clark (IBM) and Arlen Nipper (Cirrus Link) to monitor remote oil pipelines via satellite link — a connection so slow that every byte counted. Today the same protocol runs on millions of home automation devices worldwide.