Hello,
sorry for this noob question.
I want to make a routine based on the current total grid power. But I can only access the single values for L1/L2/L3.
Am I stupid? How can I add those numers to a total?
This site is now in read-only archive mode. Please move all discussion, and create a new account at the new Victron Community site.
Hello,
sorry for this noob question.
I want to make a routine based on the current total grid power. But I can only access the single values for L1/L2/L3.
Am I stupid? How can I add those numers to a total?
I am also a complete Node-RED noob. I don't use it for much, but total power was one of the things.
Drawing a line from an input to a dashboard output is about my lot. Manipulating the data en route is beyond my ken.
I would also like to know this very answer.
Specifically, because there used to be a Venus total power value tag available for import and export.
With a recent Venus update, these total power tags have disappeared.
I suggest you use the Join node in manual mode. This will combine all three phase power reading into 1 message, that you can add using an expression or script.
Create a single message from separate streams of messages : Node-RED (nodered.org)
Ok, went back to relook at it and found the solution (in my case I am calculating total PV kWh from multiple mppts).
You need to set the msg.topic on each message and then join on that.
I haven't found a way to reliably sequence inputs from different nodes.
I installed the "aggregator" node and now I become the mean value of the last 30 Minutes. All tree nodes are pointing to it and the result seems correct.
behind there is a shelly 1pm switch which controls a water heat pump. When there is a lot of sun, I increase the target temperature of it.
I installed a small node called "Calculator" to the palette - very useful node for many things: https://flows.nodered.org/node/node-red-contrib-calc
Setting the 'Calculator' node to "Sum" it adds all the numbers in an array.
To create the array, I used the 'Join' node already in the palette.
Attached is a picture of the flow and a picture of the 'Join' node settings that worked for me. I'd send you the .json file but when you use a 'System' node, it puts all the options into the .json file, which makes it huge!
I think from looking at the pictures you'll get it. To see total power, feed the output of the 'Sum' node into a 'Debug' node and click Deploy.
Since my system is for 120/240 volt split phase, I only have L1 and L2, so you'll need to modify for 3 phase.
I'm also a noob to Venus OS Large Node Red, so maybe this is not the best way to add my two phases? I'd love to hear if anyone has a criticism or suggestion about my method!
I do something similar with my MPPT adding them together and sending them to another pi via mqtt
Attached the flow
I used your question to create an example flow for just this. It will become available as an importable example when 1.4.30 has been added to Venus. Meanwhile you could also grab it from https://raw.githubusercontent.com/victronenergy/node-red-contrib-victron/master/examples/Sum%20power%20inputs.json
The example creates a subflow that sums all inputs and outputs (by default) every 5 seconds. It can also be set to output less often or only when the total changes.
Hi, I've added your subflow to my project and have only one minor issue I'm not sure how to solve in the best way.
Anytime I re-deploy, the first input value is passed through directly. I am charting the total PV power of a couple mppts, and this causes a dip in the chart as it shows the first inputs value by itself before the subsequent mppt input messages populate the stored values.
I'm not sure what the best fix is, but one thing I can think of would be to add another env var for the number of expected input flows before it sends out a value or maybe when it's writing the msg.topic to the stored array if that topic wasn't set previously skip outputting and return after saving the initialized value.
Another feature would maybe be to set the value of the output topic, it seems it relies on the rate limiter to snub duplicates for each input and uses the first input topic as it's output topic. Easily fixed with a change function, but I think it'd make a nice rounded off subflow that way.
Nice ideas. Thanks! I've added them to the subflow, which is available on the url above and will be added to the next release in the examples.
As suggested I've implemented it by adding two env vars:
When the expected inputs is set to zero, it behaves as before.
As of this moring, I'm running the "large" image on my Cerbo (Release channel, build date 20240226113741). Where do I find this sublflow?
You actually don't need to use it anymore. The new nodes (might be beta only still), export to a global variable so you can just add it all together in a function.
https://www.victronenergy.com/blog/2024/02/23/node-red-update-for-victron-users/
Clicking on the link in the post further up gives you the code which can just be imported to get the subflow.
maybe a dump question, but with a grid meter installled, the sum of all phases should be there already, or am I wrong?
I don't use the victron supplied contrib nodes, only mqtt but still it should be on dbus somewhere
A simple alternative, maybe: I like are these nodes: node-red-contrib-boolean-logic-ultimate ...there is a math node in that library, which will also SUM all messages, based on the number of different topics passing through it.
The nodes directly do not support all the dbus registers.
You can see what is supported here: https://github.com/victronenergy/node-red-contrib-victron/wiki/Available-nodes
But, using the custom input node, you can call any path.
...so, according to that: https://github.com/victronenergy/node-red-contrib-victron/wiki/Available-nodes#grid-meter ...with a grid meter installed, there should be total power available for Grid (which was asked initially, but you need to define that rule - compared to an AC-meter or PV-Meter - in the structure of the GX).
What's not available is total AC Power, though (the one shown in the VRM dashboard). Grid meter does provide a total, but is useless once ESS is running. I want to program something to optimize grid export when the battery threatens to get full (so, during most of summer).
System configuration: 3~ with 9,5kWp of AC-Solar (10 year old system which may export), 8x Pylontech US5000 and 5,7kWp of DC-coupled solar (Victron MPPTs) which may not export. Once the battery is full, the DC chargers become idle. So I want to export more during the day and charge from DC only, but use the AC system to supplement bigger loads (e.g. car charging).
Something like "If SOC greater than 70% and AC loads smaller than 50% of DC solar, then export all of AC production".
Hey @ektus , I had the same problem and used the solution provided earlier by silverfox
Nevertheless I got another question:
Is there a possibility to get the Total Generated AC Power (sum of L1/L2/L3 Power (W) of AC-IN, AC-OUT1, AC-OUT2)?
43 People are following this question.