Monitor your Generac generator with Home Assistant

I tried a few of the template expressions with values that have the units missing, and they do continue to work; not matching the pattern isn’t an error.

(I did notice that I forgot to do this for the generator capacity value, so I’ve fixed that…)

My suggestions at this point are:

  • check the flush interval thing as I previously mentioned. Genmon won’t send value that haven’t changed very recently often enough for Home Assistant to declare them unavailable.

  • You might try to subscribe to generator/# in Configuration>Intergrations>MQTT>Configure>Listen to a Topic and see if the topics and text match what you’re expecting. You can always verify what the template sensors are doing by going into Developer Tools > Template and testing the template expression in there. Just copy the text from the MQTT listen thing, enclose it in quotes and then invoke the template by replacing value with the quoted string.

So

    value_template: '{{ value | regex_replace(" kW","") | float * 1000 | round(0) }}'

from one of the template sensors would get tested in the Template developer tool as

   {{ "22 kW"  | regex_replace(" kW","") | float * 1000 | round(0) }}

if 22 kW was the payload.

Seems like there’s a plumbing problem somewhere; could you try to capture the raw MQTT messages going by so we can see what they look like?

If the MQTT listen thing in Home Assistant is unwieldy, I built a simple python script to monitor MQTT traffic, as described in this post that might be helpful. (You can ignore the bit about the retained messages.)