Node-RED nodes for hubitat

That tab of sequences has been disabled. If you double-click on the tab name, you’ll bring up a dialog box that will include the option to enable or disable that tab.

2 Likes

@aaiyar thanks you so much that did fix it and I look at that but missed it.

1 Like

Incidentally I have a disabled flow called "Trash/Hold" that I move sequences I am replacing or just want to hold on to temporarily into in case I need to bring them back in a hurry.

4 Likes

maybe I am doing something wrong, but I'm getting a strange error that says

msg : string[34]
"[deviceId:2458] undefined deviceId"

I'm trying to pass an argument to a switch, rather than specify it in the node. I'm using numbers 100 and 0 to turn a switch on and off. I have not selected a command in the command node.

It still passes the command and turns the switch on and off, it just throws this error up when it does it.

Flow

'''
[{"id":"e25391e5.432348","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"4bb8dadd.3869dc","type":"hubitat command","z":"e25391e5.432348","deviceLabel":"Patio Rope Lights (CH1)","name":"","server":"319c6842.9a57d8","deviceId":"2458","command":"","commandArgs":"","x":399,"y":136,"wires":[[]]},{"id":"36b6a440.a272d4","type":"inject","z":"e25391e5.432348","name":"","props":[{"p":"arguments","v":"100","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":169,"y":136,"wires":[["4bb8dadd.3869dc"]]},{"id":"319c6842.9a57d8","type":"hubitat config","name":"Hubitat North","usetls":false,"host":"192.168.20.21","port":"80","appId":"1685","nodeRedServer":"http://192.168.20.35:1880/","webhookPath":"/hubitat/webhook_","autoRefresh":true,"useWebsocket":false}]
'''

Could there be something upsteam of the command node that is adding a msg.deviceId property to the message stream? I've had that bite me a dozen times.

I don't think so. the flow I posted is just an inject node and a command node.

How to set an HE global variable using a Node-RED Global Context Variable?

And vice-versa.

Oh I fixed this typo (undefined command instead of undefined deviceId) some days ago (not released), but this message can be triggered if you have an input message without msg.command property

Edit: you can add debug node before the command to see if all messages have command property (maybe there is two messages in a row, with and without this property?)

1 Like

gotcha - so for a switch is it ok to give a value of 100 or 0 and have it turn on and off?

The issue is that I'm mixing hubitat nodes and lutron nodes. Lutron wants msg.payload and the switches are just values of 100 or 0 as opposed to an on/off string. What I want to do is use a single change node to set both the msg.payload and msg.arguments to the same value and then send that to both node types.

The commands for a "switch" are "on" and "off"... Why would you send it 0 and 100?

EDIT: Oh, I see why in your post. sorry.

No, you should add another change node to convert from 0 and 100 to "off" and "on".

because that is the way lutron works, even in hubitat. The hubitat logs will report a 100 or 0 when a lutron switch is flipped on and off.

so, it seems to actually work to send a 100 or a 0. it just throws this error. I just want to make sure this isn't going to break in the future.

I'm just trying to avoid spaghetti.

Hmmmm... I guess @fblackburn will have to chime in. I'm surprised it works at all... I would have said it would not (I actually think it SHOULD NOT, too as I do not like "implied"/"implicit conversion" functionality outside of string<-->number/boolean - but that's another story).

scratch that. it doesn't work. hubitat was syncing my lights and confusing me.

so, i guess that makes this a feature request!

As long as it is an option, I don't care. I don't want the nodes "guessing" what I meant and converting stuff it shouldn't to another format.

Regardless, for now just use another change node to convert 0/100 to off/on. They're free. :slight_smile:

4 Likes

You would need to create a RM GV connector in Hubitat and then expose the connector device to NR. At that point sending values back and forth is easy, but a specific example would depend on the type of connector.

Basically you would use a change node to set "msg.arguments" to "$globalContext("nr_global_variable") using JSONata. Going the other way would use a change node to set "global.nr_global_variable" to the value of the "msg.payload.value" that emanates from the RM GV connector device.

4 Likes

yeah, i’ve been going through things. I withdraw my request.

its pretty easy to just set a msg.command on at the same time i’m setting a msg.payload to 100. i can do it all in a single change node.

thanks

3 Likes

Thank you @aaiyar - you are a star, as always! Much appreciated!

3 Likes

@fblackburn
I think there is something wrong with giving a setColor command using the hex color format. injecting #800080 into an RGBW bulb, I get a hue of 63 and I think it should be 83.

For some reason hubitat scales the hue values from 0-100 instead of 0-360. I don't know if this is the issue, but I get weird results when giving a hex command. If I convert to HSL and scale the hue values, then I can get the colors that I want.

Unless specified otherwise by the driver, Hubitat scales hue from 1-100. As indicated in the other thread by @rakeshg, simply convert 1-360 values to 1-100 before passing them along to a Hubitat color bulb.

1 Like

Download the Hubitat app