InfluxDB options and differences?

In looking around at the various options for using InfluxDB, I found several different plugins, and I was wondering if they were actually different.. and what the differences are, and what people are using as the “best” approach.

Thoughts? Suggestions?

First thought - do you need influxdb, or is long term statistics good enough?

I actually went through pretty much the same exercise recently, because the old Home Assistant Community Add-on for InfluxDB is deprecated.

The confusing part is that there are actually two separate things involved: the database itself, and the Home Assistant integration that sends data to the database.

The built-in InfluxDB integration is not the database. It’s the Home Assistant side that writes entity data to an InfluxDB instance. You therefore still need an InfluxDB server somewhere.

The old hassio-addons/addon-influxdb basically provided that InfluxDB server as an HA add-on. So the setup was roughly:

Home Assistant
    |
    | InfluxDB integration
    v
 InfluxDB
    |
    v
 Grafana

The various InfluxDB 2/3 projects you found are, as far as I understand it, mostly different ways of running the InfluxDB server inside HA. They don’t replace the HA integration itself. So yes, in those cases you would normally still use the built-in InfluxDB integration to send the data.

I initially considered just moving to one of those newer InfluxDB add-ons, but I wasn’t particularly enthusiastic about moving from one add-on that is becoming obsolete to another community-maintained InfluxDB add-on and hoping it remains maintained.

That’s when I started looking at VictoriaMetrics.

For my use case, VictoriaMetrics turned out to be a very nice alternative.

Instead of using the HA InfluxDB integration, I use the built-in Prometheus integration in Home Assistant:

prometheus:

Home Assistant exposes its entities through a Prometheus-compatible endpoint, and VictoriaMetrics scrapes that endpoint and stores the data.

So my setup is now:

Home Assistant
    |
    | Prometheus exporter
    v
VictoriaMetrics
    |
    | Prometheus API
    v
Grafana

And the nice part is that I don’t need a separate Prometheus server. VictoriaMetrics can do the scraping and storage itself.

I initially wondered about that too: normally you’d expect a Prometheus collector/server in between. In this setup VictoriaMetrics effectively fills that role.

For example, one of my HA sensors shows up in VictoriaMetrics as:

homeassistant_sensor_temperature_celsius{
entity=“sensor.brink_renovent_temperature_from_indoors”
}

Other entities get appropriate metric names, e.g. power, humidity, CO2, etc.

The one thing that is not a drop-in replacement is the Grafana side.

My old dashboards were using InfluxQL, for example:

SELECT mean("value")
FROM "sensor"
WHERE ...

With VictoriaMetrics I have to use PromQL instead.

So I did have to convert my existing Grafana dashboards.

However, that turned out to be much easier than I expected. I’ve now converted several dashboards for my WTW/ventilation, indoor climate, airco, Synology and TP-Link Deco setup, and everything is working nicely.

I also decided not to migrate my old InfluxDB history. I simply started collecting new data in VictoriaMetrics and rebuilt the dashboards. I’m keeping the old InfluxDB around temporarily as a fallback, but once I’m happy with the new setup I’ll remove it.

So if I were starting from scratch today, for my particular use case I’d probably go with:

Home Assistant
      |
      | built-in Prometheus integration
      v
VictoriaMetrics
      |
      | Prometheus datasource
      v
Grafana

Rather than installing another InfluxDB add-on.

That said, if you specifically want InfluxDB, the built-in HA InfluxDB integration is still perfectly valid — just remember that it’s the client/exporter, not the database itself.

And yes, I would consider VictoriaMetrics a very good replacement for what I was using InfluxDB for. The biggest migration job is simply converting the Grafana queries from InfluxQL to PromQL.

One small warning though: there are multiple VictoriaMetrics HA projects/add-ons around. I initially looked at the older VictoriaMetrics-Community/homeassistant-addon-victoriametrics, but I ended up using the newer VictoriaMetrics Home Assistant App. So make sure you don’t accidentally mix documentation for the older add-on with the newer App.

For me, the move has actually been a very positive one so far. :+1:

fair question… so I have currently almost 9000 enabled entities, and yes, I know that many of them don’t actually need long term data storage (in fact a number probably don’t need to be enabled at all), but I haven’t had the time to figure it out.

I have already gotten complaints from my backup that it can’t backup the database since it’s too large.

So, I’m assuming that it’s probably beyond what makes sense to try to push through a sqlite db file.

One challenge that I have (I think) is that I don’t think that I am able to setup different data retention plans for different data types… so I have some data that I want to keep for years to compare how they change, others I might keep for a month to see how it’s changing in mid-term, and still others a week or two for troubleshooting, and others just for a day(ish) so it’s available for automations or whatever. as far as I could tell, I can setup what to keep for short term, and what for long term, and how long, long term is. but if I keep everything for years, it bloats the database pretty quickly.

What I’d really like to see is a much more complex storage engine, where I could have short term, mid-term, long term, and archival storage, with rules for each based on the data types, integration sources, etc… and potentially even things like the state of sensors (if something is not working, keep the data for longer, if it’s working fine, dump it quickly.) with the ability to set different database engines for each, and the ability to buffer data to the longer storage if it’s offline.

I’m not holding my breath on something like that though, it’s a pretty complex engine even for true enterprise level applications, much less a open-source home focused app. (And honestly, I’d probably prioritize other things myself over that level of engine myself. Though per-entitiy retention setting does seem much more do-able.)

OK, I only found one repo for VictoriaMetrica for HA: VictoriaMetrics-Community/homeassistant-addon-victoriametrics: VictoriaMetrics Add-on for Home Assistant OS which looks like what you noted as the older add-on, I could not find the newer VictoriaMetrics Home Assistant App. (I assume I’m just not looking in the right places though ).

There has been alot of confusion about the InfluxDB3 version. There are three enterprise license ttypes for InfluxDB3, they are:

Trial,
At-Home, and
Commercial licenses.

What At-Home actually limits

InfluxData’s current official license comparison is unusually clear:

Trial At-Home Commercial
CPU limit 256 cores 2 cores Per contract
Expiration 30 days Never Per contract
Multi-node Yes No Yes
Commercial use No No Yes
Other Enterprise features Yes Yes Yes

All other InfluxDB 3 Enterprise features are available to all licenses.”**

So the current At-Home license is not a functionally stripped-down database. The meaningful restrictions are:

  1. 2 CPU cores maximum.
  2. Single node only.
  3. Non-commercial/home/hobby use only.
  4. One licensed deployment plus one backup copy under the At-Home license terms.

It does not expire.

I currently have a single-node Home Assistant installation receiving only a few lines per second, with 30-day retention, and Grafana queries. We’re nowhere remotely near a 256-core workload.

In fact, given the memory consumption problem I am already trying to contain (I have HA on a VM running on a Raspberry PI 5 8GB!), the two-core restriction isn’t necessarily awful for this installation. It bounds the amount of CPU parallelism InfluxDB can throw at the machine.

My At Home license retains InfluxDB 3 Enterprise, including its historical-query capabilities. Enterprise also includes the processing engine/Python plugins, and the At-Home license isn’t documented as disabling them.

My normal things remain available:

Grafana, SQL, InfluxQL, v1-compatible writes, retention periods, historical queries, Explorer, plugins/triggers, and the Enterprise storage engine.

For example, Enterprise supports up to 100 databases and by default up to 10,000 tables across them. Those aren’t special Trial-only allowances!

Ah yes, you’re right — I made that part more confusing than it needed to be. :slightly_smiling_face:

The repo you found is indeed the VictoriaMetrics add-on:

What I am using is the VictoriaMetrics App from the Home Assistant Community Apps repository. It is listed there simply as VictoriaMetrics:

So you won’t find it as a separate VictoriaMetrics-Community repository.

In Home Assistant, I added the Home Assistant Community Apps repository and then installed VictoriaMetrics from the App Store. The version I currently have installed is 0.1.0.

One important correction to my previous post: I shouldn’t have called the VictoriaMetrics-Community/homeassistant-addon-victoriametrics project the “older” or deprecated one. It is still an active project. The distinction is really that there are now different HA App/Add-on implementations available.

The one I used is the Community Apps version, and for me it has been working very nicely together with HA’s built-in Prometheus integration and Grafana.

So if you go to Settings → Apps → App Store and search for VictoriaMetrics, that’s the one I’m referring to.

This whole kerfuffle has motivated me to try Victoria Metrics again.

However, the older addon/app stores data in an odd place, so unless you are careful about backup configs the db would not be included in backups.

The new addon/app probably does this correctly as frenck built it, but it’s fresh enough that I’m not interested in messing with it yet.

That being said, I’ve moved Victoria Metrics off to its own, separate Docker installation, fully separate from HA. I have other backup mechanisms in place. I think the separation of concerns is nicer, too - I don’t need HA managing this.

You can keep using influx-like pushing if you’re interested but I’ve always been irritated by it. The Prometheus model is much more familiar to me from work contexts so I’m also switching to that model.

Please note, the only bug I could find with InfluxDB3 which was minor and had a workaround anyway, has been fixed - I tested it and proof is below: