Keeping data for long term - managing Recorder

Tags: #<Tag:0x00007f328a8c55f0>

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:

recorder:
  auto_purge: true #currently the default
  purge_keep_days: 365
  include:
    entities:
      - 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.