Wrong energy from Integral helper

Today I was surprised by energy consumption.
Image above shows recorded power and the consumption.

Could anyone explain this initial jump in energy and wrong final value?

It’s obvious that 3kW during 1 hour results in 3kWh. In my case it should be even less. But it tops to more than 12kWh

I’m using Riemann sum integral with trapezoidal rule if it does matter

Use method: left to minimise errors for that sort of spikey data. See: Integration - Riemann sum integral - Home Assistant

The trapezoidal method should only be used for smoothly varying data.

Thank you I will try it.

In case you expect that your source sensor will provide several subsequent values that are equal, you should opt for the left method to get accurate readings.

Should I understand that it’s not about a high spike but a long-lasting previous value before the spike? If so, it might mean that left method is better in for all devices being turned on and off (lights, ovens, heaters etc) kettles, isn’t it? Shouldn’t be left method default then? Or where the triangle is better?

Yes left should probably be the default.

1 Like