Yesterday, we proceeded to the installation of the broker Mosquitto MQTT on Raspberry Pi. An easy installation which, as we explained to you, will allow us to go further in the daily use of our home automation software. Whether it is Home Assistant, Jeedom, Domoticz or even Homey, another tool can be particularly interesting: Node-RED. So we will in turn install Node-RED on Raspberry Pi.
Node-RED, what is it?
Concretely, Node-RED uses a method of graphic programming based on flows allowing program without code, or almost. This is because it uses predefined blocks of code called « node » - node in French - which it suffices to link together to constitute a program. It therefore allows you to very quickly create functional applications, whether or not you are a developer, using simple flows.
“To sum up, you put knots, you tie them together, and voila! "
Like the Homey Flows, the creation of flows Node-RED is very easy, not to say childish, since it is done in drag & drop (drag and drop in French). In short, you put knots, you link them together, and voila! Those who have knowledge of code will obviously be able to go further, but those who do not will still be able to do a number of very interesting things… We will of course come back to this.
Installer Node-RED on Raspberry Pi OS
As you have followed with the greatest attention our previous tutorials of automation DIY, we will assume that you have already installed Raspberry Pi OS, ex-Raspbian, on your nano-computer.
If this is not already the case, we invite you to consult the dedicated tutorial:
We are going to use a simple terminal under Windows 10. You can obviously do the same under macOS or Linux.
Press Windows + R and type cmd in the command prompt.
In the terminal, enter:
ssh [email protected] (replace the Xs with the IP of your Raspberry Pi)
To start the installation of Node-RED and its dependencies, just use this little script available on GitHub:
bash <(curl -sL https://raw.githubusercontent.com/node-red / linux-installers / master / deb / update-nodejs-and-nodered)
Validate with the enter key and answer "yes" with "y" to all the questions:
When finished, you should see this:
Use Node-RED on Raspberry Pi OS
Let's launch now Node-RED:
Before discovering its interface, since we are going to use Node-RED in home automation, we want it to launch automatically when we start our Raspberry Pi.
To do this, we need this command:
sudo systemctl enable nodered.service
To connect to Node-RED with a browser
Phew, we're done with our terminal and we're now going to use a graphical interface with our favorite browser:
192.168.XX.XXX:1880 (IP of your Raspberry Pi)