New Hubitat to InfluxDB Bridge via MakerAPI+Node [beta]

Hi @johan.elenius,

I did notice a couple of things that were different in my setup. Some of these may have been where I have deviated from the instructions, so don't take all these as something you must do or may have done wrong...

My node red app / module was installed under /home/pi/node_modules/hubitat-maker-to-influxdb/app.js. Again, not sure whether I did something different to produce this outcome, but may be worth double-checking this isn't the case for you as well and may be causing the "cannot find module 'request' " error you were seeing. Looking at your post again, it does appear you were already in the right folder, so it must have existed..... Hmmm....

It's been a while since I set mine up, but I do remember the details for the config files either weren't straight forward or I kept getting them wrong, so there may be something there that is causing your problem. Mine is below, minus the token. I appear to have changed the first "hostname" value to be 0.0.0.0, whereas you have an actual IP address. Perhaps try that? Also, the homeTester was in the example json config file, but I wonder whether it is actually required or just left there as an example of two hubs? Perhaps you could remove it to remove any issues it may cause, given it has the same details?

{
"local_config" : {
"hostname": "0.0.0.0",
"base_port": 8567,
"influxdb_port": 8086,
"influxdb_host": "127.0.0.1",
"influxdb_db_name": "hubitatMaker",
"local_url": "http://192.168.0.29"
},
"hubs" : {
"home": {
"url": "http://192.168.0.8/apps/api/591",
"token": "XXXX",
"locationName": "Home",
"locationId": "0",
"hubId": "0"
}
}
}

The last thing I grappled with were file permissions, more so when I was trying to ensure influxdb, grafana and the node red app were running each time the rpi started up. I ended up hacking around at the owners and permissions on various files, but I'd probably look at this as a last resort.

Let me know if you want me to check anything else out in my setup,
Simon

I don't know what the problem was. I reinstalled everyting on the pi and after that everything was working. Thanks for the help.

1 Like

I am excited about getting this up and running. Thanks for putting this together. Not sure what I am missing but I am having issues getting this set up. I have tried all of the advice above to no avail. Any help would be much appreciated!

Here is my config file:

   `{
        "local_config" : {
                "hostname": "10.0.0.195",
                "base_port": 8567,
                "influxdb_port": 8086,
                "influxdb_host": "10.0.0.195",
                "influxdb_db_name": "hubitatMaker",
                "local_url": "http://10.0.0.195"
        },
        "hubs" : {
                "home": {
                "url": "http://10.0.0.247/apps/api/620",
                "token": "><><><><"
                }
        }
}`

As some others have posted, this is the response that I get when I run node app.js
Config: { local_config: { hostname: '0.0.0.0', base_port: 8567, influxdb_port: 8086, influxdb_host: '127.0.0.1', influxdb_db_name: 'hubitatMaker', local_url: 'http://192.168.7.94', poll_interval: 1800 }, hubs: {} }

Hi, I've been trying to use the InfluxDB Logger app, but I always get an Unauthorized response from InfluxDB (running under Docker on Synology NAS). After some research I have concluded that it is because I am using the latest version of InfluxDB (v2.0) and they have changed the authorization process amongst other things (e.g. buckets instead of databases).
I tried making some mods to the app, but I find Groovy to be somewhat obscure, and had no success (I can, however write data sucessfully to InfluxDB using a Nightingale REST client).
So I have come here.... with some questions....

  1. In your original post - "What you need:" you say "2. An influxdb..... without auth." What does "without auth" mean? Is it something to do with making InfluxDB v2.0 compatible with V 1.x clients?
  2. Perhaps more simply, is your json app compatible with the latest version of InfluxDB? Please say yes :grinning_face_with_smiling_eyes:

If not, I have gotten it to work using node-red as the middle man between HE and Influx 2.0 instead of this script. I plan on doing a write up on it this week some time. I figured if I wanted to try node red anyway might as well use that instead of a separate node program.

You cold always just stay with influxdb 1.8.X. I accidentally upgrade to latest in my docker and was able to go back to the the last 1.8 docker pretty easily.

I've been using hubigraph for some very basic graph imagery - but I'm drooling over the details and features I'm seeing with what you all are doing.
I don't have any rPI laying around free, and it's not my most comfortable environment. I have a relatively powerful server doing media so have installed Influxdb on it but now I'm not really sure how to go forward. Is Node-red a requirement?
What I think Im understanding is:
Hubitat-Influx bridge - MakerAPI pumps the data from the hub to my Influx. Grafana handles taking the displayable content and generates imagery. Where does the NodeRed come in?

I'm no expert, just followed the instructions to install this on my rpi and have been using it for a few years now I think... My understanding is that, unlike more passive control of devices through Maker API, the configuration required for this has Maker API setup to stream device updates via a HTTP Post initiated by the HE hub. The node app is (I assume) providing an HTTP endpoint to receive the stream of events from Maker API, then insert those into InfluxDB, which in the end is just a database, so you need something in between HE and InfluxDB to do that translation.

So in answer to your question, "something" is required, and in this solution Node has been used. Not to say something else couldn't be written to interpret the stream of data, so you may be able to look around for an alternative.

Simon

If you use MakerAPI to push the events out you need something to accept the events and then save them to Influx DB. Node-Red is a popular option, and you can also do a bunch of other stuff with Node-Red. There is also a custom HE app that will log directly to InfluxDB.

Node-RED will work with Apple or Windows as well. I have it running on a RPi and an old MacBook Pro. I don't use Influxdb or Grafana - my data store is MySQL (on the Mac) and I use the native Node-RED dashboard for display. It's not as fancy as Grafana but does what I need it to:

You should consider adding Home Assistant. It has add-ons for InfluxDB, Grafana, Node-Red and so much more.

A few contributors here have posted that when they run app.js they get what looks like an example config.json file output to the console. I've tried to run this on Windows Server and this is what's happening to me.

Here's what I get......

PS C:\Program Files\nodejs\node_modules> node hubitat-maker-to-influxdb\app.js
Config:  {
  local_config: {
    hostname: '0.0.0.0',
    base_port: 8567,
    influxdb_port: 8086,
    influxdb_host: '127.0.0.1',
    influxdb_db_name: 'hubitatMaker',
    local_url: 'http://192.168.7.94',
    poll_interval: 1800
  },
  hubs: {}
}
PS C:\Program Files\nodejs\node_modules>

Anyone got any ideas, or like others do I need to give up and use Node-Red ???

Simon

Is this still maintained / in development?

It's certainly still used....

So it is stable enough and did not required any updates in the last couple of years?

1 Like

Correct

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.