Keeping data for long term - managing Recorder

I have some specific entities that I want its date to be to be stored and available in my graphs for over a year. My understanding is that it stores by default 10 days. So I’m looking at the documentation:

I reckoning it would be something like this:

  auto_purge: true #currently the default
  purge_keep_days: 365
      - sensor.humidity_158d0001b91088

Now I have two questions:

  1. Struggling with the include/exclude, that way that I did, will it store for 365 daysonly for that entities and 10 days for the other ones?
  2. Also, according to the documentation it says that the “purge_keep_days” parameter: “Specify the number of history days to keep in recorder database after a purge”. Question is, So we are saying that is gets purged automatically every day but it get stored the number of days? How does that work?

Note: not sure how will this affect performance, I’m using Docker on a Synology NAS, I also have MariaDB already set up in another container if needed.

The recorder is a bad choice for storing long term data. It corrupts easily and will become huge.

Look at influxdb for storing these states instead.


Personally I use recorder with PostgreSQL for short-term data (1week) and InfluxDB for long-term data. I wrote a little guide on how I set it up here in my repo.

I can specify for each database which entities should be included/excluded.


For long term storage i can recommend the homeassistant addon victoriametrics.
It works perfect with Grafana and HomeAssistant and is setup in a few minutes.
Long term sensor data is stored using the least possible amount of diskspace thanx to victoriametrics time series database which outperforms InfluxDB in any way. So you can store all your data forever and you don’t have to fight with retention policies - just use it and have fun with your data.


It seems to me that this might be the solution for my problem described here. Since I have no prior experience fiddling with other databases, is there anything else I should know about before proceeding or is it just a install and reboot kinda thing and everything configures itself for use with i.e apexcharts card and what not? Thanks