Hello
I have a Cerbo GX with Multiplus II and battery system with separate (old) wind turbine which charges the batteries in parallel to the Multi. I have a Smart-Shunt on the battery negative leg.
I am implementing a Node-RED control so that I can integrate house loads and provide a user-friendly dashboard for the home. I have enabled Node-RED on the Cerbo, and can read from the Multi and from the SmartShunt. All good so far.
Now I am trying to use the data from the readings to calculate and display other readings. For example Turbine current = battery current - inverter DC current. And, Turbine Power = Turbine Current x Battery voltage, etc. I have tried all sorts of ways to do this in Node-RED and am stuck.
I am used to LabView and other environments with a cycle time, shift registers, etc, but don’t see how to use similar in Node-RED
As far as I know, in Smart Shunt settings, you can specify what it measures, and you can set it to “Wind Turbine”. Then it will naturally show it on the board as DC connected device
Thanks Xavier
I have made some progress, feeding the Victron data into an array node and then sending the output to the calculation.
However, despite the array node being set to only output when it receives 2 messages, the payload seems to be mixed up so the array is sometimes [dataA,dataB] and sometimes [dataB,dataA].
So if dataA = 20 and dataB = 15 then the result of array.1 - array.2 pings back an forth between +5 and -5.
I need some way to synchronise the data and ensure it comes through in the correct order so we don’t get this reversal happening. I have tried putting a delay on the data messages, so each only get sent every 0.25s, that way you will get the same number of dataA and dataB, but that hasnt fixed the problem.
I can’t see a way of addressing the data from the SmartShunt - e.g. SmartShunt.output.Volts, or similar.
Another way would be to read data into a global variable, but that (although simple) is beyond my Node-Red knowledge
Yes, preventing this data mix up there is viarious way, one I use, is to create storage variable and then I read it in the correct order to compose a message …
I store the value with the flow.Variable option, then with the “compose” I can select the order of the messages… then I can process some calculation on it if needed…
Pictures : This is not linked to your case but just to draw the method…
Hello! Something you could do is assign topics to the messages from the Victron Nodes (With a Change node) and then Join the messages every X amount of messages. With this, you could access each data in the payload as msg.payload.topic_assigned.
I haven’t worked with the subtraction node you are using, but a simple function node could do the Job.
The following is an example that you could import in your node-red that would do the job: