How to get started with MQTT

Can anyone give any pointers on why and how to use MQTT and where to start? So far the only really thing i can think of is for use with Own tracks in a presence app. I think you can also use HTTP: but I'm not sure how to do either. Would something like this be a place to start? I look worward to and appreciate any suggestions , tips or insights .

I'm not sure of the "why" part because I don't know your use-case. I got into it to explore the potential. MQTT could theoretically be the generic messaging backbone of a system allowing a bunch of disparate systems to interconnect and share events and data. In practice it's a bit more complicated and not supported everywhere..

To start you would need to run a "broker" like Mosquitto on a separate machine.. That will handle the centralized messaging "repository". Then you would need some stuff to connect to it (clients) - Home Assistant, WeeWX Personal Weather Station + MQTT Extension software, Owntracks etc..

I am using MQTT with Node-RED and a simplified MQTT broker called AEDES for a variety of things like triggering events etc (in place of the standard link nodes) within Node-RED itself. I also have a personal weather station connected to a RaspberryPI running WeeWx & Mosquitto and communicating with Node-RED. Sadly it's just sitting in my basement at the moment and maybe offline (havent checked in a while). I started to get into Owntracks and got some things working but had difficulty with the Android app side. Planning to revisit one of these centuries.

Note: There are some community written MQTT clients (that connect to a broker) in HE for you to play around with as well.

Note2: A nice MQTT browser client is "MQTT Explorer". Allows you to view the topics and activities and do some editing etc.


GAH. I tried this out as well. It worked well as a hand heater, but promptly killed the battery when set to any polling frequency worth consideration for presence.

Oops, back on topic. I use MQTT for my WLED installations as well as running some automations for my car (via TeslaMate).

I'm also using Node-Red for all my automations installed on a "companion" PC hosting MQTT, InfluxDb, Grafana, TeslaMate, and a few more things. It's an Ubuntu Server box and I just used the man pages for the Debian Mosquitto package to muddle through.

1 Like

offtopic, apologies - yep that was my experience too.. frustrating and a very low FAF (Family Acceptance Factor). @aaiyar seems to have a better handle on it though.

Re: Owntracks specifically, there is a community Owntracks integration that does not require MQTT, and works very well for me - reliable and fast. Available for iOS and Android: