Hi !
I have a similar problem of “wrong data” showed in the energy dashboard. Due to a WiFi problem the data of my smart meter was not received by HA for about 50h.
As a result I have an invalid spike for the day the smart meter data became available again for HA. And due to the scaling for the wrong values the valid data is not visible.
I’v tried to fix that by looking into the statistic data for both input values (power import/export).
But for both I can not see any invalid values. But during that 50h gap the dialog box show “No statistics found for this period.” and before or after the gap all values seems to be valid.
It turned out that in the MariaDB tables of statistics and statistics_short_term the sum field was coruppted. The sum value after the measurement gap jumps to a negative value!
After I fixed that the spike is gone.
The scaling has still some issues due to the lack of data during the measurement gap, but is now much more better than before the correction:
I used the GUI DBeaver for that. But you need to read some small intros / tutorials about the basics. Otherwise you could easily destroy your DB . Therefore always make a backup of your DB !
to get a rough overview about the steps:
stop HA to prevent any write access to the DB while editing
find the ID of your statistics of interests in table statistics_meta - in my case the total energy counter to (56) and from (55) the power grid