I just set this up. It's a simple edit to the settings.js file I recall. Actually the option is already in the file and just needs the commenting to be removed, and presto! Persistent Context Variables!
If I get some time today I’ll flesh that code out some more and see if I can subscribe to the system start event to force it to update automatically.
Or just add initialize capability and do it in initialize().
Okay, should have the full hub object here. Haven't tested the subscription to the hub restart but the code is there...
I will update the driver and check it out. In the meantime, I modified my Nodered HE download/backup flow to now include the FW version.
Thanks so much for this...
Quick question - is there any difference between hubVersion and firmwareVersionString? I'm currently using hubVersion...
No difference I just left it in in case someone had already coded against it. The longer name is the actual hub property name
Really strange - I'm no longer seeing firmwareVersionString in Current States and it is not available in the selection list of attributes in the Nodered device node...
It needs to be added as an attribute in the driver code.
just add a line like this in the driver code by the other attribute lines:
attribute "firmwareVersionString", "string"
OOOPS. Thought I had in there. In now.
It was there when I took a previous screen shot (few posts above) but then it disappeared!
Looks like @thebearmay fixed it now😀
Yeah, if you don’t declare the attribute it sticks around for a little while but then goes away.
I made a small update to the driver this morning to fix a problem where it was grabbing the version number before the hub had updated completely on a restart. Also added some more of the Location object properties.
I've trawled through this lengthy thread and have checked my setup against the gotchas but I can't see what I may have missed.
NodeRed confirms that my starting endpoint is /hubitat/webhook
For two devices that I've shared via MakerAPI, these are initialised.
1 Feb 09:22:13 - [info] [hubitat mode:91ece064.2d241] Initialized. mode: Day
1 Feb 09:22:13 - [info] [hubitat device:bacb9701.1e7d78] Initialized. switch: on
URL to send device events to by POST
The switch above is a simple virtual switch. On initialisation/deployment, it correctly shows the state, in this example "on". If I change the switch state within HE on the virtual device to "off", I was expecting the status to update within NR. It doesn't.
What have I missed? Should there be an "event" that captures this change? Has anyone got a NR example? I've followed the video example (substituting a motion sensor for a switch) but still no joy.
** UPDATE ** Typical.... 5mins after posting the above, I substitute the domain name for an IP address within Maker API and BINGO, it all starts working!!!
If your node-red is available through a domain name (and you have a local DNS) , then you can add a DNS in HE (Settings-> network)
This is what I'm doing for my setup
You'd think raspberrypi.local would work... clearly not. I'm not doing anything fancy network wise... I'll stick to using IP for now - safer!
How about just http://ipaddress:1880/hubitat/webhook. it works for me? Mine looks like this?
Yes using the IP works fine...