Wrong data in energy dashboard


Again another “wrong data in energy dashboard”. I’ve read multiple topics already, all stating the option is to remove erroneous datapoints in the “Dev tools > Statistics” . Odd thing for my issue, I already removed this data (sensor 1), or I don’t see data here (sensor 2). Anyone that can please help with this issue?

I have two sensors which wrongly give negative data:

  1. “myenergi_zappi_18009211_charge_added_session” which is direclty a kWh measure of the energy deliverd to the charge point.
  2. “sensor.enyaq_charging_kwh” which is an integrated value of a kW measure of my car charge point

Both sensor above are redundant, but I made the second one at some point because the first was giving issues.

How can I fix the negative value in my energy dashboard??

Screenshot 2023-07-14 082805
Screenshot 2023-07-14 082744

Keep moving forward in time in the adjust a statistic dialogue box. It’s somewhere between 14:00 and 15:00 by the look of your history graph.

I am currently working on issue #93340 as a university class project. I’m not sure if it fits to this post as the issue is different, please let me know.

I have the problem that values from the individual Energy Chart devices are sometimes displayed incorrectly. On the one hand, if a consumer has not consumed any electricity, this is sometimes indicated with the value -0 kWh and -0.0001 kWh is displayed in the chart.

The other problem is that if a device is unavailable and a new day begins, then the latest value is calculated minus the last value, so that larger negative values are also displayed for devices. It can be ruled out here that the counter is reset by the device when it becomes unavailable, as the value is saved for Tasmota plugs, for example, and the day should also start counting at 0

I’m not sure whether the two problems are related.
What is the best way to debug how these bugs occur in order to fix them? Does anyone have an idea what the problem could be?