Node-RED nodes for hubitat

How's easy is it to transfer? Thinking about moving off of my pi over the holidays.

Not difficult. I just backed up the entire $HOME/.node-red directory and restored it.

2 Likes

Yep, that's all there is to it.

1 Like

Cool, I already stole your script for that.

1 Like

My TrueNas server has a jail -- think VM -- for node-red. Assuming it works, what else would I need to do to get it to work with hubitat?

You should look at your NR log to see why it cannot be initialized.
When your NR start does it have access to the network? HE is up?

There is a fallback mechanism if device node is not initialized. When a new message will be received by NR and forwarded to the device (uninitialized), then this device will try to re-initialized itself before consuming the event

You can also use this mechanism to add a inject node with a delay (e.g. the time the network goes up) connected to your device nodes ...

But a better alternative is to use the systemStart (originally sent when HE goes up) event to resynchronize all hubitat nodes. e.g. Use inject node to trigger an event with HTTP node. ex:
Screenshot from 2020-11-15 15-11-02
Screenshot from 2020-11-15 15-10-27
Screenshot from 2020-11-15 15-10-18

But again, figure out why you have this issue by looking at logs

2 Likes

You would need to install the hubitat nodes. Should be able to go to palette in node-red and install it there.

I think this is where I am. I literally just enabled the jail and found the node red ip number.

That worked. Appreciate it. Can you point me to the configuration instructions?

Configuring the hubitat nodes? 1st post in this thread.

1 Like

Thanks

Okay so I have a crazy request... apologies but thought I'd toss it out there anyway.

In working with multiple hubs and trying to create generic subflows I've run into some difficulties with having to hard code a bunch of things. Wonder if it would be possible to do something like the following:

  • Create a unique "configId" for each Hub config. (there might already be one did not check)

  • Have a msg.configId you could pass to the HE command/device node that would select the proper config to use. Another possibility would be to enhance msg.deviceId to optionally include the configId with the deviceId something like this format:
    "[configId]/[deviceId]".

  • For events node, allow for multiple hub selections or have a separate "configIds" field that allows a comma separated list of configId's. The event node would then respond with events from those selected configs and also return a msg.configId for each generated event message.

It's really not a big deal as I've already created some base hard-coded subflows: "HubGrpEvents", "HubGrpRequest" and "HubGrpCommand" that handle grouping of hubs and hub events.. but it might be nice for longer term maintenance/subflow flexibility.

It's already there. :wink: And the other requests are covered as a result of it. When you edit either a command or device node you can create multiples on the Server field.

That's cool.. how do I do that? Do you mean from the drop down selection?

What I'm looking for is a way to set the hub config for a command or device node via a message property if possible. Kind of like you can do with deviceId as part of the msg inputs.

Yep. In that selection you'll see all the configs you have created and "Add new hubitat config..." which brings up the same config "dialog" you used to create the others. There is probably some limit on how many you can create but I don't know what it is and I'll bet that it's far more than you'll ever need.

EDIT: I have just one HE but I have 2 configs, one for websocket and one for webhook.

I apologize I am not explaining myself properly... I know you can create multiple configs - I have 6 different ones across 4 different hubs..

nr213

What I want to do is be able to inject a message that selects which hub config I use in addition to the device like this..

OR

Wait, are you saying the deviceId is across hubs?? That would be awesome!!!

That means I am over engineering things again... sigh.

NO, and it isn't.

Now that I understand what you are trying to do I'm pretty sure you can't so you're back to a feature request.

1 Like

My purpose in all this is to create device groups in Node-RED similar to HE. For one hub it's fine but if you want to include devices from multiple hubs then it gets tricky.

I actually have this working now but my "base" subflows require me to "hard code" various command, device and request nodes with all the hubs. Would be nice to be able to do it programmatically or via message passing.

Thank you for your responses!

1 Like

Today I received my 7th IoT devices :tada: and you talk to me about dynamic multi-hub configuration ... I think I'm not ready for this conversation :rofl:

5 Likes