MQTT with YAML defined entities not populating all entities

I’m connecting my generator to my home assistant via MQTT. I have a YAML file based on one published by @gregmac that contains 26 entities. My generator is sending data to my HA and 16 of the 26 entities seem to be working fine. They get data populated as expected. The others do not and I can’t figure out why. I’ve tried all sorts of things to try to fix it, including turning off the JSON numerics, turning on underscores instead of spaces in names, but nothing worked. I could use some help.

Here is my YAML file.

################################################################
## Package / Generator
################################################################
#
#  Version 0.5-greg
#
#  Package for Home Assistant. See https://www.home-assistant.io/docs/configuration/packages/
#
#  This interfaces Home Assistant to a Generac generator montiored by
#  https://github.com/jgyates/genmon
#
#  Based on version 0.5 of the configuration by Louis Mamakos <[email protected]> at
#  https://community.home-assistant.io/t/monitor-your-generac-generator-with-home-assistant/62701
#
#  Modifications:
#  - Minor changes for being ESP32-based
#  - Use JSON numerics (to avoid string parsing)
#  - Add icons, device_class, etc
#
#  Required Genmon MQTT settings:
#  - Blacklist Filter: Run Time,Monitor Time,Generator Time,Communication Stats,Platform Stats
#  - JSON Numerics: ON
#  - Root topic: (blank)
#
#  Notes:
#  - unique_id values in this file are not signficant (or
#    even required at all).  They exist so that the entities show up
#    within the Home Assistant configuration GUI for customization. 
#  - MQTT topics need to match what is configured in genmon

mqtt:
  sensor:
    - unique_id: "fd8f8c07-7d6f-4aea-92b5-16b7d8acc66b"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      state_topic: 'generator/Outage/Status'
      name: Generator Outage Status
      icon: mdi:alarm-light-outline
  
    - unique_id: "f565fed6-8a19-49d4-8066-4015c5ca91b1"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      state_topic: 'generator/Outage/Utility_Voltage/value'   # if JSON numerics
      #state_topic: 'generator/Outage/Utility Voltage'   # if JSON numerics
      name: Generator Utility Voltage
      icon: mdi:sine-wave
      device_class: voltage
      unit_of_measurement: "V"
  
    # status related sensors
    - unique_id: "713eb4b9-feec-4425-8c83-84a9f486aae7"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Battery Voltage
      icon: mdi:car-battery
      device_class: voltage
      state_topic: 'generator/Status/Engine/Battery_Voltage/value'
      #state_topic: 'generator/Status/Engine/Battery Voltage'
      unit_of_measurement: "V"
  
    - unique_id: "83fd4b02-1b5b-4f0c-8a90-fc7cd102a190"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Switch State
      icon: mdi:electric-switch
      state_topic: 'generator/Status/Engine/Switch_State'
  
    - unique_id: "63f6e276-be1d-44ad-8a8a-fe4af30bcff8"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Engine State
      state_topic: 'generator/Status/Engine/Engine_State'
  
    - unique_id: "f3a8aedd-206b-4e5f-baa9-677496ee8d3c"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator RPM
      icon: mdi:gauge
      unit_of_measurement: "RPM"
      state_topic: 'generator/Status/Engine/RPM/value'    # if JSON numerics
      #state_topic: 'generator/Status/Engine/RPM'    # if JSON numerics
      
    - unique_id: "cbdc9c28-5748-4aef-91bc-5b5ec95ed545"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Frequency
      device_class: frequency
      unit_of_measurement: "Hz"
      state_topic: 'generator/Status/Engine/Frequency/value'   # if JSON numerics
      #state_topic: 'generator/Status/Engine/Frequency'   # if JSON numerics
      
    - unique_id: "f5f462db-e16d-4596-9bd3-232b70fa5038"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Output Voltage
      device_class: voltage
      unit_of_measurement: "V"
      state_topic: 'generator/Status/Engine/Output_Voltage/value'   # if JSON numerics
      #state_topic: 'generator/Status/Engine/Output Voltage'   # if JSON numerics
      
    # current measurement is garbage on 22KW product, apparently
    - unique_id: "10e1def6-35fd-4922-932a-90f25abb7f29"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Output Current
      device_class: current
      unit_of_measurement: "A"
      icon: mdi:sine-wave
      state_topic: 'generator/Status/Engine/Output_Current/value'   # if JSON numerics
      #state_topic: 'generator/Status/Engine/Output Current'   # if JSON numerics
      
    # current measurement is garbage on 22KW product, apparently, so this value may
    # also be suspect on that model
    - unique_id: "914a4e97-54a0-41e7-bbeb-a256134e5e35"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Output Power
      device_class: power
      unit_of_measurement: "W"
      state_topic: 'generator/Status/Engine/Output_Power_(Single_Phase)/value'   # if JSON numerics
      #state_topic: 'generator/Status/Engine/Output Power (Single Phase)'   # if JSON numerics
      # this is normalized to watts from kilowatts
      value_template: '{{ value | float * 1000 | round(0) }}'
  
    - unique_id: "8cb64471-9123-48f6-b9be-15c01595981e"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Last Alarm Log
      state_topic: 'generator/Status/Last_Log_Entries/Logs/Alarm_Log'
          
    - unique_id: "bce3182a-a525-47dc-937c-8be4e5afc619"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Last Service Log
      state_topic: 'generator/Status/Last_Log_Entries/Logs/Service_Log'
  
    - unique_id: "faa2f487-fc30-4e9c-8733-5b27270b3e17"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Last Run Log
      state_topic: 'generator/Status/Last_Log_Entries/Logs/Run_Log'
  
      # maint related sensors
    - unique_id: "bf7cbe92-2b1e-48ca-addd-df963697626c"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Capacity
      device_class: power
      state_topic: 'generator/Maintenance/Rated_kW'
      # normalize to watts
      value_template: '{{ value | regex_replace(" *[Kk]W", "") | float * 1000 | round(0) }}'
      unit_of_measurement: 'W'
  
  
    - unique_id: "825657b6-c67a-427a-bee9-7b6ea2182628"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Exercise Time
      icon: mdi:fan-clock
      state_topic: 'generator/Maintenance/Exercise/Exercise_Time'
      # might be nice to maybe somehow normalize this, but not sure into what date/time representation
      # value is something like:  "Weekly Sunday 17:35 Quiet Mode On"
      
    - unique_id: "41c981db-5979-4ee6-b9fb-d1ca44f83b3f"
      expire_after: 300
      name: Generator Total Run Time
      device_class: duration
      unit_of_measurement: h
      state_topic: 'generator/Maintenance/Service/Total_Run_Hours/value'  # if JSON numerics
      #state_topic: 'generator/Maintenance/Service/Total Run Hours'  # if JSON numerics
      value_template: '{{ value | default(0) | float }}'
  
    - unique_id: "927b24b7-772d-434a-8fa1-4f1c5549c90d"
      expire_after: 300
      name: Generator Hardware Version
      state_topic: 'generator/Maintenance/Service/Hardware_Version'
  
    - unique_id: "4cf182de-c37b-48c9-8727-75e1f5053d0d"
      expire_after: 300
      name: Generator Firmware Version
      state_topic: 'generator/Maintenance/Service/Firmware_Version'
  
    - unique_id: "8f9caada-2e90-4cb9-9571-597a27b97a9e"
      expire_after: 300
      name: Generator Service A Due
      state_topic: 'generator/Maintenance/Service/Service_A_Due'
      # value is something like "191 hrs or 04/12/2024"
  
    - unique_id: "6ec00786-1eaf-4a58-b97a-57052cc0641c"
      expire_after: 300
      name: Generator Service B Due
      state_topic: 'generator/Maintenance/Service/Service_B_Due'
      # value is something like "191 hrs or 04/12/2024"
  
    - unique_id: "7f37ec3c-e1c5-4e10-ba9d-f8f15d27a019"
      expire_after: 300
      name: Generator Battery Check Due
      state_topic: 'generator/Maintenance/Service/Battery_Check_Due'
      # value is something like "4/12/2024"
  
  
    # genmon monitor related sensors
    - unique_id: "9bc1d83a-34bc-4a1e-a643-3c0eb62501dd"
      expire_after: 300
      name: Genmon Version
      state_topic: 'generator/Monitor/Generator_Monitor_Stats/Generator_Monitor_Version'

    - unique_id: "93029e3e-bc4f-4aa3-b8e0-b0a30aeeaee9"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Genmon HAT Temperature
      icon: mdi:thermometer
      device_class: temperature
      state_topic: 'generator/Status/External_Sensors/HAT_Ambient/value'
      #state_topic: 'generator/Status/External Sensors/HAT Ambient'
      unit_of_measurement: "°F"

    - unique_id: "c63a832d-69bb-4502-b60b-9912f82ed1eb"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Genmon CPU Temperature
      icon: mdi:thermometer
      device_class: temperature
      state_topic: 'generator/Monitor/Platform_Stats/CPU_Temperature'
      unit_of_measurement: "°F"



#
#  probably the most useful sensor - are we in a power outage condition or not?
#
  binary_sensor:
    - unique_id: "468414df-32b1-4127-8636-4202a11b880c"
      name: Generator Power Outage
      state_topic: 'generator/Outage/System_In_Outage'
      payload_on: 'Yes'
      payload_off: 'No'

############################################################################3
#
# Fun facts (For 22kw generac model)
#   
#  Per specification, fuel consumption for propane is
#        2.56 gal/hr at 50% load (11KW)
#        3.87 gal/hr at 100% load (22KW)
#
#  Per genmon code, the 3 term polynomial to compute this is: [0, 2.74, 1.16]
# 
#        gal/hr = (T0 * pctLoad^2) + (T1 * pctLoad) + T3
#        gal/hr =                    2.74 * pctLoad + 1.16
#
#  This is a pretty good fit to the spec sheet -
#       50% = 2.53 gal/hr  (vs 2.56 spec)
#      100% = 3.90 gal/hr  (vs 3.87 spec)
#
#  Home assistant could compute a gallons/hour rate in a template sensor if this seems useful.
#

So for example these two entities don’t work:

If I look in MQTT Explorer I see the following for these two. (These are actually from the HA integration, I can’t post more than one picture as a new member)

Message 16 received on generator/Status/Engine/Battery_Voltage at 8:41 PM:
{"unit": "V", "type": "float", "value": 14.0}
QoS: 0 - Retain: false
Message 15 received on generator/Outage/Utility_Voltage at 8:41 PM:
{"unit": "V", "type": "int", "value": 243}
QoS: 0 - Retain: false

Any suggestions to fix this would greatly be appreciated!
Thanks.

    - unique_id: "f5f462db-e16d-4596-9bd3-232b70fa5038"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Battery Voltage
      device_class: voltage
      unit_of_measurement: "V"
      state_topic: 'generator/Status/Engine/Battery_Voltage'
      value_template: "{{ value_json['value'] }}"

You have not shared the toipic message the frequency is received on so I can’t say for sure but it should be similar:

    - unique_id: "cbdc9c28-5748-4aef-91bc-5b5ec95ed545"
      expire_after: 300   # genmon MQTT flushes out MQTT updated every 60 seconds
      name: Generator Frequency
      device_class: frequency
      unit_of_measurement: "Hz"
      state_topic: 'generator/Status/Engine/Frequency'
      value_template: "{{ value_json['value'] }}"

Excellent @tom_l ! Thanks. That fixed it. So is working now. Thanks for the help.