Recorder short vs long statistics config

I have a quick question. I tuned my recorder so that it provides the best balance between (keeping) data and database growth by including the entities I would like to keep long term (include) and the ones I don’t need long term data for (exclude).

With exclude the entity only has one value (which is expected) so also the graph of the entity shows a horizontal line.

I have some entities I would like to review a bit in these graphs sometimes (what happened that day), but is not needed long term. Ideally I would want them stored in the short term statistics dat get purged after several days, but not in the long term statistics.

So I was wondering if it is possible in configuration.yaml in the recorder config to diverse include/exclude for long and short term statistics seperately. Did some searching but couldn’t find clear info about if the seperation could be done (and if so, how).

I use the standard SQLite database (no external one or something).

Ps. Now I’m at it another thing I questioned myself… I suppose determening the record interval (some more and some less than the standard 5 min) on an entity is not possible, or is it.

No you don’t, that was 6 paragraphs. :rofl:

No, there is no user control over individual entity retention. There is one purge setting for all entities.

Long term statistics are never deleted.

Short term statistics and state data are purged after your keep days setting.

You could set up your recorder to purge state and short term stats data after one day and rely on LTS for hourly average, minimum and maximum (or total and sum for non total state class) for looking at data further back in time. If you are happy to drop to that lover hourly that resolution.

It depends on the integration but mostly no. There is also this How to set a custom scan_interval I would only do it for very chatty entities.

Also this add-on was released the other day. It makes it easy to see what the most talkative entities in your database are: Dbstats - Addon for database usage analytics

@tom_l beat me to it, and pretty much covered it all better than I would have.

Still, I’ll put in a shameless plug for my FR to allow recorder retention periods by entity, which is basically what the OP is asking for.

I know it’s a long shot that it’ll ever happen, but hope springs eternal.

Both thank you for the replies and links. @tom_l the custom scan interval can be usefull indeed, and @CaptTom voted :wink: