Node-RED nodes for hubitat

The only thing I can find quickly is:

(payload != '') ? payload : $globalContext('currentMode')

again, not on point, but it's syntactically correct ")

Is the dot in

(".hue_variable"),

the error?

1 Like

Thanks guys! In the end, I just used a join node .....

3 Likes

A bit late, but for the Inovelli LEDs, I use the following:

So did you have to build the string?

2 Likes

Yup. And it was so easy using a join node ...... no JSONata or functions needed!

2 Likes

Anyone know if I can use a change node to take a message msg.Varname and msg.Value and set global. {msg.Varname} to msg.Value? I don't see a way to do it with a non-function node.

Not in a change node that I know of but easily done with a function node like this:

global.set(msg.varName, msg.varValue);

return msg;
2 Likes

Thanks!
I ended up with that... It is my first function node, I have been avoiding them...

3 Likes

They are seductive so be careful!!!! :wink:

1 Like

Why have 20 change or switch nodes when you can spend hours compressing them into 1 function node?

2 Likes

I think you can do it in a change node with JSONATA - I use it to increment a global variable like below:

The issue is that you can't dynamically set the variable name ..

You want to be able to take these properties: msg.varName = "MyVariable" and msg.varValue = "variable value"

and turn it into:

global.MyVariable = "variable value"

edit: There might be a way but it is not obvious..

2 Likes

Absolutely agreed with your summary. That's why I chose NR. Also, it just rocks! Why would you want to go back to writing (long) scripts if you can use NR.

I also use uibuilder in NR. It's not for the faint hearted, but like most things once you've set it up and built a page, it's very easy to expand.

I'm so happy there is a Hubitat/NR community!

3 Likes

I know it's not a like-for-like, as I'm not sure how the fibaro-devices node works vs the hubitat node, but I have 200 zwave devices on my 2x HC2, which result in a constant stream of messages in NR, however it still runs like dream.

Any action I initiate in NR happens within miliseconds in the HC2 and I'm running NR on a 7 to 8 year old desktop PC (that was only mid-range when I bought it) and which I use for tonnes of other things: running a file server, running a PBX/SIP server .. typing this message on now.

CPU utlisation on the PC is usually under 1% for the Node-Red service.

2 Likes

That's one of the things that is great about NR - the ability to control the environment. I can add processing power/memory/storage whatever as necessary. Also love the fact that I can do very complex sequences (rules etc) and have very little impact on my HE hubs.

1 Like

Anyone ever seen a music player UI for the Node Red Dashboard?

I'm running node-red along with a whole bunch of other services on an SBC (Odroid N2). All my automations are through NR. The load average is usually pretty low. Here are the cumulative stats currently (NR was restarted approximately 10 days ago):

odroid@odroidn2:~$ ps ax | grep node-red | grep -v grep
15689 ? Sl 1219:07 node-red

So in 10 days of Node-RED uptime, the total CPU time used is approximately 20 hours.

2 Likes

All well and good but it's the peak utilization that really matters as it could hinder anything running on said box. Unfortunately the peak is much harder to determine.

Tried various things (nothing worked) and the function node approach that you suggested is the simplest!

2 Likes

I'll admit, I don't sit there staring at CPU utilisation, but when ever I've check I've never seen it go above 5% on my desktop PC. Maybe once close to 10%, but then it drops back to low single digit %s.

That's my experience anyway.

I didn't mean to imply that it IS a problem only that it could be and it's not easy to measure unless one does stare at utilization.