Helper: Utility Meter is missing "device_class"

Hi dear community,

I have implemented the AI-on-the-Edge-Project.

The project provides a MQTT-based sensor, which provides the current value of my water meter. (I have used the MQTT auto discovery to include the sensor data into home assistant.)

I then used a helper Utility Meter to create the following:

I have tried to add the utility meter to the energy dashboard, but the helper is not available. I am guessing, this is because of the missing device_class?
If yes, how do I add the device class to the helper?
Is there an easy way to convert the m3 to litres or do I need to set up a template sensor for that?

Any help is very much appreciated,
Chris

Having a similar issuere here - does anyone have an idea how to add “device_class” to a utility meter?

Hi @juskalalie,

I ended up creating my own template sensor for my water meter. I am converting from m3 to L.

# AI on the Edge: ausgelesene Werte von m3 in L umwandeln.
  - sensor:
    - name: "Watermeter in l"
      unique_id: watermeter_in_l
      icon: "mdi:gauge"
      state: "{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}" # Convert 1 m3 => 1000 l
      unit_of_measurement: L
      device_class: water
      state_class: total_increasing
      availability: "{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}"

As the AI-on-the-Edge-Project should provide only increasing values, I was wondering, of “state_class: total_increasing” was correct? I will keep it like this and check in a couple of days, if values are okay in HA.