[RELEASE] Hub Information Driver

Thanks!

@thebearmay - I'm starting to replace most of my endpoint calls in Node-RED with Hub Information Driver. Is there a way to "refresh" the info (I don't see a "Refresh" command, only "Initialize")?
EDIT: I have it set to poll every 5 minutes, but in some cases, I want to get the current state.

The config command should force an immediate poll and update all of the attributes selected in preferences.

1 Like

Is there documentation on using this Hub Information Driver? The top posting in this topic has no link to documentation. What do the commands "Configure", "Hia Update", and "Initialize" do, and when would one use each? (I think "Reboot" and "Shutdown" are self-documenting.)

I figured out how to allow my Dashboard to include this device, but there is no Template for it. I can choose the "Temperature" template and it picks out the internal temperature; how do I access the other 40-odd variables in my Dashboard? (I imagine I have to use templates "Variable String" or "Generic" or something, but I can't find documentation on using those either. Someone mentioned creating a 2x2 dashboard tile and selecting the html variable, but I can't find documentation on how to do that.)

Add a tile to a Dashboard. Pick the device in "column A" -- which will be whatever name you gave to the Hub Info device. Then in column B, pick Attribute.

A large list of Attributes will become available... pick one. The Html one piles a bunch of info into one tile. All the rest are single attributes for a single dashboard tile.

You can go wild, with an entire dashboard dedicated to the attributes from Hub Info Driver:
Screen Shot 2022-08-18 at 8.49.33 AM

2 Likes

As @csteele noted above, you'll want to use the Attribute Template on the dashboard and select the attribute you want displayed. The only command really meant for the user is Configure, and you should only need it right after creating the device (although it can be used to force an update outside of the normal polling.) Initialize is used by the hub at start up/reboot to restart things, HIA Update is used by another app (Hub Information Aggregation) to override the normal html attribute to allow information from multiple hubs to be combined, and as you said Reboot and Shutdown are self explanatory.

1 Like

Aha! It's "Attribute" I should use, not "Variable String". Thank you for that. Where is this documented?

Of course I'd like to put more than one Attribute into a Dashboard tile, rather than have a separate tile for each. I presume this isn't possible using the GUI? (Can I write some layout code to do it? Documentation?) At least the "html" attribute has a nice selection of other attributes.

In the absence of separate documentation, your helpful replies might find a useful place edited into the top posting in this topic, so that people such as me can read the documentation instead of bothering everyone here.

Adding font-size:70%; to the <style>td at the start of attrStr in the driver makes the html attribute fit nicely into one 1x1 Dashboard tile (and still be readable).

My hub didn't have the NTP server set. I used the /hub/advanced/ntpServer URL to set it to the domain name of the local NTP server, but is it even used anywhere?

I do need to revisit the first post as the driver has evolved a wee bit since its inception. If you want to customize the html attribute, the Hub Information Aggregation app can be used with just one hub also.

Believe the hub defaults to Google for NTP, and IIRC it will attempt to resync the clock every night around the scheduled back up time, as well as at hub start up.

@csteele ... much thanks for the screenshots to get the attributes shown on the Dashboard. I'm able to get the values to display but not the attribute name at the top of the tile like in your screenshot. Any idea how to display this name?

Upper right corner, gear... Options in the top row, then:

Screen Shot 2022-08-18 at 11.08.38 AM

Stop hiding them :smiley:

@csteele ... that did it, much thanks!

1 Like

Massive understatement.

6 Likes

And what a journey it has been! I think it was back in early 2021 that I was looking for a way to get the Hub Name for one of my Node-RED flows and @thebearmay said he might have a "little piece of code" that may work.. and look at it today.

Thanks for all that you do for the community :pray:t3:

6 Likes

Rather than doing that, I just edited your Hub Information Driver code directly so that the html attribute displays what I want in it.

v2.6.39 adds the capability for custom configuration of the html attribute using a template text file stored in the hub's File Manager. The template file is normal HTML but allows attributes to be inserted by delimiting them with <% %>, i.e. <%cpuPct%>. Activation of this feature requires that Enable HTML Attribute Creation? be turned on, and that a valid file name be entered into Template file for alternate HTML attribute.

Sample Template File:

<style>td{text-align:left;}</style><table id='hubInfoTable'>
<tr><td colspan='2'><%@date%></td></tr>
<tr><td>CPU %</td><td><%cpuPct%></td></tr>
<tr><td>Temperature</td><td><%temperature%></td></tr>
<tr><td>ZW Radio/SDK</td><td><%zwaveVersion%>/<%zwaveSDKVersion%></td></tr>
</table>

would yield an output similar to:

Fri Aug 19 16:05:09 EDT 2022
CPU %	      1.0 %
Temperature	  104.0 °F
ZW Radio/SDK  7.17/7.15

(Remember that you are limited to 1024 characters after substitution)

9 Likes

Woo hoo! This is great! An educational sample template you could post (adding it to the documentation in the first post in this topic) would be the template that gives the same output as the default (no template) output. (Or at least as close as you can get to the default output.)

Nice idea ! for a good while I've been taking a couple of community apps and 'modding' them so they layout correctly in my dashboard (I'm a huge fan of Android Dashboard which I run on a Portrait monitor in my dev workstation - I use Bluestacks as an emulator under win10/11). Each time the app or driver gets an update, I need to go back and repeat the work...

The concept of pushing through a template could alleviate many things - I hope others take your idea and run with it too! Off the top of my head notification tile, gametime and open weathermaps might gain big benefits!

1 Like

Hi all,
Would you be so kind to suggest me under what number should not drop down the freeMemory please? I'd like to create a webcore piston to notify me when freeMemory is on critical number.
Thanks in Advance