Purging of Long Term Storage possible?

Hello,

I run HA on a Pi 4 with 32GB SD card. The system has been online for about a year and it’s generally running fine. I wonder about the slowly but constantly growing Long Term Storage, though.

Mine has a lot of data on PV generation, energy consumption, managed wallplugs with power monitoring, car data from my Tesla and more stuff.

I understand data is generally held for 10 days, then a reduced data set gets written to LTS, the original data is purged unless it goes into LTS.

Now, the LTS isn’t that juge, but it seems to me that whatever goes there, is there indefinitely. I wonder what that means to my system over years. Is there a way to purge data that is ie 12 months old?

I don’t have current problems, but I wonder about the future maintenance of the system. HA is an awesome replacement for my old IOBroker, and I plan to use it for years to come. All data is in the standard sqlite database.

No there is no method available to do this and you are worrying needlessly.

Assume your sensor has a state class of measurement. So it keeps an hourly max, min and average. At 64 bits each that’s 4.5kB per day per sensor.

  • Rename entity id
  • Remove integration
  • Remove in Dev Tools > Statistics
  • Add integration again

That will delete all the statistics for the entity, not the last 12 months, as they asked for.