Where do you find the InfluxDB integration? (Writing to external InfluxDB instance)

Hi,

I’m trying to setup HA to write historical data to an external InfluxDB database.

Reading this page:

It seems to imply there’s an InfluxDB integration I can install, that will allow this.

If I go to Configuration, Add-ons, Add-On store, there’s an option to install the InfluxDB Add-On. However, my understanding is this is to run an actual InfluxDB instance on the HomeAssistant machine:

However, if I go to Configuration, Devices and Services, Add Integration, and search for influxdb, nothing shows up?

Does anybody know how to install/add the InfluxDB integration for writing to an external InfluxDB instance?

1 Like

The influxdb integration is not installed via the GUI. You set it up exactly like the the docs say.

What is more the influxdb integration connects HA to influxdb. You still need to install influxdb for the integration to connect to.

If you are using supervised or HAOS there is an addon.

I believe you can install influxDB anywhere and then you need to setup your HA so all the data capture will be sent to influxDB. Then you can see what populate in you influxDB via its browser apps.

I did my influxDB2 on LXC machine and populate all my HA information to that DB. I hope this will clear the informations

You can specify any host. It does not have to be the addon.

Of course, I didn’t mean to imply otherwise.

Sorry, by this…

I thought you were implying it could only connect to the addon.

My apologies.

Thanks to all for help!

OK, so for the benefit of others at home (haha) the Home Assistant InfluxDB integration is installed out of the box already with Home Assistant - there is nothing you need to “install” or add from the store.

You simply need to edit the Home Assistant configuration.yaml file and add a stanza for pointing to your InfluxDB instance. There is an example configuration here.

For me it was this:

influxdb:
  api_version: 2
  ssl: false
  host: <IP address>
  port: 8086
  token: <token>
  organization: <organization> # Note the US spelling
  bucket: home_assistant
  tags_attributes:
    - friendly_name

I created the home_assistant bucket myself beforehand, and generated an API token with read/write access to this bucket.

The docs mention that port is mandatory for 2.x with no default - I thought that was weird, as 2.x does use 8086 by default. Is this a bug, or an omission in docs?

I do have data flowing into InfluxDB now, still working out the schema, and how to query things.

2 Likes

Yup I was wondering the same thing… the documentation for home assistant is a little inconsistent I believe because it has evolved allot over time and obviously the entire documentation does not get refactored as quickly.

If anyone who has any power over these things happens to see this - the documentation website format, layout and content for esphome.io is vastly superior and just some of the best documentation for a project of that size I have ever seen IMO with a menu index system on the left and just more readable etc… Just my two cents :grin:

Yet it is also a bit all over the place, for the same reason that it has been built up over time. In fact the overall use and structure is IMHO lacking in the esphome docs. I kinda know what I am doing with it because I have used it since it was started (with a different name that I no longer remember). But for the prospect of learning as a newbie, I shudder.

I started from scratch on ESPhome a month ago and picked it up starting with the examples - I think that is the key is that the documentation is built around examples like a cookbook on every sensor page, allowed me to get started really easily and now slowly understand more of the how the whole complex system works. But I already had extensive knowledge of CPP / Arduino microcontroller programming so maybe that helped there…

A bit off topic and late but related.

Because the database is getting large, I want to move influxDB from my HA machine to a Docker container in my Synology NAS. I have the docker version set up and it can receive data from HA.

I would like to keep the data I have - about 6 months worth. How do I move my existing influxDB database from my HA machine (Proxmox) to the docker version of influxDB?