Node-RED nodes for hubitat

I'm new to hubitat nodes, but from what I see you use the device node for the state change, then you need to use a switch node for open/close.

Another great feature to add would be the ability to define the state in the device node. So you could define the state as "on" and then you'd have 2 outputs on the node 1 for true and 1 for false. Basically a built-in switch node

No but you can use the function node to send multiple messages and/or split node to do the job

1 Like

So essentially
var device1 { deviceId:"917" };
var device2 { deviceId: "923" };
var device3 { deviceId: "945" };
return [ device1, device2, device3 ]

Yep agreed, It was what I would like to do at the beginning (something similar to node-red-contrib-smartthing), but adding node by type (or capabilities) would leave me with a potential of 93 nodes to write

It's why I started with some generic nodes to fit with all devices. Hubitat can have so much devices and driver possibilities, that's very hard to make specific for everything.

Technically, specific node like switch would require some new feature on Maker API too to be nice (you can see discussion here)

1 Like

Well, I might be in the minority, but I vote for no feature bloat.

If there are already standard nodes for the functionality (like a switch), then it shouldn't be duplicated in a contrib node.

7 Likes

Me too.

2 Likes

You could use a "Split" node for this:

Node-RED split

[{"id":"67647d88.654744","type":"tab","label":"Split Message","disabled":false,"info":""},{"id":"1a2bae99.735971","type":"split","z":"67647d88.654744","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":430,"y":200,"wires":[["9a6496e0.9efd58"]]},{"id":"f88d6cb6.3c04c","type":"inject","z":"67647d88.654744","name":"Device IDs","topic":"","payload":"736,837,373","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":200,"wires":[["1a2bae99.735971"]]},{"id":"9a6496e0.9efd58","type":"debug","z":"67647d88.654744","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":610,"y":200,"wires":[]}]
2 Likes

I agree too... Other nodes can handle the details!!!

1 Like

There has to be something better than the throttle timer setup I am using here. I have a periodic message that restarts the timer, if I don't do the throttle and the http request is still bad.

Yay. New docker/k3s (haven't decided yet) cluster coming. New toys. yay.

You'll appreciate this @aaiyar , new ODROID-H2+

https://www.hardkernel.com/shop/odroid-h2plus/

I may need to go to SBC anonymous... 13 RPIs, 3 AtomicPi, and a couple NUC... Now a couple of odroid-h2+ (16GB ram, nvme storage)... Don't tell the mrs.

But I do have something in mind with all of these... muhahaha

This is what I am doing using a subflow (I have more than one hub) - doesn't reboot but alerts me when a hub is non-responsive. Probably needs some tweaking.. but seems to work.

Have several properties defined for the subflow:
SERVERNAME, INTERVAL_SECS, URL, TIMEOUT_MS

Note: the switch node tests for msg.statusCode == 200, also the rbe node filters on statusCode as well.

1 Like

I saw that. BTW - my Qotom was supposed to arrive two weeks ago, it still hasn't. Tagging @erktrek as well. Was thinking about getting that H2+ earlier today, especially because it has dual gigabit ethernet ports. But 1) Ameridroid is out of stock already, and 2) I really dislike the case options.

1 Like

That looks great!!! Arghh I just got the N2... make it stop!!!!

:rofl:

1 Like

not sure how you are getting status code when I am getting this in the http:request payload:

<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/images/favicon.ico><title>Hubitat Diagnostic Tool</title><link href=/js/app.js rel=preload as=script><link href=/js/chunk-vendors.js rel=preload as=script></head><body><noscript><strong>We're sorry but updatetool doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.js></script><script src=/js/app.js></script></body></html>

I'm just requesting the main page not the diagnostic page.

Am I crazy, or do buttons not work properly

You would need to explain more. I've used buttons on node-red dashboards and they worked as documented.

Or are you talking about buttons in Hubitat don't show up correctly in node-red? Or other?

This is great! With this info I was able to take this mess

And compress it down to this

My OCD is satisfied :smiley:

4 Likes

Nice! What did the function node code end up looking like?

On node red. The device node registering pushed, so if I push again, nothing happens. I’m just trying to make a button toggle my fan on a zwave switch

@JasonJoel @aaiyar