Custom purge days for some entities

I have some templates that I use to calculate power usage over time a device is on. For them I want to have records for half a year, but a lot of the other entities I want to record max a week. Is there anyone who know a way to make that possible?
Or meaby a different approach of calculate power usage with the means of device time on?
Help is greatly appreciated!

1 Like