Influxdb2 and HE integration

Hi Everyone,
Has anyone done the HE integration with InfluxDB version 2?
I'm using influxdb 2 to monitor all my energy consumption via Iotawatt sensors and would like to push all my HE information into influxdb as well.
I saw the influx-logger app, but that is for version 1, which differs from version 2.
Any help would be appreciated. Thanks

I have been looking also but from what I have found nothing has been developed for v2.

Maybe a bit overkill if you'd use it just for this, but you can use Node-RED to handle this...pretty basic flows would pick up the power events from your Hubitat devices and dump into Influx. I do all my Influx logging via NR, but I'm still using an Influx 1.x because I'm running it on a RPi that won't run Influx 2.x. The nodes for Influx do support 2.x though.

1 Like

I am doing it via maker API and node-red. You do need some custom functions to transform the data, I am willing to share.

Also, for that logging app, it should actually be pretty easy to convert to influx v2

1 Like

Just in case you're interested I created this Prometheus / VictoriaMetrics exporter, I stopped using Influx as the Prom solutions have a more robust alerting and query language.

Have fun :blush:

1 Like

Thanks I haven't gotten to Prometheus yet, Influx and Grafana have been working great for many years and got the 64 bit version of Influx 2.x running on my pi4's last year and still maintained all my historical data for weather and other sensors. I will take a look to see what is possible with Prometheus.

All my other devices are reporting to the influx, so changing it will be a major rework for me.
I was trying to avoid Node-Red as I don't have any other use case for it at the moment. But I'll look around a little more to see if anyone has developed an app. Otherwise, I have no choice but to consider the Node-Red

I will take a look at the influxDB logging code this week, see how hard it is to convert to influx 2.0

4 Likes

I think you can use the existing logging plugin by creating a DBRP mapping on v2. You can then login using an arbitrary username and a token as the password to invoke the legacy API according to this doc. I will test it out when I get a chance.

2 Likes

@afshin.mashayekhi and @ronv42, I have gotten this to work using the 1.x compatibility API system.

You need to use the influx CLI to set it up.
First you create a bucket in the Influx web interface you want to use.
Then you have to create a DBRP mapping: influx v1 dbrp create | InfluxDB OSS 2.2 Documentation

If you have not setup the CLI with a saved config, you need to include the org and token. You get the bucket ID and operator token from the web admin.

influx v1 dbrp create \
  --bucket-id 12ab34cd56ef \
  --db example-db \
  --rp autogen \
  --default \
  --org example-org \
  --token operator_token

Then you need to create a v1 auth with write access: influx v1 auth create | InfluxDB OSS 2.2 Documentation

influx v1 auth create \
  --write-bucket 00xX00o0X001 \
  --username example-user \
  --org example-org \
  --token operator_token

Once that is done you should be able to fill in the blanks on the logger app and it will be able to connect. It is currently running for me:

3 Likes

Perfect instruction, thank you very much!

1 Like

Thanks for this, I will try when I lam back in town and my main roadblock is CLI access since I am running in a docker container and that lovely command line :slight_smile:

1 Like

Download the Hubitat app