WTH is it not possible to delete long term statistics for entities using services

I have a temperature sensor that I will occasionally put in another room or outside. For this case I would like to be able to delete all past long term statistics, because they are not relevant anymore.

Calling the recorder.purge_entities service on the entity deletes the short term stats, but not the long term stats.

I’ve always wondered about this, too.

When I delete a device the recorded data stays. I can understand the value of this, but sometimes I dont want data to come back when the device is re-discovered. A simple “and also delete all data associated with device?” toggle when clicking the delete device button from the device page would be very useful!

3 Likes

A simple statistics.purgewould be great. I’ve been wondering why this basic functionality isn’t a thing since they introduced statistics.

Sometimes we just want to start with a fresh batch of data from a given point. Like, remove all stats before January 1, 2022 to start fresh with a new year. I might not really care about data many years old (not an issue yet). And we sometimes have anomalies which need to be purged.

PLEASE!

6 Likes

Second this, I notice I can do some cleanup when I look at the statistics from SQlite Web, I might be able to do this manual and willing to learn but it can be a bit tricky :smiley:

I still struggle with this problem. And I don’t get it to work with SQLite. Is there still no easy solution for this problem?