I just finished a flow that I like a lot and thought I’d share.
I am under the impression that LiFePo4 batteries enjoy sitting at 80% SOC (State of Charge) far more than they like sitting at 100%. My plan then was to create a flow that will allow me to turn on SOC limiting and set the limit. When the limit is set, the Multiplus-II will be turned off when the battery’s SOC hits the limit and when the battery’s SOC gets to 5% below the limit it will turn back on.
First of all, I’m not a battery expert (yet) so if cycling around 75-80% with a small load (1-4A) is not better for the battery than sitting at 100% and letting the Multi act as a power supply, certainly let me know.
I created the flow in its own tab called “Limit SOC” and here’s what it looks like…
The first block sets a default value of false for a flow-level variable called limitSOC
and saves it. If that is true, the limiting logic will apply. The blue box is a Node-RED UI element that renders a switch. I’ll show you what that ends up looking like later.
The second block sets a default value of 80 for another flow-level variable called socLimitValue
which determines the percentage the battery should be held at and obviously doesn’t apply if the previous variable is false. Again, the blue box is a Node-RED UI element - this time a numeric text box between 50% and 90% and in 5% steps.
The final block is the implementation. The 30, 77, and 90 injection nodes are just for testing. As is the “Charge Mode Friendly Name” node.
The SOC is read from the SmartShunt and a function block maps the ranges to a value of 1-4 corresponding to the switch values for a Multi. Here’s the script…
if (flow.get("limitSOC")) {
let socLimit = flow.get("socLimitValue");
if (msg.payload <= socLimit - 5) {
// SOC is 5 below the limit — start charging
msg.payload = 3;
} else if (msg.payload >= socLimit) {
// SOC is at or above the limit — stop charging
msg.payload = 4;
} else {
// SOC is within the hysteresis band — do nothing
return null;
}
} else {
// Limit SOC is off — always charge
msg.payload = 3;
}
return msg;
The logic starts with checking the limitSOC
variable, and if it’s false it hits the line msg.payload = 3
which turns the Multi on. Otherwise, if the SOC is 5% below the limit value or less it turns the charger on (value 3). If it’s at or above the limit it turns it off (value 4). If it’s in between it returns null
which doesn’t send anything to the Multi. That strategy of creating a null zone is called hysteresis and is implemented to avoid fast cycling of the charger right near the limit.
The flow works great, and if I go to the Node-RED UI page it renders like this…
It’s easy to pull that UI up on my PC or phone and turn the limit off. The plan is to leave it at 80 unless I’m getting ready to go on a trip. Even then, I have an Orion XS hooked up to my alternator, so I could just leave the house at 80% and I’m sure to be charged by the time I get to where I’m going.
I hope you can use this. Let me know if it’s been helpful or if you have any suggestions to improve it.