Node-RED nodes for hubitat

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!

3 Likes

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.

4 Likes

Or just add initialize capability and do it in initialize().

2 Likes

Even easier...

1 Like

Works perfectly!!

Screen Shot 2021-01-30 at 8.50.04 AM

5 Likes

Okay, should have the full hub object here. Haven't tested the subscription to the hub restart but the code is there...

https://raw.githubusercontent.com/thebearmay/hubitat/main/hubInfo.groovy

5 Likes

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... :pray:t3:

3 Likes

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

1 Like

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... :astonished:


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.

1 Like

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.

5 Likes

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
http://raspberrypi.local:1880/hubitat/webhook

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.

Thanks

** 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!!! :slight_smile:

5 Likes

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

3 Likes

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! :astonished:

1 Like

How about just http://ipaddress:1880/hubitat/webhook. it works for me? Mine looks like this?

http://192.168.1.???:1880/hubitat/webhook_

Yes using the IP works fine... :+1:

Download the Hubitat app