Help with MQTT totally lost!

Hello, hope someone can dumb this down to where I can understand it. This is also a general question about this MQTT stuff, with the possibility to use it for other IOT purposes in the future. I have read some stuff and watched a couple Youtube videos, but it isn't sinking in for some reason.

  • I have a device called Genmon. It is a 3rd party Generac generator monitoring software that runs on a Raspberry Pi.
  • The Genmon has an MQTT app (see screenshot and app documentation below).
  • I have a Hubitat.

So how can I tie these together? I really am having a hard time understanding the MQTT stuff, there seem to be various terms thrown about that are inconsistent. These are exact names of what I see in various places on that Genmon app, as well as on the Hubitat and other forums.

  • "MQTT broker server"
  • "MQTT bridge"
  • "MQTT client"
  • "MQTT server"
  • "MQTT broker"

I guess I don't get what all these are, whether I need more hardware or software, or what. Who does each of these roles? Are these really just two things (server, client), with people making up names of stuff?

In some places, it sounds like I need something else like another Raspberry Pi (or computer of some type) to tie all this together?

I tried one Hubitat MQTT app, I think it was the one by Kevin. But I think I was doing something wrong because it didn't do anything, output any errors, or even show that I had tried to tie Hubitat to Genmon.

It looks like there are a couple Hubitat MQTT apps, is one better or easier than the other?

And finally, I guess I don't fully understand all the settings below do. Who is the MQTT server, for example, is that Hubitat or this other mystery device?

Documentation for Genmon MQTT 1 Software Overview ยท jgyates/genmon Wiki ยท GitHub

An MQTT broker is a separate piece of software you have to run somewhere. Most people use mosquitto, but there are other versions/brands out there.

Server=Broker and can be used interchangeably.
Bridge = connect 2 different mqtt brokers together. Probably not needed for anything you will do.

So the MQTT server/broker address would be the address of the machine that is running the MQTT server/broker software - an rpi, docker container, other - wherever you decide to install it.

Your link is a python app that takes the genmon data and pushes it into an MQTT server (that you setup/install somewhere).

After the data is in the MQTT broker, then you would use Kevin's MQTT hubitat app to integrate it into hubitat.

  • So Hubitat is a client not a broker/server?
  • And Genmon is also a client?

OK, but can I run this server on either Hubitat or the existing Raspberry Pi, OR do I need additional hardware? In other places I am reading, this could be cloud based? I keep seeing so many ways to do this that I am confused.

Where can I find the broker/server software (where to download it)?

Thanks for the help so far.

Correct on both accounts. And you can run an MQTT server on the same RPi as the Genmon python app.

Edit: This link might be useful in setting up a commonly used MQTT Broker called Mosquitto:

correct. it is a client.

Looks like it. That python app you had the link to the readme was definitively a client.

No

Yes

Up to you, but probably not if you already have an rpi in service somewhere.

Sure, if you want it to be. You could put an mqtt broker anywhere. I have one local and one cloud one that are bridged together, in fact.

1 Like

I'll toss in that the broker (mosquitto in my case and most others) is extremely light weight, using very little storage, memory, or CPU. It's certainly possible to heavily load it but not in a HA world unless your HA resembles large industry :flushed: :rofl:

BTW, MQTT is used in some industry.

2 Likes

Often a home mqtt broiker will only use maybe 10-20mb ram. Very light weight.

Just looked and mine is using 5.48 MB RAM

I was confused with MQTT also. I use Node Red for all of my automation logic and incorporating all of my Tasmotized devices that rely on MQTT makes much more sense to get into HE with the Hubitat pallet in Node Red. NR can run on same RPi as Your Mosquito broker.

Do you have any pointers to a cheap cloud mqtt broker to tie to my local one?

Cheap is relative. :slight_smile: I use a $5/mo Linode VM.

And a nice guide for configuring bridging:

Out of curiosity why do you need a cloud one? Guess I'll tag @JasonJoel since he said he's doing this as well.

@neonturbo just to throw another piece of terminology into the hat - MQTT gateway, that links other IOT protocols to MQTT, a prime example would be zigbee2mqtt, seeing as this seems to come up often recently in conjunction with those troublesome I--a Tr----i di----rs :grin:.

Example:

(Tr---i Di----r) <----> zigbee2mqtt (on a pi) <----> mqtt (same pi) <------> node red (same pi) OR HE via MQTT client app

My cloud one is where my phones report location back to via owntracks. Then it bridges to my local mqtt so I can use it in my presence rules, etc.

I would consider a web one to get data from a second location. There are other methods of course, but bridged instances might make things clean and easy.

What you diagramed in your example is exactly what I do except instead of r-pi, I run z2m, mqtt and Node-red in docker on a synology Nas.

Yeh it's great to have the flexibility to use whatever hardware you have!

Update: I got it all figured out... but still wouldnt hearing thoughts...

I know this an old thread, but this has been really helpful as I started from zero attempting to set up a 3D Printer <-->OctoPrint <--> Mosquitto <--> HE <--> Some Power Switch already on HE (and whatever else yet to be thought of).

I have gotten from 3D Printer to Mosquitto, now I am ready to tackle those bits to make the connection between Mosquitto and HE and would appreciate some advice/experience .

For reference purposes, I have an andriod phone that is the OctoPrint server that communicates with the 3D printer, on that same android phone I have somehow successfully installed the Mosquitto server and all that was required to make that happen. I have confirmed my Mosquitto server is working and accessible to via an app called MQTT Explorer. I can see the topics coming in from OctoPrint to Mosquitto so looks good to that point (I think).

In the post above "Kevins MQTT App'" was mentioned.. first where would I find the documentation on that and second is this still the "way to go"?

I have also come across the below App/Driver information.

Are there any thoughts or lessons learned from those who have trod this path ahead of me?

One small caveat, I come from a place of limited code knowledge, but persistence and trial and error to make up for lack of formal training in this space, so be gentle :slightly_smiling_face:

Thanks in advance

My app will certainly help you to achieve this but it may be more complex than some of the other available solutions.

I'm slightly concerned that you have an MQTT broker running on an Android phone. This I assume is going to have limited availability as the phone powers down, backgrounds or is moved. That would cause my app to do quite a few restarts when it loses connectivity to the broker and that could be troublesome.

Having an MQTT broker consistently available 24/7 is a much preferable implementation.

Kevin

2 Likes

Download the Hubitat app