Want long history data for only one entity

I’ve done a bunch of reading on this but still can’t quite wrap my head around whether this is workable or not.
I’ve been using the default SQLite DB for some time now and it has been working fine. The size is only about 280MB, so reasonable in size and no problem there. I didn’t even know until recently that the retention days is only 10 days. So, since I didn’t notice, that part is fine too.
I do however want to keep history for one entity for years/indefinitely. This is my home value data from Redfin. I want the data for my house value history chart to never purge.
Can this be accomplished? In my reading it doesn’t sound like MariaDB has the ability to set different purge criteria for different entities either. So my other thought is to have 2 databases with different purge criteria. In my reading I saw someone mention they do this, but there was no explanation how it was done. Can I add MariaDB and have just one entity write to it and leave everything else on SQLite? I don’t really want to install MariaDB unless I know this is going to work.

You might want to explore the use of the Long-term Statistics feature which was introduced in 2021.08.0 and expanded to support a broader variety of sensors in 2021.9.0.

The data is still stored in the SQLite database but is excluded from periodic purging.

1 Like

If that isn’t what you want (it likely is tho) you could also run influxdb for any long term data storage needs.

1 Like

I read about that option, but I got the impression that, with Influxdb, I would have to use Grafana to graph it. This is not really a direction I want to go for such a trivial want. Thanks!

true…

Did some research on long-term statistics and found this statement:

“The state_class property must be set to measurement, and the device_class must not be either of energy, gas, or monetary.”

So I set the Redfin entity to measurement and monetary. Is that all there is to it? Now I wait 10+ days to see if the data purges or not for the Redfin entity. Thanks!

Edit. Oops, I just reread that and it says NOT monetary. Hmm.