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

1 Like

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:

2 Likes

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

5 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:

4 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

Thank you and sorry for the delay in replying. I managed to get this working today. Really appreciate it.

Iā€™m also running in a docker container, were you ever able to access the cli for your setup? Iā€™m trying to tackle this myself and this is the last piece of my puzzle.

I am able to get the bash prompt and do some commands into InfluxDB as for getting this all working, no yet been swamped with other projects. I would suggest getting Portainer up and running which makes managing containers easier and has a easy way to open command prompt from the browser.

1 Like

Its easier to just NOT use docker, for anything, ever :slight_smile:
Never have used, never plan to, unless I HAVE to for something to work.

2 Likes

For those of us that don't really know what we're doing with most of this stuff, but are good at following instructions (like me :upside_down_face:), sometimes a containerized version makes it possible to get various things going (because there happens to be a great set of instructions available for starting a docker instance) or, when we screw something up during setup, start over from scratch without having messed with the underlying OS's network settings/filesystem etc.

1 Like

To each their own. Docker has it's use case and portability and swapability when moving services from device to device. You just have to learn a bit more but once you have it down containers are very powerful. I am at a conference right now on Kubernetes, docker, and application management and most and yes most deployments we are going to seeing with major services are gong to be containers. There are 300 open source projects represented here all demonstrating the advantages.

Now there are still core applications that need and should stay on the OS level but things are evolving very fast.

1 Like

Oh I tried to use containers, everything now seems to point you that way. Started reading some of the instructions, sounded way more complicated than it needs to be for me. Docker, Compose, Portainer, Kuberwhatever, Ngnix proxy, etc.... I have revisited it a few times but I usually don't make it past overviewing the instructions before I say nope and just install it directly.

I installed Docker on a windows server once, and maybe ran a container and was like ok now what.... Then just installed the app directly on windows much faster and easier, then deleted Docker. Granted the app did not set itself up fully on windows, I had to set it up as a service, etc... but still less complicated than Docker IMO.

Maybe if there were some solid instructions not written by some moron blogger just trying to get clicks on his site it would be less complicated.

@inetjnky FYI doing a little poking, the influx site has instructions for how to get at the shell prompt using docker: Install InfluxDB | InfluxDB OSS 2.4 Documentation

Speaking of which, even these well written instructions from Influx are more complicated for Docker than a regular Linux install. Just seems like workarounds to something not designed for this purpose, port forwarding, setting up special stuff to keep persistent data outside the container, etc... The one thing that is interesting is I believe if you restart the container it will automatically use the current version depending on your version tag? Could be nice, but could also be terrible.

3 Likes

LOL. That was my position for years. I finally had to give in for a few things. One of the things is Influx, which I run in a container on my NAS.

2 Likes