Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
Node-red is a programming tool for connecting hardware devices, apis, and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire streams together using a wide range of nodes in the palette and deploy them to their runtime with a single click.
The installation
1. Raspberry PI already has built-in Node-Red, which just needs to be upgraded to enable
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Copy the code
2. To enable
sudo systemctl enable nodered.service
Copy the code
3. Stop
node-red-stop
Copy the code
4. View logs
node-red-log
Copy the code
access
Default port 1880
http://{your_pi_ip-address}:1880
Copy the code
The interface display
Integrate into homeassistant
panel_iframe:
nodered:
title: 'Node-Red'
icon: 'mdi:shuffle-variant'
url: 'http://{your_pi_ip-address}:1880/'
Copy the code
After restarting the service, you can find Node-Red in the list on the left
The first simple flow
In the Node-Red interface, nodes with different functions are displayed on the left, including input, output, and network
Here are two nodes for our first demo to get started
This represents an input node and you can double-click to see its Settings
You can set different types here, so we’re going to test with numbers, and you can do whatever you want, and you’re done
Then I’ll introduce the second node
This node is used for debugging, it will just input the output, and output to the debug panel
Then connect as shown below
Then click Deploy. When the deployment is complete, click the button indicated by the arrow and you will see the output in the debug panel
At this point, your first Node-Red tutorial is complete, and you’ll move on to more complex content
For example: how do I send and receive messages using MQTT, how do I add a Homeassistant component, and so on