I’ll often see newcomers in the various Home Assistant and self-hosting communities ask which is better, Home Assistant or Node-RED? My answer to that question is consistent. The two aren’t really comparable. Sure, they overlap in some areas such as automation, but one doesn’t necessarily replace the other. Which one you go for is a matter of preference, the community can’t tell you which you prefer.
Why restrict yourself to working with Home Assistant or Node-RED? Why not go for both? Both are fantastic applications in their own right and in my opinion, Home Assistant and Node-RED are best used together. You’ll find more information on how I use both of these tools further down.
This comparison will mainly focus on how Home Assistant and Node-RED automate smart devices. I won’t be listing every single integration each application has or detailing how you can build a UI using Node-RED.
Advantages of using Home Assistant
Home Assistant has many more integrations than Node-RED. Most of these integrations work “out of the box” and don’t need any separate installation. With Node-RED you’ll need to install multiple nodes to get all of the integrations working. And even then it might not even come close to the range of components Home Assistant supports.
You can create simple or complex automations using YAML or the web-based editor. While the configuration of an automation isn’t as visual as it is with Node-RED, the whole process is becoming more user-friendly with each and every update.
The end-goal for Home Assistant would probably be to be able to configure everything from the UI. I can see a future where there will be little to no YAML code involved in setting up automations. While YAML isn’t difficult to use, it can be intimidating to newcomers. We aren’t quite there yet but with every Home Assistant release, the editor keeps getting better.
As things are you can easily create linear automation flows with triggers, conditions, and simple AND/OR logic functions. Home Assistant automations can get very complex with templating but there is no easy way to use IF/THEN/ELSE operators in automations. Though you can emulate those functions by creating multiple automations.
If you restrict yourself to using Home Assistant for everything you have fewer points of failure. Though Node-RED has a large community behind and thus problems shouldn’t arise, there is always a chance of it failing.
Advantages of Node-RED
In Node-RED you can configure logic operators such as IF/THEN/ELSE, AND/OR, and others. Using Node-RED you can create highly complex and really smart automations with a lot of conditions, forks, and details using the visual editor. Node-RED makes this possible whereas Home Assistant automations would struggle.
As an example, my bedtime flow will turn off the lights, it will switch off a couple of SONOFF switches so the room is in complete darkness, and will then start playing ambient sounds on my Google Home speaker, which will gradually decrease in volume. This automation would have taken up many lines of YAML code but in Node-RED the visual nature of the automation allows me to see everything. For me personally, Node-RED makes setting up complex automations a lot easier.
And then there’s the fact that Node-RED is quite fun to use. For me at least it is. I enjoy setting up my flows much more than writing YAML. I look forward to finding a solution to a problem using nodes in Node-RED.
How I use Home Assistant and Node-RED: The best of both worlds
Home Assistant is the nervous system of my home. Everything is connected to Home Assistant and it monitors the state of each and every connected device. Node-RED is the brains of the operation. It uses Home Assistant as a compatibility layer and controls all automations through it. If a state changes, Home Assistant will be informed of that change and Node-RED will execute commands that are configured for that change in state.
I’ll sometimes use the automation editor in Home Assistant for very simple tasks. A simple automation such as turning off all lights when everyone is sleeping doesn’t need to be set up in Node-RED.
Then there’s the web interface. Home Assistant can easily be used as a dashboard for your smart home. It has a beautiful interface codenamed Lovelace which can be used to observe states and manual control of devices.
What should beginners do?
If you are new to Home Assistant and are running Home Assistant, not Home Assistant Core, installing Node-RED as an add-on is really easy. And I’d suggest you do just. Once installed you can create a few automations in Node-RED and a few using YAML or the editor. That should give you a good feel for each application. Which one you choose for your automations is up to you.