I'm a beginner and trying to decide whether Node Red will be useful in my project. I have gone through the overview and a few demos on youtube to see how Node Red is used, but I think I don't know enough to understand why Node Red is still useful.
I would appreciate if anyone could help me out here in understanding this!
I think Node Red is a way of connecting multiple things (nodes) together in a 'flow' to work together.
What would a traditional way of doing this be? If let's say a website speaking to a database, you will just write server-side code for the server to execute and return data when it is told, and set up CRON jobs to automate the sending of emails for example. Database connection, cleaning of data, sending and retrieving of data is done on the server side. How would Node Red be useful in this case?
Node-RED is most useful in the following cases in my view:
Rapid Prototyping. When you need to be fast and flexible, Node-RED is great as it lets you manipulate the logic without having to redo large chunks of code.
Limited Programming Knowledge. If your knowledge of programming is limited, again, Node-RED is great because it does a lot of heavy lifting for you. You don't need to worry about how your code will be run. Nor do you need to worry about all the boilerplate code that you normally need for an application.
Flexibility. This is why many of us use it for home automation and is related to the first point. It helps you follow the logic very quickly without having to wade through lots of code. It lets you change round the logic very quickly.
Laziness. It has loads of extensions that make many tasks very easy because someone else already did the hard work for you. Dashboard is a great example. It is so easy to create a data driven user interface that you can do something basic in seconds.
However, it is less useful in some cases too:
As it is a general-purpose tool, it has to cover lots of use-cases and so is quite large compared to something custom written. This may sometimes also limit the message throughput compared to something bespoke.
If you are already a good and experienced programmer, Node-RED may offer you less than other people. You may already be able to produce what you need to very quickly and accurately using straight programme code.
Ah, well therein lies a bit of a problem. For most people (of the genus "non-programmati"), the word just slipped in there would be very wrong.
Ah I can see how useful it can be for home automation, and very interesting points, thank you.
Just to check that I understand this correctly, in the case of home automation, you don't need to know how to write code to allow a connection from one device to another device, because in the case of Node Red, there is probably an extension / node that just allows you to connect them together in the browser?
To be completely open, it isn't so much a "no code" solution as a "very little code" solution. It is reasonably common to have to use a few lines of simple code.
But yes, in general you can do that.
For example, I have flows that listen to a wireless receiver (433MHz) to various wireless sensors and controllers, I use some change nodes an a little code to enhance the data and output to an MQTT broker.
Another flow listens to MQTT for device data and converts it to other formats for different uses and writes that back to MQTT as well as writing to InfluxDB so that I can track historic data.
There is more, of course, but this illustrates the point. Most of those flows are done with no code at all.
The code is generally to allow some of the more detailed conversions or enhancements of data - like adding dewpoint data to data from a temperature/pressure sensor. Even that code can be largely downloaded from the Internet.
I should point out that while I've been a professional programmer in the dim and distant past (COBOL, PL/1 and many other "3GL" and "4GL" languages), I haven't been one of those for decades.
These days, I am mostly an enthusiastic amateur in the best footsteps of my Victorian forebears. Coding at work is largely incidental using PowerShell, VBA, PowerQuery and the like. Useful but not "professional".
My current job title is "Head of Technology & Security".
So, for me, Node-RED really helps me pursue an interesting hobby in my downtime.
While I can certainly write a full Node.JS app, I rarely have the time or inclination to do so.
PS: I always have an eye open for opportunities to use open source at work. So it is perfectly possible that Node-RED will make its way into my workplace as well at some point. I've been talking to Tony Shannon recently about its use in the UK Health Sector as well as that is my current bailiwick.
I would add to the great answers provided before this point:
Heterogeneous hardware and software environments. Node-RED excels in managing and connecting heterogeneous environments.
As examples with IoT, whatever the radio or the format, it is easy to adapt the flow to use BLE instead of WiFi, USB serial instead of Ethernet. Same logic applies on the software side, Twitter to MySQL, local server to cloud, MQTT to HTML pages...
Node-RED is a tool to glue all those components together, both hardware and software.
I would add one other thing - it is a fantastic bridging tool for holes in your knowledge. i.e. you may be a gun DB programmer, but not know much at all about physical hardware (or vice versa) - Node-red enables you to bridge the gaps in your knowledge with virtually plug and play modules to enable you to get to an end solution more quickly.