I just published a new integration that implements a history editor that is able to edit state history, short-term and long-term statistics.
With this, you’ll be able to correct those pesky wrong readings from that sensor that keep spoiling your graphs, repair your energy dashboard stats and bulk-correct wrong spikes.
Deleting values from short-term or long-term statistics doesn’t actually deletes the stats rows, but “neutralizes” them, copying the value from the previously existing statistics.
But… Here be dragons! You’ll be able to modify the database directly, so you can easily break things if you start doing things carelessly.
You can install it from HACS following the instructions at https://github.com/davefx/dfx-ha-history-editor
Note that I have implemented this with the help of GitHub Copilot and Claude AIs (as I, software engineer, have done with much of the code that I’ve been implementing in the last weeks). But these are not the happy results of a single binge-coding session. I’ve invested some time into the integration: the project includes unitary and integration tests to ensure nothing breaks. Also, after feedback, I’ve added a few safeguards to avoid potentially doing things wrong.