What is MQTT?
MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol originally developed for monitoring oil pipeline sensors over extremely limited bandwidth. That origin is exactly what makes it such a good fit for IoT and building automation devices — sensors, switches, and controllers that often have weak processors and unreliable network connections.
How it works
Unlike direct device-to-device communication, MQTT relies on a central intermediary called a broker (the most common one is the open-source Mosquitto). Devices never talk to each other directly:
- A publisher sends a message to a specific topic, for example
house/livingroom/temperature. - A subscriber registers interest in that topic and automatically receives every new message.
- The broker keeps track of all subscriptions and routes messages to the right recipients.
That means a temperature sensor has no idea which system is actually using its data — it could be Home Assistant, a Node-RED automation, or both at once.
Three features that make it practical for buildings
- QoS (Quality of Service) levels. MQTT lets you choose how important message delivery is — from "sent once, no guarantee" (QoS 0) to guaranteed exactly-once delivery (QoS 2). A temperature reading is fine with QoS 0 or 1, but a door lock command deserves a higher level.
- Retained messages. The broker can hold on to the last known value for each topic, so when a system restarts, it immediately knows a device's last status instead of waiting for the next update.
- Last Will and Testament. A device can predefine a message that the broker sends automatically if its connection drops unexpectedly — making it easy to spot a disconnected sensor or controller right away instead of discovering the problem later.
Where it fits into your building's infrastructure
MQTT often acts as a "common language" between different systems — for example, converting KNX or Modbus signals into MQTT messages that Home Assistant or Node-RED automations can then use. This makes it much easier to add new devices without building a separate, custom integration every time.
Need help with an integration?
We help design and implement an MQTT-based communication layer between different building systems — from sensors to centralized control. Get in touch to discuss your specific case.