I have a template sensor that changes its value - which is a relatively long string extracted from the attributes of some sensor - every few seconds. As a consequence, my home-assistant.db grows large very quickly. As a workaround, I use purge_days: 2 on the recorder component. However, this prevents me from doing long-term monitoring of my other sensors.
So my question is this: is it possible to disable the recorder/history for an individual sensor (or for a specific component) only?
I do not think there is a way to do what you want to do currently with built-in tools.
A good example for this would be the logger component what allows exactly this.
Although it would be nice to have this feature or at least a parameter to tell HA where to store the db file.
i would write a small py to remove the sensor details and the through automation let it run at the end of every day.
you could even make an inifile that contains the entitieid’s from al the sensors you want to purge.
Thanks for the comments. I’ll simply go with the Python script then. For the states table it will be trivial (DELETE FROM states WHERE entity_id = …), but for the events table I will have to parse the event_data field that contains a dictionary.