I totally love the new Energy functionality, but I have one issue: I think I made a wrong configuration and wrong values where captured during a time period. Hence the long time statistic is completely wrong. Is there a way to delete data before a certain date?
I did not find any speciall entities that I could reset.
You have to delete them from Home Assistantās database. That means using a tool that can read/write the database and, using an appropriate SQL command, delete the unwanted records. Home Assistant should be disabled during this procedure to prevent potential database corruption. For details, refer to this post:
Thank you very much for the fast reply! Manged to delete the whole day. I use MySQL and did:
DELETE FROM `statistics` where metadata_id='8' and created BETWEEN '2021-09-10 00:00:00' AND '2021-09-10 23:59:59';
DELETE FROM `statistics` where metadata_id='7' and created BETWEEN '2021-09-10 00:00:00' AND '2021-09-10 23:59:59';
That deleted the faulty entries for from and to grid.
I actually figured out how to correct the consumed kWh for the faulty day. But it actually still shows the faulty values for week,month and year. How can I correct this?
Same issue for me.
Faulty data from entity DB has been corrected (value reduced to normal value), but in the energy monitor, I can still see the wrong amount.
From my side, before knowing that, I renamed my sensor before adding it to energy monitor.
The sensor was new, so it was not. A big deal to loose 1 day of data.
I came to this thread because I had a similar problem: experimental energy meters from when I was setting my Home Asssistant up for the first time which are no longer needed. Maybe it was written after this thread started, but unless Iām missing something the Statistics developer tool has a button for altering historical data and for removing statistics with no associated state: https://[home-assistant]/developer-tools/statistics
This doesnāt seem to help due to the way the energy data aggregates values from the sensors then stores them elsewhere. eg I have values from August where the cost was 100x too large. The developer tools / statistics show me recent data, but donāt allow me to fix the historic energy data. As it doesnāt think thereās anything wrong, I canāt see any options to change data there either.
Ideally Iād want to recalculate the aggregate cost value for the month based on a new cost per kWh from a certain date on.
The problem is, that the statistics table has a column āsumā, that contains the aggregated data at the time having created the row. So this includes the values having later deleted.
One has to modify all later rows, too.
Or there is a way to re-create the update/re-create the/all statistics ā¦ ?
Hi Marco, can you explain what you mean by āthe entityā, please. When I edit that file, it has many entities in it with lots of data for each. Which entity and what is it I should change to ā0.0ā?
Thanks very much,
-Bob
Uhh, long time, I think HA is repopulating the entity that you have mapped in Energy Config from that storage file, meaning you have to find that mapped entity in the file and reset it, but without HA running otherwise it will overwrite the file to save the current state. Afterwards you can cleanup the database. Then start HA again.