Hi
I have found that Hassio resets sum for my energy analyse to zero in some days.
It happens some day - unless I fix values using Developer Tools.
I have review MySQL Database and found that on 02:20 (database time) values are recalculated to zero, and graphs so negative large values.
Take look on screen shots
I found corelated event in logs
[core-ssh config]$ less home-assistant.log| grep utility_meter_energy_car_consumption
2022-07-09 04:25:13 INFO (Recorder) [homeassistant.components.sensor.recorder] Compiling initial sum statistics for sensor.utility_meter_energy_car_consumption, zero point set to 31.21
2022-07-11 04:25:16 INFO (Recorder) [homeassistant.components.sensor.recorder] Compiling initial sum statistics for sensor.utility_meter_energy_car_consumption, zero point set to 63.49
Something is causing the sensor the utility meter relies on to go to 0 instead of unavailable. This is usually due to poorly designed template sensors with no availability template.
This may be related to backup - because backups are done at 4 am and Full copy of this MySQL Database took around 3 minutes.
I will stop backup for a week and will see what’s happen.
And you are not alone.
It started a couple of days ago after I’ve added the monitoring with a Shelly 3EM, probably due to the fact that I’ve reconfigured the Energy dashboard.
Have you implemented anything that deletes it regularly ?
Being a solar production, I guess we can safely delete every statistic value that is negative, but I don’t know how to automate it.