Node-RED nodes for hubitat

More of a Node Red Question for all but I am now trying to use all of the imported information into a dashboard but I can't find a dashboard node appropriate for Motion Sensors. I know I could use a switch and change the icons but hoped there was a better way. Suggestions?

New version 0.0.14
Warning: it will break the configuration node. All you need to do is to re-enter your application ID (alias API ID). Sorry it's @JasonJoel fault :smile:

Changes:

  • Rename the API ID to Application ID
  • Improve documentation
  • Allow to overwrite command/arguments with the message input

I've updated the first post according to @danfox52 comment

Nice, it will be a pleasure to add your contribution !! :smile:

I still have not try to switch the button to receive location events :sweat_smile:

3 Likes

The PR's submitted for the "mode node". It works for me, but obviously further testing is warranted.

Assuming it gets committed, you'll want to be sure you have the "Include location events to be sent by POST?" option selected in your Maker API app.

1 Like

Is anyone using this with NodeRED in a HASSIO plugin (Docker) ?

It seems I can't get the maker API to send POST events to this, or rather this to receive them (but I can control HE devices from it). It retrieves all the device info so the Maker API is working but not the post.

URL to send device events to by POST
http://192.168.1.50:1880/hubitat/webhook

I think I see in the Maker API log that they are being sent

device event: {"name":"contact","value":"open","displayName":"KWHR Down","deviceId":"3886","descriptionText":"KWHR Down was opened","unit":null,"data":null}

I almost never see any debug events in NodeRED just occasionally the one below but no state change events/

17/02/2020, 23:26:27[node: 27db0cd3.a9c7d4](http://192.168.1.50:1880/#)msg : string[36]
"Error stopping node: Close timed out"

Any thoughts ? I had to remove SSL and password authentication from NodeRED which I think I've done.

Update: I think this is a Docker / hassio issue as I have installed another NodeRED on a pi and that works... the docker image has host network option I believe.

Hi all,

I've tinkered briefly on this and have a few questions, as I'm not sure what I've done wrong. as I'm quite new with Node-Red, please bear with me :laughing:

  1. Should this be ticked or unticked?

  2. I've put together a simple flow, but this is all I'm getting on the msg.payload and/or complete msg. I was hoping to see more info like state on or off etc.

Thanks guys

@fblackburn

Thanks for the update, overriding command and arguments via message properties works nicely. FYI my test flow is replicating a groovy app to control ambient light intensity by manipulating a set of dimmer levels.

I’m curious about why/when to utilize nodered (and its visual message-based programming paradigm) vs groovy procedural code executing on the hub. So as a learning exercise I’m rebuilding some apps I wrote in groovy, and some of the more complex rules in RM.

Complete Node-RED neophyte here. I just installed v1.0.3 on my Odroid XU4 and plan to look up some tutorials to create simple/generic flows before tackling my goal of using @fblackburn's Node-RED nodes for Hubitat automations.

Any suggestions on suitable tutorials?

Many thanks!

P.S. Node-RED starts up ok, so we got that far this morning :laughing:

1 Like

You might find this link useful...

2 Likes

There is no right/wrong answer to that question. As you don't ever HAVE to use node-red at all.

But some benefits could include:

  1. Reducing load on Hubitat hub
  2. Integrating with cloud or other LAN/WAN based systems that either don't have a Hubitat integration, or bog down the Hubitat hub. I have a number of examples of this - really anything that needs to periodically poll an external web interface (Roku TV, Sony TV, etc).
  3. Anything that requires an always listening UDP port integration, since Hubitat doesn't support that at all.
  4. Implement logic without writing a whole groovy app in Hubitat. Not everyone wants/is capable of writing a well formed groovy app, but almost anyone can drag/drop nodes onto a flow sheet.
  5. Very easy to clone flows compared to cloning RM rules
  6. Very easy to backup node-red flows for disaster recovery
  7. My Node-Red install executes logic MUCH faster than my Hubitat hub (I have tested various calculation and automation scenarios, have the data to prove it). But my node-red instance is running on full fledged server hardware - so I would expect it to be faster. I still think that is a fair comparison, though, as I would run Hubitat on server grade hardware if that were an option, too - but it is not. It was their decision to limit what hardware it runs on - not mine...
  8. Hardware independent. I can move my node-red instance to new hardware at will, and not break anything (as long as I don't change IP address.... :smile:).

After months of Hubitat hub issues, reboots, slow downs I've moved almost all logic off of Hubitat and onto external systems - some in Node-Red, some in Home Assistant.

For things that are very time sensitive - aka a few hundred milliseconds matter - I do it in a groovy app in hubitat.

Everything else I implement outside of the Hubitat hub.

In my not-too-far-fetched-future I see using zigbee2mqtt and zwave2mqtt as my I/O inputs, and node-red (or other appropriate calculation engine) as the logic solver. And maybe a dash of Home Asisstant thrown in for the cloud integrations it does better than node-red. All open source, mostly hardware agnostic. But I digress.

6 Likes

I have a second hub. When I access the devices in Node-RED through the primary hub (via HubConnect) they work OK. But if I install the second hub into node-RED, I can't access them directly. The devices show up, but they don't seem to communicate. Has anyone had luck using 2 hubs connected directly? I'd like to eventually do away with HubConnect.

I'm using it to access devices on multiple hubs with no issue. These are native devices on each hub though, not virtual devices created via HubConnect. Do you have your Node-RED endpoint URL set correctly in both Maker API apps?

Yes. The devices show up, I just can't use them.

Understood; I'm going through a learning process about where there is an advantage to extending the Hubitat platform through integration (externally) vs. utilizing the on-platform capabilities. I've spent a lot of time in the industrial automation space, designing, delivering, and operating large-scale distributed systems. So I'm trying to get a feel for when one might want to introduce some of those patterns of distribution of functions, I/O, compute, etc. across network nodes (in the home automation context).

And thanks for the list of where you have made choices and why; very informative.

I'm tending to think about this in a similar manner, but not to the point where the HE dissolves away. Today, the Hubitat platform gives me a very consistent and usable device interaction model, abstracting out the native differences between zigbee, zwave, Lutron devices, ...and so on. The platform also provide a nice API, enabling interaction with that device model and the events they emit, enabling a more 'distributed' approach to the overall scope of home automation, if I choose to do so.

I'm pleased with the HE product today, and the fact that the Hubitat team has given us the choice to integrate via the product's MakerAPI. I've seen a bunch of examples in the industrial automation world of a product strategy of intentional vendor lock-in, and the omission of a viable open integration point to third-party systems.

Not sure if you saw this, here is a list of some example flows and a list of nodes.
https://flows.nodered.org/

1 Like

Commands seem to work fine on 2nd hub. The only device (actuator) I've tried so far to use is a button. In 2nd hub, where it's native, I get no response. But in the 1st hub, via Hub Connect, it works.

Hello,

One another advantage to play with node-red and hubitat (with this plugin) is now easy to control your dock lock with your google home. And it's fully synchro.

Is anyone using the device node with NodeRED in a Docker container ? Does the POST status message from HE to NR arrive OK ?

@JasonJoel You mentioned that in the other thread I started (that needs to be locked in favor of this one) that you could send a payload message to command node but I only see option of choosing command in a dropdown within node. How would I set it up to allow another node to determine what command is performed? I must be missing something simple.

From version 0.0.14 -

I'm not in front of the computer, but typically you would Add a msg."parameter" to the incoming msg. With parameter being the variable you are overriding.

Setting msg.command and/or msg.arguments before the command node in the flow worked for me. I also set the data type of the command property to ‘string’, and for integer arguments to ‘number’.