Converting kWh from W with platform: integration and getting a glitch in data?

Hi, I configured the energy monitoring with the latest HA release and I have noted some weird bahaviour of excess energy data from my solar panels.

I am calculating my solar power excess in node-red and I bring the data to HA as a mqtt sensor “powerexcess” (as Watts).

powerexcess

Then I have a “platform: integration”, which converts that into kWh:
yamlconfig

For some reason that data looks like this:
energyexcess

I wonder why am I getting a some strange ‘ghost’ data of 2,7kWh during night time and that get’s into the integration data at the time when there is some excess solar production first time in the morning?

You can try the left mode of integration

method string (Optional, default: trapezoidal)

Riemann sum method to be used. Available methods are trapezoidal, left and right.

1 Like

Thanks for the hint. I’ll give it a try.

Changing the mode to left fixed the problem. Thanks again for the solution.