Add support for InfluxDB Cloud (URL and Token configuration parameters)

With InfluxDB in the Cloud having a free 30 day retention plan, it would be nice if the InfluxDB integration supported the URL and Token configuration parameters so we could point it at a cloud instance.

For simple monitoring, the free plan could be very useful to avoid stressing our microSDs:
Writes: 5MB/5 minutes
Queries: 300MB/5 minutes
Data Retention: 30 days
I support the feature request!

1 Like

Came to feature requests to post the same, looks like its already out there. Would like to see this as well.

[EDIT] There was more to this post before but it was wrong so I deleted it. I thought InfluxDB 1.8 only worked with the new 2.0 python client but that’s incorrect, it works with both python clients. Its just cloud that’s difficult since cloud is running InfluxDB 2.0.

1 Like

just a follow up question: influxdb 2.0 support is included, and the documentation

even mentions the cloud setup. however, I just cannot get it to work. Logs only say generic

* Cannot connect to InfluxDB due to '<urllib3.connection.HTTPConnection object at 0x7f6cc0c6d0>: Failed to establish a new connection: [Errno -3] Try again'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible. Retrying in 60 seconds.

which doesn’t really help me pinpoint the problem. I’m just wondering if some of the config is already outdated for 2.0? HA docu says no default port and in the 2.0 config example says 9999. however, the python influxdb-client switched the default port to 8086 a short while ago. Also ‘organization’ in the documentation says it’s the part of the influxdb cloud url, whereas the python code examples from influxdb 2.0 cloud say it’s your email address.
Could anyone using it post a working influxdb 2.0 cloud config here? Thanks a lot!

1 Like

hey @joanwa - I think I’ve had some luck with this.
I mimicked the steps at Use Chronograf with InfluxDB Cloud | InfluxDB Cloud Documentation :

  • Selected “InfluxDB v2Auth”
  • Used cloud address for the provider I selected at setup (GCP Iowa in my case)
  • Used my full username (email address) as Org
  • Generated a token and pasted it in
  • Left telegraf db as default, left retention policy blank, set as default connection
    And it looks like the connection completed! Granted, I just set up InfluxDB in HA so now I need to figure out how to get the data flowing…
1 Like

yeah, me too. issue was the https:// in the influxdb url. Should not be included!

1 Like

The following configuration in configuration.yaml worked for me:

influxdb:
  api_version: 2
  ssl: true
  host: europe-west1-1.gcp.cloud2.influxdata.com
  token: API_TOKEN
  organization: ACCOUNTNAME
  bucket: BUCKET_ID
  tags:
    source: HA
  tags_attributes:
    - friendly_name
  default_measurement: units

I added a default telegraph configuration via the InfluxDB cloud webinterface before generating the API_TOKEN.

How did you configure HA to retrieve data from Influxdb?
I have a cloud influx database that I want to import into a dashboard in HA.

I posted a question about this but no luck so far Reading data from external source: influxdb

Configuration yaml file is a bit tricky if you follow the documentation.
For those who want to connect to InfluxDB Cloud you must not specify the port (if you didn’t change it). As @mikekregel says in his configuration.yaml the only relevant parameters are:

  api_version: 2
  ssl: true
  host: <region>.cloud2.influxdata.com
  token: API_TOKEN
  organization: ORGANIZAION_ID
  bucket: BUCKET_ID

recall that we don’t add https:// because we are using API version 2