Monitor your Generac generator with Home Assistant

You don’t. You install it on your desktop.

Sorry yes, install it on a system on the network with access to the MQTT server. I find it handy when debugging mqtt messages as don’t always get what I am expecting. I can also copy/paste out the exact path if needed. You can use mosquitto_sub and grep etc to get what you want, but I find this convienient, especially for long periods of monitoring the messages and when they came in.

Ok. I’ve installed Explorer and connected it to the broker running on HA but all I see is a bunch of stats. Total numbers of subscription, messages, packets, etc. I don’t know how to figure out anything from this-

If I connect Explorer to the broker running on the GenMon unit I see the topic /MyGen/# with most of the sensor values that I’m looking for. I don’t see this topic listed when I connect to MQTT on Home Assistant. I think that i haven’t properly subscribed the HA integration to receive this topic.

So sounds like the generator root path is /MyGen on yours? Something like this may work:

  - platform: mqtt
    state_topic: "/MyGen/generator/Monitor/Platform Stats/WLAN Signal Level"
    name: "Genmon WLAN Signal Level"
    value_template: '{{ value | regex_replace(" dBm", "") | float | round(1) }}'
    unit_of_measurement: dBm
    device_class: signal_strength

Don’t think that’s going to work. My genmon unit is connected via ethernet. I don’t even see a Signal Level on the GenMon web page.

I tried using this-

  - platform: mqtt
    state_topic: 'MyGen/generator/Status/Line/Utility Voltage'
    name: Genmon Outage Utility Voltage
    unit_of_measurement: "VAC"

Doesn’t work though. Just gets added as an unknown sensor. I really think that the Mosquito integration isn’t subscribed to the topic MyGen and I can’t find any intructions for how to do that.

Ahh sorry, I used the wifi as an example, good catch. If you go the MQTT Integration in HA, go to Configure then Listen to a topic, and put in, MyGen/#, do you see the messages flying by?

No. Just stays blank.

I think there’s an option in genmon to strip off the “unit” associated with the published values. Perhaps that trailing, e.g., V on the published voltage is screwing things up. In my configuration, I have a template express that strips it off, if present.

Also note that a leading / character is atypical in an MQTT topic name. The / character separates components of the topic name; a leading / means you have a null, zero-length component in the topic ahead of the /. So the topics
foo/bar
and
/foo/bar
are not the same.

1 Like

Thanks. The leading / was a typo on my part. The topic is actually MyGen and I’ve been using MyGen/# for testing.

I don’t see this option in genmon settings. I do see in explorer that it’s possible to get just the numeric value though. ‘MyGen/generator/Status/Line/Utlity Voltage/value’ for example. This appears to supply just the numeric value. I tried it-

  - platform: mqtt
    state_topic: 'MyGen/generator/Status/Line/Utility Voltage/value'
    name: Genmon Outage Utility Voltage
    unit_of_measurement: "VAC"

No luck though.

The value of the sensor is a string, so having the " V" string on the end won’t keep it from populating, it just won’t make it useful for graphing. But you should still see a value.

Can you confirm that Home Assistant is seeing the published messages? If you go to the “Configuration” screen from the menu on the left; select “Integrations”, then find the MQTT integration. Select the “configure” link on the MQTT thing, and then you can enter an MQTT topic on “Listen to a topic” and then click on “START LISTENING”.

Maybe just start with the topic string of one sensor and see if anything pops out, and if it’s what you’re expecting… should match the payload the MQTT explorer is showing you.

Also, regarding how the values are published from genmon, see https://github.com/jgyates/genmon/wiki/1----Software-Overview#genmqttpy-optional and I think you probably want to set this parameter to “true”

# Optional. This value, if true will return numeric values in the Status
# topic as a JSON string which can be converted to an object with integer
# or float values. This applies to items in on the Status, Maintenance and
# Outage page for Evolution and Nexus models and the Status page for
# Industrial models.
numeric_json = False

if you’re not using a template to strip off the units. You probably want just a number in there so that the sensor only take numeric values and you can have pretty graphs and gauges and stuff.

I changed the json setting as you recommended. Not seeing anything when listening to the MQTT topic in HA. Now I’m not seeing anything in explorer either. The MyGen topic has disappeared.

I’m not sure what to suggest, other than working outwards from the genmqtt client and MQTT broker to see why messages are are not being published?

If SSH into the genmon raspberry pi, check to see if the genmqtt process is running; maybe there’s a configuration syntax error in its config file or some other reason it didn’t start?

It must be running. I can login to it with MQTT Explorer from a desktop machine and see all the topics. For some reason Mosquito isn’t picking up anything on my HA server. I’m still not exactly sure I have Mosquito configured correctly. I installed the addon with the default configuration. That’s it. Just seems like there should be more to configure in HA? I couldn’t find anywhere to even configure a subscription but finally figured out how to do that with Explorer.

Is Home Assistant configured to use the (same) MQTT broker (mosquitto)? The subscription is referenced in the sensor definition when you list out the topic.

Try using the Developer Tool thing I suggested before to ensure that Home Assistant is talking to the MQTT broker correctly.

I have Mosquito addon installed on Home Assistant per the Home Assistant docs. GenMon has a separate instance of Mosquitto running. As I posted previously, I haven’t done any other configuration in HA. To be clear each unit has its own instance of Mosquitto.

Not sure what Dev Tool you’re referring to. If it’s the “subscribe to topic” setting in Mosquitto running on HA I have tried that repeatedly but it’s not receiving anything from my network.

Well, there’s your problem. You have two different MQTT brokers so no surprise that the messages that genmon publishes to one of them are not received by Home Assistant that’s listening to a different one.

Get rid of the MQTT broker you’re running on genmon, and configure genmon’s genmqtt software to use the MQTT broker (mosquitto) that’s running on your Home Assistant installation. MQTT is a message bus, and all the software processes that want to share messages need to be using the same message bus.

I don’t think genmon has a MQTT broker, mosquitto or otherwise.

Have you followed the instructions here? 1 Software Overview · jgyates/genmon Wiki · GitHub. If so what are your settings?

EDIT: basically what @lmamakos said!