Node-RED nodes for hubitat

Thanks for the heads up. Right now, I'm using maddox's harmony-api. It can be controlled via mqtt or http -- I'm using the latter.

I'm switching to the node-red Harmony integration today. I'll restart NR in a few times and let you know how it goes.

1 Like

I have used the Harmony Nodes for 6-8 weeks and haven't noticed the issues @Geoff_T mentions but i only have a few nodes so I could have missed that.

I'm curious if others have created a flow to control your Pico Remotes. I am always looking for easier and more efficient ways to do things (without using Function Nodes) or seeing how others are doing the same thing. Here is one of mine:


This one is a Fast PIco so I don't have held or released as an option. I have a couple of Picos that are not.

1 Like

I ran across this the other day and installed it, i absolutely love that I can now turn on an Apple TV again! The Harmony software has been broken for a while where saying "turn on Apple TV" hasn't done this task since one of the major tvOS updates.. Now using that palette I just send a "Home" press and it does the trick perfectly.

1 Like
4 Likes

Hi @JasonJoel, the thing is, the status of mode itself doesn't actually change. So it's not really a flow related.
I've rebooted by HE a few times, restarted node-red container a few times (which seems to then update the status of the mode).
I've restarted the VM where this node-red container sits in (which obviously updated the mode too when I do this)
this morning, I re-verify the webhooks within node-red, and it updated the mode status. I will see how it goes today and see if it changes to evening.
Will keep you posted! thanks! :+1:

I wanted to post this morning to say subflows ROCK!

Just found out that if you need to reference the parent flow just use:

x = flow.get("$parent.somevar");
flow.set("$parent.somevar",x);

Also have been using subflows for any function nodes that I reuse frequently.

Another cool thing I discovered was asynchronous commands. I am using this to generate new messages from within a function node.

This node (actually in a subflow) is part of my light syncing sequences I'm working on - I create 2 messages from data stored in the (parent) flow object.

// Gen CT Msgs
varName = msg.topic;
dict = flow.get("$parent." + varName);

async function sendCmdMsg(message,cmd,key) {
    message.command = cmd;
    message.arguments = dict[key];
    message.payload = {};
    node.send(message);
    node.done();
}

sendCmdMsg(msg,'setColorTemperature','colorTemperature');
sendCmdMsg(msg,'setLevel','level');

return;
4 Likes

I have been looking into it as I am now building a web of systems (Hubitat, Node Red, MQTT, Homebridge, Homekit, Hue Hub, Tradfri (ikea) hub).

I am not sure how I am going to rationalize all of the parts, but I am very happy with the homebridge-nest v4.4.4 which allows me to get to my Nest Thermostat and Nest Protects without an developer API access that they (Google/Nest) are no longer giving out. This so far is the only way I have found of getting presence sensing from the Nest Protects into Homebridge and from there to Hubitat and/or Node Red.

See My Reply to My Replay for very important caveat

@stephen_nutt can you share that Smartthings Node that you did with the Home Depot remote? Thanks

Sure. Your switch nodes will be different when using ST device. For an HE button device, msg.payload.name is the action performed (pushed, held, released) and the number of button pushed is msg.payload.value. For ST, the action is msg.payload.value and the number of button pushed is msg.payload.button.

[{"id":"e6268590.85bc98","type":"switch","z":"39f59f85.4877f","name":"Pushed","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":220,"wires":[["973d9e7e.eb21f"]]},{"id":"4e5a600b.7da4a","type":"smartthings-node-button","z":"39f59f85.4877f","conf":"a3019d29.f2eee","name":"Ainsley's Bedroom EcoSmart Remote","device":"58ba566b-f4e2-47c9-83c2-2c8f9fb4ec13","x":220,"y":220,"wires":[["e6268590.85bc98"]]},{"id":"973d9e7e.eb21f","type":"switch","z":"39f59f85.4877f","name":"","property":"payload.button","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":570,"y":220,"wires":[["229549f8.c320d6"],["5eb5c5d6.dbdb3c"],["3c345080.ed90f"],["4eb7001d.33af5","ef7863a8.13269"]]},{"id":"229549f8.c320d6","type":"hubitat device","z":"39f59f85.4877f","name":"Ainsleys Fan Bulb","server":"e2175bd0.e82808","deviceId":"681","attribute":"switch","sendEvent":false,"x":830,"y":120,"wires":[["edde2d39.c3b0b"]]},{"id":"5eb5c5d6.dbdb3c","type":"hubitat device","z":"39f59f85.4877f","name":"Ainsleys Lamp","server":"e2175bd0.e82808","deviceId":"852","attribute":"switch","sendEvent":false,"x":820,"y":220,"wires":[["555514c.6e076ec"]]},{"id":"3c345080.ed90f","type":"hubitat device","z":"39f59f85.4877f","name":"Ainsleys Night Light","server":"e2175bd0.e82808","deviceId":"851","attribute":"switch","sendEvent":false,"x":830,"y":340,"wires":[["ae73c68e.4329a8"]]},{"id":"edde2d39.c3b0b","type":"switch","z":"39f59f85.4877f","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1020,"y":120,"wires":[["a97be8b3.67ab88"],["d94d9c5d.9448"]]},{"id":"555514c.6e076ec","type":"switch","z":"39f59f85.4877f","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":220,"wires":[["1e8d6e4.bb4b692"],["3e8697cd.08dba8"]]},{"id":"ae73c68e.4329a8","type":"switch","z":"39f59f85.4877f","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":340,"wires":[["66e242b3.b155fc"],["c87dc920.69e318"]]},{"id":"a97be8b3.67ab88","type":"hubitat command","z":"39f59f85.4877f","name":"OFF","server":"e2175bd0.e82808","deviceId":"681","command":"off","commandArgs":"","x":1190,"y":80,"wires":[[]]},{"id":"d94d9c5d.9448","type":"hubitat command","z":"39f59f85.4877f","name":"ON","server":"e2175bd0.e82808","deviceId":"681","command":"on","commandArgs":"","x":1190,"y":140,"wires":[[]]},{"id":"1e8d6e4.bb4b692","type":"hubitat command","z":"39f59f85.4877f","name":"OFF","server":"e2175bd0.e82808","deviceId":"852","command":"off","commandArgs":"","x":1190,"y":200,"wires":[[]]},{"id":"3e8697cd.08dba8","type":"hubitat command","z":"39f59f85.4877f","name":"ON","server":"e2175bd0.e82808","deviceId":"852","command":"on","commandArgs":"","x":1190,"y":240,"wires":[[]]},{"id":"66e242b3.b155fc","type":"hubitat command","z":"39f59f85.4877f","name":"OFF","server":"e2175bd0.e82808","deviceId":"851","command":"off","commandArgs":"","x":1200,"y":300,"wires":[[]]},{"id":"c87dc920.69e318","type":"hubitat command","z":"39f59f85.4877f","name":"ON","server":"e2175bd0.e82808","deviceId":"851","command":"on","commandArgs":"","x":1200,"y":360,"wires":[[]]},{"id":"4eb7001d.33af5","type":"cast-to-client","z":"39f59f85.4877f","name":"","url":"","contentType":"","message":"Help is needed in Ainsleys Room","language":"en","ip":"192.168.68.105","port":"","volume":"","x":840,"y":440,"wires":[[]]},{"id":"ef7863a8.13269","type":"alexa-remote-routine","z":"39f59f85.4877f","name":"","account":"xxxxd7fb.1e09d8","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"str","value":"Help is needed in Ainsleys Room"},"devices":["G000MW0474520JG4","90F0071863140022"]}},"x":820,"y":500,"wires":[[]]},{"id":"a3019d29.f2eee","type":"smartthings-config","z":"","name":"SmartThings","token":"xxxxxxxx-3b46-4634-a139-d6d792646231"},{"id":"e2175bd0.e82808","type":"hubitat config","z":"","name":"MAIN HUB","usetls":false,"host":"192.168.68.124","port":"80","token":"xxxxxxxx-7a20-45ca-b891-df1f06e45b4f","appId":"383","nodeRedServer":"http://192.168.68.139:1880","webhookPath":"/hubitat/webhook"},{"id":"xxxxxxxx.1e09d8","type":"alexa-remote-account","z":"","name":"","authMethod":"proxy","proxyOwnIp":"192.168.68.139","proxyPort":"3456","cookieFile":"authFile","refreshInterval":"3","alexaServiceHost":"pitangui.amazon.com","amazonPage":"amazon.com","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

You have a node in yellow that cast to ip address what is that? Thanks for the help.

Hi @JasonJoel ,

Mode just changed to Evening about 10 mins ago.
HE shows -->

Node-red is showing --> image
I'm just using that to feed to kick off a flow when it's evening.

now....I've just moved a node (any node), and click on deploy.
As soon as I clicked on deploy, the mode updated to Evening

it looks as if, node-red is not polling from HE.
is this possible? is there a config within HE for this? Thanks

EDITED: FOUND THE CULPRIT!
I forgot to enable this
image :man_facepalming:
Bloody Novice I tell ya!....Thanks @JasonJoel, sorry for this silly trouble.

2 Likes
  1. Make sure that the Maker API POST url in Hubitat is what you have specified in the hubitat node system setup in Node-RED.
    Example:

Hubitat-
image

Node-RED-
image

  1. Make sure that in hubitat Maker API app config you have this enabled:
    image

Those are the only settings for sending events from Hubitat to Node-RED.

Awesome! I'm glad you found it. I expect that will make all the difference!!! :+1:

@stephen_nutt did you have to do anything beside add the device to Smartthings ? I added it but cannot get the buttons to be recognized? Did you have to add some smartapps on something else to the smartthings? Thanks I'm trying to do something that is way outside of my comfort zone?

One thing I forgot because it was a 1 time problem but that is a very important caveat. I found that if when I was configuring the node-red to homebridge connection, when I accidentally put the wrong xxx-xx-xxx code in for the homebridge, it actually would crash my docker instance running code red. Needless to say that was bad. Not sure what it would do to node red or a raspberry pi if running under other configurations.

Once I corrected that, it continues to run without any trouble, but do be extra careful if you go down this path.

node-red-contrib-cast
It allows you to send text to Google Mini device to make it talk.

The issue I had is that the instructions don't tell you that you have to include the port number in the SmartThings app but you do in fact need that. Did you see those posts in this thread from a few days ago?

Once I added that, it started working as designed.

Apparently you have better luck that I have? I see the button push in the smartthings app but dosen't come thru to the Node Red? I have the port number in and the Ecosmart Remote added still no luck. I don't get it you would think that it would be ok. I have a debug node hook to the different nodes and I get no info from them. Thanks

I've gone this way ... adding the "interval length" node in order to determine a short vs long press.

image

Now, my Picos are coming in via HA instead of HE (I run HE for ZB, Wemo and Hue) - but I'd guess the concept is still sound.

[{"id":"ced23230.65b5a","type":"subflow","name":"Pico Tap/Push","info":"If button pressed for less than 1 second that is considered a tap. If for more than 1 second, that is a push.","category":"","in":[{"x":60,"y":140,"wires":[{"id":"ce264680.eb3a98"}]}],"out":[{"x":900,"y":40,"wires":[{"id":"7daeecc8.72b114","port":0}]},{"x":900,"y":80,"wires":[{"id":"7daeecc8.72b114","port":1}]},{"x":900,"y":120,"wires":[{"id":"cc3dae82.d9716","port":0}]},{"x":900,"y":160,"wires":[{"id":"cc3dae82.d9716","port":1}]},{"x":900,"y":200,"wires":[{"id":"480911b6.ca8aa","port":0}]},{"x":900,"y":240,"wires":[{"id":"480911b6.ca8aa","port":1}]}],"env":,"color":"#DDAA99","inputLabels":["Pico Remote"],"outputLabels":["Top Button Tap","Top Button Hold","Middle Button Tap","Middle Button Hold","Bottom Button Tap","Bottom Button Hold"],"icon":"node-red/split.svg"},{"id":"4b20becd.9b3f","type":"switch","z":"ced23230.65b5a","name":"Top/Middle/Bottom","property":"data.old_state.state","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"4","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":430,"y":140,"wires":[["7daeecc8.72b114"],["cc3dae82.d9716"],["480911b6.ca8aa"]]},{"id":"ce264680.eb3a98","type":"interval-length","z":"ced23230.65b5a","format":"mills","bytopic":false,"minimum":"","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":true,"startup":false,"msgField":"duration","timestampField":"timestamp","repeatTimeout":false,"name":"Tap/Push","x":200,"y":140,"wires":[["4b20becd.9b3f"],]},{"id":"cc3dae82.d9716","type":"switch","z":"ced23230.65b5a","name":"Tap/Push","property":"duration","propertyType":"msg","rules":[{"t":"lte","v":"1000","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":140,"wires":[,]},{"id":"7daeecc8.72b114","type":"switch","z":"ced23230.65b5a","name":"Tap/Push","property":"duration","propertyType":"msg","rules":[{"t":"lte","v":"1000","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":60,"wires":[,]},{"id":"480911b6.ca8aa","type":"switch","z":"ced23230.65b5a","name":"Tap/Push","property":"duration","propertyType":"msg","rules":[{"t":"lte","v":"1000","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":220,"wires":[,]}]

I don't think that is an option going thru Hubitat. HE has already decided whether you pushed, held, or released the button. The duration that the button was held is not in the output of the Device Node for the Pico.
image

EDIT: There is a Lutron palette but I haven't used those nodes. They might output button push duration.