Incorrect kWh from Shelly EM after migrating to MariaDB

Hi Everyone,

I have Shelly EM, 1 phase for few months now and the measurements were recorded to the default SQLite database.
The Shelly started from 0 kWh and reached 866 kWh so far.

Yesterday I’ve migrated to MariaDB and restored the data from the old database using the following guide: Migrating home assistant database from sqlite to mariadb.. ONLY if you are VERY familiar with Database administration - #112 by ihr

What happened after that is the Shelly reported first measurement as the 866 kWh that screwed up the Energy dashboard:

It shows that I have returned 731 kWh which is actually the 866 minus the real consumption of about 135 kWh so far this month. (can’t paste 2nd image as a new user)

The history of the sensor shows a graph that starts on 3rd August and it starts at 755 kWh.
(can’t paste 3rd image as a new user)

Is there any way to fix this without resetting the Shelly to start from 0?

Thanks and regards,
LJ

1 Like

Go to developer tools, statistics and find your Shelly there. At the very right side of corresponsing line you will find ‘ramp’ icon. From there you can search for insorrect statistic data and correct them to reasonable values.

2 Likes

Thanks a mill for such a quick (and accurate!) response.
This has fixed the issue and now, everything is back to normal: