Helper changes device class

Hello!
I have a 3-phase water boiler which energy consumption I measure using Shelly 3EM. I am able to measure individual phases in the energy dashboard, but whenever I use a helper to sum the 3 phases together, it gives an error when adding the total-sensor to the energy dashboard:
“Unexpected device class”
I just add the 3 energy values of the 3EM with SUM in the helper section.
I find it hard to find the helper configuration in the yaml files to check or modify the device class.
Anyone else having the same problem?

I also measure my total consumption from the grid using the same 3-phase 3EM. In the energy dashboard, adding the 3 phases separately adds them together and works, but again it’s impossible to add a “total” energy sum from helper sum-sensor.

Look in Developer Tools → States. What device class is listed for your helper?

If you need to you can change it with Customize.

2 Likes

Thank you tom,
It seems that the summing in the helper is not keeping the device class in the measurement, hence rendering it useless in energy panel. I was able to manually add a class to the summed-up helper- and the unexpected device error is gone. Anyhow, the energy panel is still compaining “last_reset is missing”. Do I need to further modify the helper somehow?

You probably need to add state_class: total_increasing as well.

1 Like

Hi, had the same issue.

Thanks for you both for your hints. It is now running like expected with the following configuration:

homeassistant:
  customize:
    sensor.ENTITYNAME:
      device_class: energy
      state_class: total_increasing
2 Likes

I am trying to do the same for recording the power consumption of my heat pump. The Shelly 3em measures power. Shouldn’t state_class be power, then?

For the energy I am planning on using the Riemann sum.

Yes. For power sensors use the device class power and state class measurement.

1 Like

Thanks, I have EXACTLY the same use case :slight_smile:
I hoped there was another way but ended up with the yaml solution.

Check this feature request: