An introduction to Node-RED

Node Red IconNode-RED started life as an IBM product designed as a middleware platform intended to wire together connected devices, now commonly referred to as “The Internet of Things” (IOT). Node-RED provides a browser-based editor within which “flows” can be created to connect devices from different manufacturers and often speaking different languages – Node-RED provides the middleware upon which these devices can communicate. Now an open source project hosted on Github, it’s free to download and use with no limitations.

The Node-RED platform is built upon Node.js which itself is a Javascript runtime engine built on top of Google’s incredibly powerful Javascript engine. Put simply, Node-RED is an open source, open standards platform to wire together all your home automation toys – and that’s exactly what I’ve used it for.

The editor itself will be familiar to anybody who has ever used any form of process flow designer tools, such as Microsoft Visio. Connecting devices is as easy as dropping the building blocks (known as “nodes”) onto the page (known as a “flow”) and connecting the nodes together.

Once your flows are wired together how you want them, you deploy them to your server and they become active.

Here’s a very basic flow, one which queries my Sony Bravia Android TV for its power status and posts the response back to my home automation platform (Domoticz) which in turn updates a virtual switch in Domoticz which is then made available to Homebridge, an open source implementation of Apple’s HomeKit platform – with all this hanging together, it’s possible to get and set the power status of the TV using Siri, e.g. “Siri, turn off the TV” gets used a lot in our house!

Simple Node-RED flow to query the power status of a Sony Bravia Android TV

Simple Node-RED flow to query the power status of a Sony Bravia Android TV. The output is also sent to a debug node (the green node at the end) so I can see what’s happening.


Overview of the Node-RED web-based editor and a selection of input nodes. The flow in this screenshot pings my domain controller and updates Domoticz with its status so I know if it disappears off line.


Node-RED switch node

The “switch” node which is used to apply logic to your flows. In this example, it gets the output from the Sony Bravia API call and decides which route to send the flow down based upon the output from the API.