I’ve been working with Node-RED for about a month now (I’m new to this platform), and I’m finding it difficult to develop new projects. I feel like there’s something I’m missing, and I can’t progress as I’d like.
Currently, I’m working with three pumps, a variable speed drive (VSD), two LoRa devices that communicate with each other, and a controller. However, I’m struggling to adapt, especially coming from the classic Siemens S7.
What I find most challenging is structuring the flows from the start, and as the number of nodes increases, the complexity becomes overwhelming. Has anyone been in a similar situation?
I’d like to identify where I’m going wrong so I can move forward.
Welcome to the forum @Stark, it's difficult to know what to say, given that you are not asking about anything specific
As you are new I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
Im m looking for information on an industrial application where two pumps are connected to a frequency inverter. At the end of the system, there is a LoRa MQTT device that indicates when more water is needed, activating the motor when the frequency reaches 40 Hz.
My goal is to understand how to implement this logic in Node-RED, but most of the examples I find are focused on home automation rather than industrial applications. Is also important to note that the frequency inverter Im using is a Schneider Altivar.
In such a case, acknowledging it is sometimes difficult to know where to start, I would break down things into smaller chunks, experimenting with them, learning how they work, and finally make the connection, building your solution. Still expecting this is to be "version one", you will see that you soon think of improvements; it is at least so it has been for me
your pumps & frequency converter, build a small flow that allows you to start/stop the pumps, read status if the pumps is running or not. In what way can you communicate with the pumps & frequency converter?
the same for your LoRa MQTT devices; build a simple flow and check that you can communicate the whole way as needed
the business logic; you can create a small flow and use nodes to simulate messages both ways, check that the logic is as expected
Next, first iteration, linking them all together...
And BTW, since this seems to be a commercial thing, your company might allow you to hire a consultant to get you going, check out this section here: Jobs - Node-RED Forum
First of all, you need to understand that nodered is flow based, and not looping while checking its state like PLC.
So you need to design your flows accordingly: OR logic is very easy. You just wire 2 inputs into same node.
AND logic is a bit trickier. In some cases you might need to use JOIN node, and wait for all data to arrive. In other cases you might want to set context data, and use switch node( or wrap it up with function node and design your conditions and output through multiple outputs).
Nodered is very good for things that it was designed for, sadly PLC replacement is not one of the use cases (not impossible, but not as easy as you would like)
This is the way I structure my flows, making intensive use of MQTT to segregate the design into logical blocks:
First consider the Inputs and Outputs to the real world, so your pumps, drives etc. Have a flow tab (or tabs) that handle all the IO, and interfaces between the hardware and MQTT. So you might have a tab that interfaces with the drives, which receives current state from the drives and passes it to MQTT, and receives requests for changes from MQTT and passes them to the drives. Design the MQTT topics and the messages to be as generic as possible, as far as possible independent of the particular drive model and communication method. The advantage of that is that if you later changed one of the drives to a different type then, with luck, you will only need to adjust the flows on that tab and not have to change anything else in the system
Have a set of tabs handling the system logic. This is where logic such as that which notices that more water is needed (which it would get via MQTT) and would then send the request off to the drive flow (via MQTT) to run the pump;
Another set of tabs handling the user interface. These tabs would have the dashboard widgets (if you are using a node red dashboard) for the user interface and would receive data to display via MQTT and sends any inputs from the user out via MQTT. I generally have one tab for each page in the UI, so the appropriate tab can easily be found during development.
That way you end up with a large number of fairly simple flows, independent of each other and interacting via MQTT. Take care to name the flow tabs appropriately so you can identify which one does what.