Energy from Riemann sum integral Device not showing

First of all, I know this must be a common error, but I have tried everything and nothing seems to work.

I have an individual plug that measures W. And I am using “Integration - Riemann sum integral” to obtain the energy consumption in kWh. This is the integration code:

sensor:
  - platform: integration
    source: sensor.fridge_current_consumption
    name: fridge_energy
    unit_prefix: k
    round: 2

I also modified the state_class and device_class with:

homeassistant:
  customize:
    sensor.fridge_energy:
      last_reset: "1970-01-01T00:00:00+00:00"
      state_class: measurement
      device_class: energy

This is the state as read from Developer Tools:

I have added it to Monitor individual devices but I do not get any value back.

And I am sure there is constant consumption in this device.

What else am I missing?

Customize your source sensor (sensor.fridge_current_consumption) with device_class: power

1 Like

Thanks, tired it but same thing…




  customize:
  
    sensor.fridge_current_consumption:
      last_reset: "1970-01-01T00:00:00+00:00"
      state_class: measurement
      device_class: power

    sensor.fridge_energy:
      last_reset: "1970-01-01T00:00:00+00:00"
      state_class: measurement
      device_class: energy

homeassistant:

I waited more than 2 hours and still nothing.

try change remove state_class from customize, just define device_class: energy. but i not sure is it correct. but it work for me

customize:
sensor.fridge_energy:
last_reset: “1970-01-01T00:00:00+00:00”
device_class: energy

1 Like

This worked! Must be a bug!

i also not sure… as there not alot of guide out there on what each state_class do at the backend.

as state_class: measurement are reading, so not sure will the energy will do the adding? to sum.
state_class: total are doing adding of the reading…

I also had the same problem. I fixed it by reading this post but not really sure what made it work. I suspect that adding last_reset had something to do with the energy dashboard picking up on data.

my Riemann attributes looks like this:

state_class: total_increasing
source: sensor.koogeek_dishwasher_power
unit_of_measurement: kWh
icon: mdi:lightning-bolt
friendly_name: EnergyTracker_DishWash
sensor.energytracker_dishwash: null
last_reset: “1970-01-01T00:00:00+00:00”
device_class: energy
unit_prefix: k
round: 2