Node-RED nodes for hubitat

It's just the "name" property of the node instance in Node-RED. That's why it might be more of a pain to use.. you might see if @fblackburn would consider having an option to prepend the config name in the name property itself in each hub config instance.

Maybe something like this:


I wonder if you could set the color there as well... this whole idea might be more trouble than it's worth though.

note: edited pic to put desired property on appropriate tab

2 Likes

Automatically adding the hub name in front, as you suggest, would be very helpful if it is possible. The colour change was just an idea but any way of distinguishing easily between different hubs works for me. With the amount of hubs some people have a name prefix might be better as they would soon run out of colour options!

1 Like

The other idea maybe would have it as part of the "status" of a node instance..

nr281

just spitballing here.. :baseball:

3 Likes

The hub name would be way too long for my tastes.

BUT, francois could theorhetically always make a user field for a prefix, default to blank, then those that don't want it don't have to use it. :slight_smile:

Would happen even faster if someone did a PR for it in github.

4 Likes

Oh it's a good request "Be able to distinguish nodes from different configs"
With my limited NR experience, I never saw any palette resolving this issue. If any of you have seen this :raised_back_of_hand:

I like the color idea because it keeps the flow clean. I don't know if it's possible, but should be fun to try :slight_smile:
I like the idea of user field for prefix too, but the only small downside, I fear to visually load flows with the same info duplicate under every node.

I'll add this request to github to track it :+1:

6 Likes

@stephen_nutt: While playing with colors, I found an hidden (or not [documentation]) feature of Node-Red

You can use theme in setting to change node's color:

Update settings.js with these values:

    editorTheme: {
       palette: {
          theme: [ // Override node colours - rules test against category/type by RegExp.
              { category: "hubitat", type: "^hubitat hsm$", color: "#f0f" },
              { category: "hubitat", type: "^hubitat hsm-setter$", color: "#ddd" },
              { category: "hubitat", type: "^hubitat device$", color: "#f8f" }
          ]
        }
    }
}

Now I feel sorry for your flow :sweat_smile:

3 Likes

Interesting! Didn't know that.

2 Likes

My color changing process is working just fine as is my entire system (knock on wood). It's not time to start playing with the settings.js file and bringing down my entire home automation system. :smiley:

3 Likes

:confetti_ball: Crisis averted!!! :confetti_ball:
:rofl:

1 Like

Does anyone know what the circle with the line next to my House Lights mean? All of my flows on that page is not working and has dashes around them? I have about ten pages/sheet of flows with different titles and have two pages that are like this? I look around the net but didn't find anything? Thanks

image

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".

Download the Hubitat app