InfluxDB is a time-series database — a database optimised for storing data points that are indexed by timestamp. Where a relational database stores rows of structured records, InfluxDB stores measurements over time: temperature at 14:32:01, power consumption at 14:32:02, humidity at 14:32:03. This makes it exceptionally efficient at storing, querying, and aggregating the kind of continuous sensor data that a Home Assistant installation generates — hundreds of entity state changes per hour, every hour, indefinitely.
Home Assistant includes its own built-in recorder, which stores entity history in a local SQLite database. The recorder works well for short-term history — the last 10 days of data visible in the History panel — but it’s not designed for long-term retention or complex analytical queries. SQLite grows large quickly with many entities, query performance degrades over time, and the database schema isn’t optimised for the kinds of aggregations — hourly averages, daily totals, rolling minimums and maximums — that make sensor data useful for analysis. InfluxDB solves all three problems: it stores data efficiently for years without performance degradation, its query language is purpose-built for time-series aggregations, and it retains data indefinitely at configurable resolution.
Home Assistant connects to InfluxDB through the official InfluxDB integration, which runs as a Home Assistant add-on for local InfluxDB instances or connects to a remote server. Once configured, the integration writes every entity state change to InfluxDB in real time — in parallel with the built-in recorder, not instead of it. You choose which entities to include, the polling interval for continuous sensors, and whether to use InfluxDB v1 or v2. The data lands in InfluxDB tagged by entity ID, domain, and friendly name, making it immediately queryable from Grafana or any other tool that supports InfluxDB as a data source.
Pro Tip: Exclude high-frequency entities to manage database size
Not all Home Assistant entities are worth storing in InfluxDB. Binary sensors that change state hundreds of times per day — motion sensors, door sensors in busy areas — generate large volumes of data with limited analytical value. Configure the InfluxDB integration’s include/exclude list to write only the entities you actually query: energy meters, temperature sensors, climate entities, and weather data. This keeps the database compact and queries fast without losing any meaningful history.
InfluxDB is available in two versions with different architectures. InfluxDB v1 uses a SQL-like query language called InfluxQL and stores data in databases and measurements — familiar concepts for anyone with database experience. InfluxDB v2 introduces a new query language called Flux, a more powerful but steeper learning curve, and a redesigned data model based on buckets and organisations. Both versions are supported by the Home Assistant integration and by Grafana. For new installations, v2 is the current standard; for users already running v1, there is no pressing reason to migrate.
🏠 Fun Fact: InfluxDB was created by Paul Dix in 2013 after he became frustrated with trying to use relational databases to store time-series monitoring data at scale. The core insight was that time-series data has fundamentally different access patterns from relational data — it’s almost always written in chronological order and queried by time range — and that a database designed around those patterns could be orders of magnitude more efficient than a general-purpose relational database for the same workload.