Customize which statistics to keep

Is there a way to customize how certain devices certain statistics are kept?

For example, I want to keep temp/humidity statistics for 30 days, but want to keep timestamp/last seen from all devices and motion detection events only for 3 days.

Is there a way to do this?


No there is no way to have state data retention set per entity. There is one global setting. All you can do is set that and exclude any entities you don’t want state history recorded for.

In addition LTS (Long Term Statistics) for entities with a device_class are kept for ever. This is 5 minute data until your purge keep_days is met then it is down-sampled to hourly data. So 24 entries per entity per day. It takes up very little room.