Node Red Experiences

I’ve read a few tutorials and a number of other posts about Node Red. I also have the HassIO addon working and played around with a few basic flows and they seem to work well. Just curious if anyone has any feedback on how they like it, pros/cons, etc. after using it for awhile. I really like the interface and ability to interact with other services, but don’t want to go all in if there are some major limitations, delays, or other issues. I know some of my automations may need to stay in Home Assistant, but I think at least 80% of them could transfer very easily, and even be combined to some extent.

Thanks.

1 Like

I find multiple triggers and conditions more difficult in node red. I’m more comfortable with yaml configuration but have tried to move all “notifications” to node-red

I wrote the tutorial that’s been posted, I went all in and have converted about 95% of my YAML automations to Node-Red. I left a couple of things as YAML but otherwise have been using Node-Red for several months for everything without any issues. It’s been very stable.

Main pros to me is it’s just easier to manage and it’s much, much faster to make and debug automations. I had to watch a few Youtube videos to get the interface and what’s happening with the “msg” but I think it’s pretty intuitive. Once I started converting them I could consolidate a lot of stuff that took multiple YAML automations into simpler logic.

The big con to me is that it’s not really meant to track states. You can declare variables globally within Node-Red but it seems pretty hacky. But this is what Home Assistant is good at, and why they pair well. Any time I need a state, or to perform an action, I just use the Hass nodes. So Hass tracks states and deals with the devices, Node-Red just does the logic.

A few people have commented and said they think automations run slow, but I have not found this to be true (my motion triggered lights seem to respond just as fast as before when they were YAML).

It seems like quite a bit is possible with Node-Red but I have to admit I am no developer, so would love to see other examples. Probably the most interesting thing I have done is log my GPS updates into a MySQL database. I then use a simple python script to read that information and replot it as a custom map using gmplot. So I get a map with: a heat map of the last 6 months of GPS updates, tracks of the last 7 days, and plot a bunch of things with info from Hass (my position, beacons position). ie

Curious @flamingm0e if you can post an example, I find multiple triggers and multiple conditions much easier in Node-Red, there are kind of a lot of ways to do things though.

6 Likes

Would love to hear if anyone has used node-red-dashboard, I haven’t had time to look into:

I also went all in a couple weeks ago. Pretty much the only thing left in HA is push notification button handling. I haven’t messed with the all events node which may allow me to them, but I’m not crazy about a giant spigot that I would have to filter down.

While multi-trigger may be more compact in YAML, it is no more difficult with node-red. I’m also a software developer, so the YAML doesn’t bother me, but I find developing in node-red significantly faster and less error prone. The ability to tweak a automation and load it in 1 second is awesome.

Like others, I use HA for tracking states. I’ve tried saving a few things off in flow variables, but find it to sometimes be problematic and may abandon it and just query HA when needed.

I’m currently having far more problems with HA 0.60 since it hangs and uses 100% cpu, so I’m really close to rolling it back to 0.50 when I had no problems. Node-red runs fine and seems to always work properly if HA feels like working.

Edited for more info…

Thanks for the feedback.

I started migrating some basic light automations over. Things like turning lights on for motion, lights on/off at sunrise, sunset, etc. Basic stuff to get the hang of it all.

I have an automation that runs all day, regardless of time, that just says, if motion is detected in a room and luminance is below X, then turn on the light. How do I do this in Node Red? I can’t find a simple way to evaluate that a HASS state is <X.

Probably super simple and I’m just searching the wrong terms, but any help is appreciated.

What you want is a current state and switch node. The Current state node gets triggered by an incoming message and passes along a new message with a payload set to the state of whatever entity you selected. In the switch you would then add a condition and it only transmits the incoming message out if it passes the test. You can have multiple tests and branch out, hence why it is a switch node.

Thanks. I need to learn up more on the messages and other data passed between nodes and how it all works. I only have a basic understanding.

Side note though, today I actually got this to work using the template node to evaluate the state and pass on or off. Then I used a switch to check for an on. Over complicated I guess, but I learned a few things in the process.

Just started building a simple interface for pool control accessible from dashboard or HA
41 PM

Very humble beginnings!


I decided to use node-red on a seperate pi that’s going to drive a 16 relay board, control them via node-red.

Read temps from my onewire dsb1820 and read pressures, levels, and rs485 in due time.

Have everything working great, but have noticed my CPU usage is a lot higher lately on my RPi. The Hass system monitor routinely reports 1.xx for CPU usage in the 1M, 5M, and 15M values. If I stop Node Red, it will be back down in the .25-.45 within a few minutes. If I restart Node Red, it seems like CPU does go up a little, but not to the same levels.

Anyone else experiencing this?

I have an Intel atom based Ubuntu server and it reports around 5% cpu or less for node red, and it almost always uses less than Hass. Hass has a bug that will cause it to use 100% cpu, but it seems like it was fixed for me by a suggestion to change frontend JavaScript settings.

EDIT: The frontend change didn’t stop the problem, but does seem to make it happen less frequently.

Whats the fix? I have added the javascript line released in the latest versions but not sure how it impacts performance.

Is this node red better?

Interesting, my CPU use went down when I switched my automations to Node-Red. I’m on Hass.io

Very nice, it’s cool to see how others structure their flows.

Here is a zoomed out view of everything I have going based on presence as far as lighting/vacuuming:

Nothing complicated going on here, using the additional stoptimer, timerange, and bigtimer nodes.

5 Likes

Anyone know how to pass data into a “input_number.set_value” service call?

Looking to make something like this work:

{ "entity_id" : "input_number.slider1", "value" : msg.payload }

Exactly like that, what’s not working?

Sorry, ignore me, getting confused which thread I’m reading and didn’t realise this was for node-red.

Use a template node and feed that into the service call node. Note that the output type should be json and that you don’t need msg.xyz for the template, just xyz works.

I believe what you would want would be

{ "data": { "entity_id" : "input_number.slider1", "value" : {{payload}} } }

EDIT: to further add, you can use the function node as well and write in javascript. The template node is probably the best option unless you need to do transformations on the data.

2 Likes

Just made a blog post on this exact topic :slight_smile:

edit: good tip with the template node! I hadn’t thought of that to set the { data { } }

2 Likes