Benefits of mqtt

Hi All
What are the benefits of mqtt. Why would I want to implement?

1 Like

Hi Arno,

In two words I would say (my opinion) the benefits are ease of implementation and extensibility. MQTT is a very simple protocol to implement. The messages do not have a lot of overhead (they do not take up bandwidth) and the protocol is very readable and simple.
As a result, a broker is easy to get and can be run almost anywhere.
The extensibility is the main thing for me.
I have temperature sensors that publish a temperature every minute. Wherever I need that data I just subscribe to it. I don’t need to have lots of routing information in the system sends the temperature and I don’t need lots of memory on the broker to store it. The devices that want the data simply subscribe to the topic and the published data gets sent to them. A new device on the network, no problem, just subscribe to the topic and nothing else needs to change.
It is a very simple, versatile and extensible protocol with lots of implementations already out there and hence lots of support.

I hope this helps.


1 Like

MQTT is a communications protocol, and you would want to implement it if you have something to communicate to something that speaks MQTT.

Everything Haemish said is correct.

I would just add that MQTT is the closest thing there is to a standard in IOT communications. Every controller I know (OpenHAB, HA, Domitz, Homegear etc) can communicate with MQTT, so a sensor publishing to an MQTT topic can be read by any of these.

Here’s another way of thinking about it: Loose coupling. Let’s say you’re writing a library/script/app that creates or reads data from somewhere. For example, I wrote a script to interface with my solar panels to read power generation numbers. But I don’t know what I want to do with that data yet. In the future, I might want to create a database from it, plot it, watch to see if the panels are failing, etc, etc. The easiest way to handle this is to have my little app publish the data to a broker using MQTT. Now I have a small app that reads the data and sends it out using MQTT. Later on, I can write multiple other small apps that can subscribe to the solar panel MQTT feed and do something with the data. But I don’t have to decide any of that when I’m writing the solar panel code - those apps don’t need to know anything about each other. So using MQTT allows me to write smaller, simpler apps and gives massive flexibility in how you want to handle data later on.


@haemish, @gpbenton and @TD22057 thanks for sharing your thoughts.

I’ve been using HASS for more than 2 years but never tried MQTT. Will give it a go!