WTH can't we specify the purge_keep_days in Recorder per entity?

I would like the history of some entities I use in graphs (like energy usage, temperature, etc.) to be kept for a whole year, while most of the other entitles I don’t need the history for a whole year.

Right now the purge_keep_days is a setting for all of the entities, it would be great to customize it per entity.

If you like this idea, please up-vote the existing FR, too:

Would be nice to have the option on the devices screen as well so we don’t have to code it in yaml for everything. Open the overview screen for a temp sensor see the option for data retention and then be able to choose between how many days, weeks, months…etc


This would be very useful for me, too. I want to keep the states of for example security relevant sensors a few weeks while I don’t need the temperature from more than 24h ago since I can use long term statistics for that.
I have a lot of sensors which create a lot of states, so I clean the history for these entities every night. But that’s not a good solution since I’d rather always keep the last 24h of history.

i was just thinking it’s weird that in order to capture seasonal variation in temperatures or power usage i also just end up with a creepy amount of location data on my partner and my roommates. As much as i trust myself more than some company, it’d be nice to be able to say that i don’t keep that data.


Just remove location data completely. Why would you need that in the history in the first place.

I mean that’s probably the one I’d keep longer. Not on roommates obviously, that’s not ideal. But I used to like Google’s location history feature other then it being Google, a private version of that is nice.

And even if you don’t want to keep that long term keeping it for at least a few days is really handy for debugging. Assuming you have automations around that.