Home Assistant long-term storage: do you need any?

We sell hosted storage, so start with the part that costs us money to admit: Home Assistant already keeps an hourly minimum, maximum and mean of your sensors forever, for free, on your own machine. A great many people asking this question need nothing at all.

This page is the decision tree. There are three specific cases where the built-in answer genuinely runs out, and if you are not in one of them you should close this tab and keep your money.

Last updated

What Home Assistant already does

Two separate mechanisms, and confusing them is the source of most of the panic.

MechanismWhat it keepsFor how long
RecorderEvery state change, at full detail10 days by default (purge_keep_days)
Long-term statisticsHourly minimum, maximum and mean; growth for metered sensorsNever purged

Home Assistant's own documentation is explicit about the second one: the long-term statistics table is never purged, because an hourly summary is only 24 rows a day per entity. That is genuinely forever, on your hardware, at no cost.

The three cases where it runs out

1. The entity has no state_class

Long-term statistics only cover sensors whose state_class is measurement, total or total_increasing. Everything else gets recorder history and nothing more — so it disappears after ten days.

This bites more often than people expect. Helper entities cannot have a state_class at all, and integrations ship sensors without one often enough that it is a recurring bug report. Check in Developer Tools → States: if the attribute is not there, that sensor has a ten-day memory.

Tag Historian does not care about state_class. It stores whatever numeric state it is sent.

2. You need full resolution older than the recorder window

Hourly min/max/mean is the right shape for trends and the wrong shape for incidents. “What exactly did the pressure do in the ninety seconds before the pump tripped, three months ago?” is not an hourly question, and no amount of statistics will answer it.

The free fix first: raise purge_keep_days. It costs nothing but disk.

configuration.yaml
recorder:
  purge_keep_days: 30
  # Everything not listed here is still purged after 30 days.
  # This grows the database. Watch the disk.

This works, and it works right up until the database is large enough to be a problem in its own right — which, on an SD card, arrives sooner than anyone expects. If your answer to “how big will it get?” is a shrug, this is a temporary fix.

For reference, Tag Historian keeps full resolution for 14 days on the free plan, 1 year on Pro (€9/month excl. VAT — €11.25 incl. 25% VAT for consumers in Sweden) and 2 years on Business.

3. The history is on the machine that might die

This is the case nobody frames properly, and it is the one that actually costs people years of data.

Your automations and your history live on the same box, on the same card. A corrupted database, a dead SD card, a failed restore that brings the config back but eats the energy dashboard — without a backup that has left the box, every one of those takes the history with it, and the standard advice (“buy an SSD”, “move the database to a NAS”) replaces one machine you own and can lose with another machine you own and can lose.

Home Assistant has a real answer to this, and it is free. Since 2025.1 it takes automatic backups on a schedule, and it can keep them off the machine: Home Assistant Cloud stores the latest one, up to 5 GB, at no extra cost to subscribers, and since 2025.2 Google Drive and OneDrive can hold them too, as can a network share. The history database goes into the backup with everything else, so if backups are on and leave the box, your history does survive the Pi dying.

What a backup does not give you is history you can use anywhere else. It is an archive of your whole Home Assistant, as of the last time it ran: to read the history in it you restore it into a Home Assistant installation, or decrypt it with the key from your backup emergency kit — backups are encrypted by default — then unpack it and open the database file by hand. It is also only as good as the restore — which is one of the failures in the list above.

History that matters to you should not live only on the device that runs your automations. Turn on automatic backups to somewhere off the machine and that is already true, for free. What is left of this case is narrower: history you can still open while the machine that recorded it is dead, without restoring or unpacking a backup to get at it.

If you are in one of those cases, the options

OptionCostSurvives the Pi dying?You operate
Raise purge_keep_daysFreeNot on its ownNothing new — but watch the disk
Home Assistant's automatic backup, stored off the machineFree to Google Drive, OneDrive or a network share; included with Home Assistant CloudYes, as of the last backupNothing new — but the history is readable only after a restore or an unpack
InfluxDB, TimescaleDB or VictoriaMetrics on another box you ownFree software; the box is yoursOnly if the box is elsewhere and backed upA database, its upgrades, its backups
Hosted time-series service, free tierFreeYesNothing — but see the retention limits below
Tag Historian€0 for 5 tags, €9/month excl. VAT (€11.25 for consumers in Sweden) for 50YesNothing

The catch in the free hosted tiers

Both of the obvious hosted free tiers cap the exact thing you came for. Read from each vendor's own page on 2026-10-21:

ServiceFree retentionOther limitsSource
InfluxDB Cloud Serverless, Free Plan30 days5 MB per 5 minutes of writes, 2 bucketsdocs.influxdata.com
Grafana Cloud, Free14 days10k active series per monthgrafana.com/pricing

Fourteen and thirty days. If the problem you are solving is “my history stops after ten days”, a free tier that stops after fourteen has not solved it.

What we are and are not better at

Plainly, because you can check every line of this.

  • Not a differentiator: ten years of hourly summaries. We keep hourly min/max/average/count for ten years on every plan and it is a real feature — but Home Assistant keeps hourly min/max/mean forever, free, locally. Anyone who tells you the ten years is the reason to pay is hoping you have not read the Home Assistant docs.
  • Differentiator: it works without a state_class. Helpers, template sensors, integrations that forgot the attribute — all stored the same way.
  • Differentiator: full resolution, not hourly. 1 year on Pro, 2 years on Business, versus hourly-only past the recorder window.
  • Differentiator: open to query, with nothing to restore. A Home Assistant backup gets your history off the SD card too, and for free — but it is an archive you have to restore or unpack before you can read it, and it is only as recent as the last backup. Ours sits in Azure Sweden Central, open to the app, the API and Grafana whenever you want it, without a restore, with a nightly backup to a geo-redundant vault whose offsite copy sits in the paired Swedish region. Both recovery point objectives are published on where your data lives, including the bad one.
  • Worse: you cannot query it from Home Assistant. This is a one-way copy — your HA charts still come from HA's own database. Ours are in our app and in Grafana: the Infinity data source charts Tag Historian on any Grafana, Grafana Cloud's free tier included (see the Grafana guide). If the panels must live inside a Home Assistant dashboard specifically, a local InfluxDB is still the better fit.
  • Worse: attributes are not stored. Only the numeric state. Getting an attribute in means making it a template sensor, which costs another tag.
  • Worse: it costs money past 5 tags. A local InfluxDB does not.

If you decide to do it

Install the Tag Historian integration through HACS. You pick the entities in a dialog, with your tag quota in view, and that list from the callout above is the whole configuration. It also imports what the recorder already holds, so the days before you installed it come along. Without HACS, Home Assistant's built-in influxdb integration sends to Tag Historian too: a dialog for the connection and a short block of YAML for the entity filter, on the guide to the built-in integration.

Already running an InfluxDB for this, and done with running it? The history you have comes along: leave InfluxDB, keep the history copies it across under the same names before you switch, and ends with a Grafana dashboard by entity.

Common questions

Does Home Assistant delete my history after 10 days?
Partly. The recorder keeps detailed history for 10 days by default (purge_keep_days). But long-term statistics — an hourly minimum, maximum and mean for every sensor with a state_class of measurement, total or total_increasing — are never purged. So the detail goes and the hourly summary stays, locally and for free.
Do I need InfluxDB for Home Assistant long-term data?
Often not. If you only look at hourly trends and your sensors have a state_class, Home Assistant already keeps that forever with no extra software. You need something external if you want full resolution older than the recorder window, if the entity has no state_class (helpers cannot have one), or if you want the history open to query somewhere other than the machine that records it. Merely surviving the machine is something Home Assistant's own automatic backups already do, if you store them off the box.
Which entities do not get long-term statistics?
Any entity without a state_class of measurement, total or total_increasing. Helper entities cannot have one, and integrations sometimes ship sensors without it. Those entities keep only recorder history, which is purged after 10 days by default.
What is the cheapest way to keep Home Assistant history off the SD card?
Cheapest in money is Home Assistant's own automatic backup. Since 2025.1 it runs on a schedule, and it can be kept off the machine — Home Assistant Cloud stores the latest backup, and since 2025.2 Google Drive and OneDrive can hold them too. The history database goes with it, so the history survives the Pi, but only as of the last backup, and reading it means restoring it into a Home Assistant or decrypting and unpacking the archive by hand. For history you can read without either, another machine you already own running InfluxDB, TimescaleDB or VictoriaMetrics is free software, but it keeps the data in your house. Hosted options start free; retention on the free tiers of the big hosted time-series services is 14 to 30 days.

Try it on the free plan

5 tags, 50,000 readings a day, 14 days at full resolution and ten years of hourly summaries. €0, no card.