Managing database via LTS and recorder

Hey all. I’ve done some database management during the Christmas period and disabled quite some entities by excluding them from the recorder.

However I also discovered (via the DbStats addon) that quite a big part of my database is made up of long term statistics by now. For quite a lot of entities I am actually not to much interested in storing this data forever, it will be noise I will never look at historically. But, I might be interested in more recent data (for example power consumption, cpu usage, etc.).

This lead me to the question. Is there a way to do the following two at the same time for entities that are currently storing LTS:

  • keep an entity active in the recorder (and therefore see recent data available as per Days to keep in the purge settings)
  • disable the entity from keeping LTS

For now I know that I can exclude an entity from the recorder, but this also avoids me from seeing the recent data.

To stop LTS being recorded you just have to set state_class: none for the entity then restart. If the entity was defined in YAML this is easy, delete the state class option from the config and restart. If not you could try manual customisation.

Then use the FIX ISSUE button listed next to the entity in Developer Tools → Statistics to delete the existing LTS.

1 Like