Table of Contents
Node Red first steps.
Let's see how to perform a small test with Node RedChapter by chapter we will complicate it, but first we will take some basic first steps, so that you become familiar with this system.
If you don't have it installed yet Node Red Home Assistant Here we'll explain to you how to do it.
Node Red Home Assistant
First of all we have to know that a “FLOW” and a “NODE”
Flow It is the work area where we are going to create all our maneuvers.
Right next to “Deploy” is the Node Red, where we will be able to configure appearance, import and export our Flows and Manage Palette section where we will be able to find different integrations created by developers.
Node It is the container of the entity and the maneuver that we want to perform.
Node Red first steps.
For example, we are going to create a timer for a light bulb, how would we do it?
First we place a node that tells us the state the light bulb is in, we will use a node called EVENTS: STATE.
Then we double click on the Node and its properties will appear.
Now let's see what information to fill in.
- Name: name we want to give to the entity.
- Server: we have to select Home Assistant.
- Entity ID: the entity that we want to control or monitor.
- If State: “IS” and “OFF” this says that if the kitchen LED is off the node does not continue, the automation stops, the moment the light turns on the process begins.
- And we press DONE.
Every time a node is created or modified we have to click the DEPLOY button, this does not check if there is an error in our node.
Once saved, the node appears like this:
It tells us that you are now connected and ready to continue.
For example, let's do a test to see if it communicates properly. Node Red Home Assistant, we turn on the light that we have assigned to the node, in this case Kitchen Led.
We can see that it is On, which means that it communicates perfectly.
Let's continue, let's add another Node called StopTimer, it is found in the list of nodes called Function, we take it and drop it on the Flow screen.
We assign the time that we want the light bulb to be on, click twice on the node and its properties will appear.
In the timer option we put the seconds, it can also be hours, minutes or milliseconds, it can be selected in the drop-down menu, we click Done and Deploy to confirm it.
Now we link the two nodes to begin the maneuver, this is done by clicking at the exit of the node and an arrow will appear that you must release at the entrance of the next one, a picture is worth a thousand words.
Now we are going to tell the Kitchen Led to turn off after 5 seconds, to do this we look for another Node called “Call Service” found in the nodes section of Home Assistant and we move them to our Flow and again we enter its properties.
The data to be filled in is like that of the first node that we have added, but here we also see the “Service” option, if you click on its drop-down menu you will see some of its options, but we are left with Turn_off, which is what we want to turn off the light bulb, click Done and Deploy as always and link the Timer node with the Call Service.
and with this we now have our automation finished, it is very basic, but it is a first contact with Node Red first steps and their characteristics, the most important thing is that you dealt with the nodes, since it is fun, in future tutorials, we will see how to add a presence sensor that activates a light and a time programmer for irrigation or lighting.
Leave us your comment or doubts, you can also contribute your Flow Node Red Home Assistant to be able to share it with us.
Thank you and see you soon.
node red first steps.