The idea of this page is to present simple example flows or sub flows that solve a particular problem, and that can be used as part of larger projects.
If you have any suggestions then I would be glad to hear them just use the comment form at the bottom of the page.
If you would like to be notified when I add a new flow/project then please sign up for the newsletter
In addition there are much larger and more complex flows that I have create to solve a particular problem which are contained in the projects category and that you may also find useful.
Example Flows
- Set Coloured Text for Dashboard widgets
- Split Message Payload and Display on Gauges
- Simple Keypad for Node-Red Flows
- Display last x Messages
Projects
- Republishing HTTP Data Over MQTT with Node-Red
- MQTT Data Logger -Node-Red
- Monitoring MQTT Brokers – Includes several flows for monitoring MQTT brokers
Set Text Colour Of Text Dashboard Widget
The goal here is to change the text colour in a dashboard text widget but can also be applied to other widgets.
The flow consists of an inject node that send a simple text string and a change node to set payload properties for the colours. continued
Splitting a Message Payload
In this simple project we will look at splitting a simple message payload, and then display the data in a text box and on gauges on a dashboard.
The payload consists of a simple string containing temperature and humidity readings separated by a ampersand (&). continued
Simple Keypad for Node-Red Flows
Download
————
Display last x Messages
Will display the last x messages. x is 10 by default and can be changed in the code.
Flow Diagram
Download
Hi Steve, I have already read a lot of information from you and given my thanks very detailed.
what I would like to do is to convert data via API locally or from the internet to modbus registers which I can then read out in a PLC, I can use modbus IP for this, what I can manage is that I can connect between NodeRed and my PLC via modbus, however, I can’t manage to set up the right registers mainly they are analogue values, temperature, humidity, wind direction, but also generation data from my solar panels. do you have one or more examples 16 and 32 bit how i can make a good modbus register from API data?
Assume that you mean convert decimal 32 for example into a value that the modbus register can understand.Did you see the modbus videos?
They are linked in the tutorial
http://stevesnoderedguide.com/node-red-modbus
let me know if it helps or not.
Rgds
Steve
ok for this example
but with different length, different subjects.
but how can I SPLIT this data in separate data:
ID,TEMP,HUM,BAT
example:
payload
20;0A;wx1;ID=5cf8;TEMP=00e7;HUM=36;
20;7A;wx2;ID=9610;TEMP=00e1;BAT=OK;
20;81;wx3;ID=9421;TEMP=00e6;
Dick
Assume that the data is a string. split on :
using
let data=payload.split(“;”)
you now have an array of elements. You could split each one on = so you finish up with two elements temp and the value for example. then you need to do a string search to get temp,bat etc.
Does that make sense.
Rgds
Steve
Hi Steve. I’m having difficulty getting a PIR sensor to switch on a light. Both are flashed with Tasmota.
I can see the correct topic for the motion sensor being ON or OFF (stat/porch/PIR1).
In Node-Red I have the MQTT Node which subscribes to that topic and debug successfully shows ON or OFF.
I have an MQTT publish Node which is for sending an on or off command to the light switch.
But then I’m really stuck as to what goes in between.
I’m really stumped. Every thing I search for always mentions Home Assistant, and never just Node-Red like I want.
Any advice much appreciated. Thanks.
I have a series of tutorials on node-red and tasmota on my other site
https://stevessmarthomeguide.com/controlling-tasmota-sonoff-switch-node-red/
If you are still stuck after reading those let me know and I will take a look.
Rgds
Steve
Hello Mr.steve I am currently doing my college project I have an deployment error unauthorized due to invalid credentials.Please help to sort out.
Is that when you try to access via a browser or when you start node-red
rgds
steve
Hello Mr. Your blog is good. So i have many question about MQTT. because now i’m making a exam project about mqtt. Could I get have your contact email ?
Hi
You should address them on my other site
http://www.steves-internet-guide.com/
That should answer many of your questions
Rgds
Steve