Advertisement

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.

Advertisement

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.

Advertisement

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.

Home Assistant automation editor
Advertisement

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.

Advertisement

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

Node-RED is a very powerful and visual node-based tool for visual programming. It is written in JavaScript and can be deployed on a multitude of systems. It is available as a Home Assistant Community Add-on and can be deployed using Docker, which is how I do it. When used in combination with Home Assistant it is mostly used for automations.

Advertisement

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.

A Node-RED flow
Advertisement

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.

Home Assistant dashboard
Advertisement

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.

Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started of with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

1 thought on “Node-RED vs. Home Assistant: Why not use both?”

  1. You can do a lot of this out-of-the-box in Apple’s Siri shortcuts / macOS Automator too.

    And even more powerful, you can also use iPhone/mac events as triggers.

    https://imgur.com/a/Nwalkhf

    I use it in conjunction with Node-Red / Home Assistant and it’s insanely powerful since Apple give you so many automation options. macOS / iOS is an insanely powerful automation system.

    Reply

Leave a comment

Advertisement