How do I change device class of helper (Riemann sum) so I can use the sensor in Energy Dashboard?

Hi,

I’m trying to add a smart plug with energy meter function to my energy dashboard as an “individual device”.

The smart plug entity has a “power (W)” sensor. I used the Riemann Sum helper to convert this to energy used (kWh).

But when I add this new entity to the energy dashboard, it says it doesn’t have the correct “device class”.

I know how to add/modify the class in yaml, but this entity, because it was created using the “helpers” UI page, does not have a yaml config. Can I change the class somewhere? Or should I delete the helper and create a new sensor from the configuration.yaml to use it in the Energy Dashboard?

Thanks!



I found the problem. Apparently, the “parent” power (W) sensor had to have a “device_class: power” added to it. After that the “child” energy (kWh) sensor, made by the Riemann Sum helper, was accepted in the Energy Dashboard without errors.

2 Likes