2025.12.4 Utility meter / energy dashboard bug?

Hi all, asking for a quick sanity check here if I’m doing something wrong or it’s a bug. I created (water) utility meter for my pool autofiller and it’s working well. However when I try to add it to the energy dashboard under individual water devices, I get this little number:

Even though it’s not listed as a config variable, I tried adding the device_class in my YAML definition as follows:

utility_meter:
  # this is a water meter that sums up daily gallons from the poolfiller sensor
  pool_evap_gallons_per_day:
    source: sensor.mtq_pool_filler_last_run_gallons
    unique_id: meter_pool_evap_gallons_per_day
    device_class: volume
    cycle: daily
    delta_values: true
    periodically_resetting: true
    always_available: true

However, when checking the YAML in dev.tools, it not entirely unexpectedly yells at me:

The entity which the utility meter is monitoring is defined as follows:

mqtt:
  sensor:
    # Used to track how much water was added as a function of how long poolfiller was detected wet
    - name: MTQ Pool filler last run gallons
      unique_id: mtq_pool_filler_last_run_gallons
      device_class: volume
      state_topic: "custom/pool/filler/last_run_gal"
      icon: mdi:beaker
      unit_of_measurement: "gal"
      state_class: measurement

I did try removing the device_class from that entity, reloading etc, but it made no difference…

So what do I do here? I’ll be happy to open an issue on Github if not already there, yet I’d appreciate if someone could eyeball this and tell me if it’s me or a bug?

I think you will find that Home Assistant device class “water” [Water consumption in L, gal, m³, ft³, CCF, or MCF] is going to be more acceptable than “volume”

Thanks for the suggestion - I gave that a try, yet the utility meter entity does not like having a device_class configuration entry added, be it water or volume:

I tried changing the underlying sensor to device_class water unfortunately that has no effect on the issue that the energy dashboard won’t accept the utility meter.

Note: Reading about the energy panel and adding sensors, it actually looks like utility meters are not supported? This seems weird as it would not be unusual to have sub meters for irrigration and other water consumption points, as well as sub electricity-meters, for like an guest house or inlaw-unit?

Home Assistant is set up to be helpful in that you cannot select entities unless they have the correct settings. The documentation alas is not always easy to navigate to find out what the correct settings are, and how to achieve them.

  • The entity must be a sensor. If you are trying to add something from another domain (for example an input_number), then you must first create a template sensor from it.

Yes it appears that the Energy Dashboard will only accept sensors, and the state_class has to be total / total_increasing, and for the Water the device_class has to be water, and the units gal.

The solution, I guess, is to create a new helper-template-sensor. The Helpers offer Templates, including Sensors. The sensor value is defined from a template, so it can be something simple like

{{states('sensor.mtq_pool_filler_last_run_gallons')|int(0)}}

This just pulls the state value of your mqtt sensor for the new sensor state value. All the other settings can be defined in the config, including unit of measurement, device and state class.

This not only appears to work (and I guess you have to create a new template-sensor from a utility meter entity also to correct the settings) but tinkering with the Helper configuration also brings up all the HA error messages if you try to set device class water with state class measurement and so on.

I have quickly tested this with a template ‘{{42}}’ which does nothing much, but clearly for entity sensors with a unit of measurement, the state value must always be numeric, so a more refined template would deal with availability and so on.

I think the solution to almost any “my sensor does not have the right value / settings” problem is to create a new template sensor!

Don’t add the device class to your Utility Meter. That is not supported. The only valid options are listed in the documentation here: Utility Meter - Home Assistant

You add the correct device class to the source mqtt sensor.

mqtt:
  sensor:
    # Used to track how much water was added as a function of how long poolfiller was detected wet
    - name: MTQ Pool filler last run gallons
      unique_id: mtq_pool_filler_last_run_gallons
      device_class: water  ### <- HERE
      state_topic: "custom/pool/filler/last_run_gal"
      icon: mdi:beaker
      unit_of_measurement: "gal"
      state_class: measurement

The utility meter then uses this to populate its own device class.

For this to happen you will probably have to delete the utility meter yaml. Restart. Then delete the residual utility meter from Devices & Services → Entities. Then recreate your utility meter and restart again.

Or it may be a FIX ISSUE you can do in Developer Tools → Statistics.