[RELEASE] Hub Information Driver

I've certainly used this in Influx / Grafana, but as you say, I have primarily made use of the metrics / tags expected....

Haven't played with InfluxDB yet, but if there is something you need added let me know and I'll take a look at what it will take to do it.

1 Like

@sburke781 I imagine that if you use the InfluxDB logger that asks you to implicitly select the devices (by type), you could only use the temperature metric and not the others (mem size, CPU, etc)?

I think Influxdb logger even has a way to specifiy what attributes on a given device to add to influx db. I haven't tried that option though so not sure how functional it is.

You cannot get all of the attributes for this device using influxDB logger. If you already have influxDB setup on another always on machine I would recommend using node-red along with makerAPI.

1 Like

You can use this version to log any attribute from any device without node red or maker api:

This thread has some other good info about influxdb and grafana setups, but this post has the version that I use to log all of the hub info driver attributes.

1 Like

That's what I started doing using your node-red flow. Did you ever share your dashboard on grafana.com ? It's an easy way to import with just an ID.

I'm familiar with dashboard sharing on grafana.com but I haven't posted it there because it contains graphs for both HE and HA. If you want it you can download it from here.

Seems to be some interest in pushing values from the HubInfo device into InfluxDB. Here's my flow for this in NR using InfluxDB 2:

[{"id":"8112958b.db7a28","type":"tab","label":"Hub Info","disabled":false,"info":""},{"id":"b05e72d0.c24b8","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"CPU Percent","server":"d0f39af6.168068","deviceId":"197","attribute":"cpuPct","sendEvent":true,"x":350,"y":160,"wires":[["620892cc.b3f42c"]]},{"id":"579c9349.20514c","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"DB Size","server":"d0f39af6.168068","deviceId":"197","attribute":"dbSize","sendEvent":true,"x":360,"y":220,"wires":[["3ded9673.07060a"]]},{"id":"dfd5bb7c.930d68","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"Temperature","server":"d0f39af6.168068","deviceId":"197","attribute":"temperature","sendEvent":true,"x":350,"y":280,"wires":[["e3465e24.ade06"]]},{"id":"c5d5942a.2d9dc8","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"Free Memory","server":"d0f39af6.168068","deviceId":"197","attribute":"freeMemory","sendEvent":true,"x":350,"y":340,"wires":[["cc5e32fc.a59c8"]]},{"id":"c1189ea.ed57a6","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"CPU 5m Average","server":"d0f39af6.168068","deviceId":"197","attribute":"cpu5Min","sendEvent":true,"x":330,"y":400,"wires":[["59874066.fdae"]]},{"id":"5bd349b5.70b9a8","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"JVM Free Percent","server":"d0f39af6.168068","deviceId":"197","attribute":"jvmFreePct","sendEvent":true,"x":329,"y":580,"wires":[["e941ca5f.24aaf8"]]},{"id":"f6cf550a.f02838","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"JVM Total","server":"d0f39af6.168068","deviceId":"197","attribute":"jvmTotal","sendEvent":true,"x":359,"y":460,"wires":[["8ddbf00e.36c4"]]},{"id":"7d3123e7.3519dc","type":"inject","z":"8112958b.db7a28","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":129,"y":360,"wires":[["c5d5942a.2d9dc8","b05e72d0.c24b8","579c9349.20514c","dfd5bb7c.930d68","c1189ea.ed57a6","5bd349b5.70b9a8","f6cf550a.f02838","a71bc840.e05958"]]},{"id":"530b154c.80a2ac","type":"influxdb out","z":"8112958b.db7a28","influxdb":"4a28246c.07c5ec","name":"","measurement":"","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"ControlCenter","bucket":"hubinfo","x":923,"y":360,"wires":[]},{"id":"620892cc.b3f42c","type":"function","z":"8112958b.db7a28","name":"cpu_pct meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'cpu_pct'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":623,"y":160,"wires":[["530b154c.80a2ac"]]},{"id":"3ded9673.07060a","type":"function","z":"8112958b.db7a28","name":"db_size meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'db_size'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":623,"y":220,"wires":[["530b154c.80a2ac"]]},{"id":"e3465e24.ade06","type":"function","z":"8112958b.db7a28","name":"temp meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'temp'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":633,"y":280,"wires":[["530b154c.80a2ac"]]},{"id":"cc5e32fc.a59c8","type":"function","z":"8112958b.db7a28","name":"mem_free meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'mem_free'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":613,"y":340,"wires":[["530b154c.80a2ac"]]},{"id":"59874066.fdae","type":"function","z":"8112958b.db7a28","name":"cpu_5m_avg meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'cpu_5m_avg'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":613,"y":400,"wires":[["530b154c.80a2ac"]]},{"id":"e941ca5f.24aaf8","type":"function","z":"8112958b.db7a28","name":"jvm_free_pct meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'jvm_free_pct'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":613,"y":580,"wires":[["530b154c.80a2ac"]]},{"id":"8ddbf00e.36c4","type":"function","z":"8112958b.db7a28","name":"jvm_total meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'jvm_total'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":623,"y":460,"wires":[["530b154c.80a2ac"]]},{"id":"a71bc840.e05958","type":"hubitat device","z":"8112958b.db7a28","deviceLabel":"","name":"JVM Free","server":"d0f39af6.168068","deviceId":"197","attribute":"jvmFree","sendEvent":true,"x":359,"y":520,"wires":[["64299177.f804f"]]},{"id":"64299177.f804f","type":"function","z":"8112958b.db7a28","name":"jvm_free meaurement","func":"msg.payload = msg.payload.value\nmsg.measurement = 'jvm_free'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":623,"y":520,"wires":[["530b154c.80a2ac"]]},{"id":"d0f39af6.168068","type":"hubitat config","name":"Hubitat","usetls":false,"host":"192.168.1.29","port":"80","appId":"374","nodeRedServer":"http://192.168.1.93:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false,"colorEnabled":false,"color":"#ace043"},{"id":"4a28246c.07c5ec","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"hubinfo","usetls":false,"tls":"","influxdbVersion":"2.0","url":"http://localhost:8086","rejectUnauthorized":true}]

I haven't even bothered setting up Grafana because the boards in InfluxDB 2 are very good and easier to set up (since you can just explore the DB schema directly).

I wrote this as a response for a question on another thread, but hear this a lot so I added it to the first post of this thread.

7 Likes

v2.3.0 - Adds attributes for Maximum Days that Device States and Events are retained by the hub using the endpoints:

/hub/advanced/maxDeviceStateAgeDays 
/hub/advanced/maxEventAgeDays

If you wish to adjust these settings for your hub(s):

/hub/advanced/maxEventAgeDays/nnn
/hub/advanced/maxDeviceStateAgeDays/nnn

Where nnn is in the range 7..365, inclusive.

Thanks to @nh.schottfam for bringing these endpoints to my attention.

4 Likes

Are they just a 1 off poll or every 5

Set up for a scheduled poll since it can be changed on the fly.

Edit: My apologies for the multiple releases (now at v2.3.2), had to reduce the HTML for the tile to get everything displayed.

1 Like

v2.4.0 now includes the ZWave Firmware Version. Although an endpoint call it is set up to only run at Initialization (hub reboot) or when forced by a preference change.

Thanks to @JasonJoel for the endpoint

3 Likes

Um, Houston, we have a problem. Updated Hub Info driver using HPM, backed up, soft reset, restored backup, hub boots but error. Can’t load device page for hub info device, keeps refreshing hub info device page with garbage.

2.2.7.126 on C-7
Only change was to update hub info from 2.3.2 to 2.4.0. Because device page keeps reloading with garbage, can’t get in and adjust preferences.

Here’s what trying to load the Hub Info device page looks like. Reloads about every second.

The HTML tile on the dashboard shows as:

I’m going to futz around, restore earlier backups, etc.

Change line 153 to false that should keep it from running the zwave code.

I believe I have a repeatable test case.

This causes the crash and burn described above where Hub Info device page cannot be opened:

Start with Hub Info 2.3.2.
Update to 2.4.0 with HPM.
Without opening the updated device, download a backup.
Soft reset
Load the downloaded backup.

Same result if, after updating with HPM, the updated device is opened, preferences are set to get Z Wave version, Configure, then download backup, soft reset, load backup.

Now trying the edit you suggest.

I’ve pushed out 2.4.1 which should catch the over run condition and abort the ZWave information retrieval if it occurs.

Here are some screenshots for you to see while I do the download / reset / reload sequence.

Start with 2.3.2, update to 2.4.1 with HPM. I notice an oddity that, when I throw the preference to update ZWave version attribute, then save preferences, configure, the preference does not stick, but turns off.

Doing the download, soft reset, reload now.

It turns back off after it completes the retrieval as a zwave update requires a reboot so only need to check it on the restart.

You’ve actually got a good zwave return on the screen shot.

1 Like