How to reset latest state of energy consumption sensor - SOLVED

I had an issue with energy sensor where at some point value jumped up by approx 500000 kwh. I was able to adjust database values (state and sum) of that sensor but although it’s working well, at the end of the following hour, the sum value is again calculated from the original, high amount. I checked core.restore_state but the energy sensor is not there. Is there any other place where this can be adjusted?
Thanks a lot.

just to conclude on this, I found the solution. If you want to avoid described behaviour, you have to:

stop homeassistant
using sqlite adjust entity datapoints in two tables: statistics and also statistics_short_term
start homeassistant

this worked for me (adjusting both state and sum values)…

hope it will help :slight_smile: