The following Node-RED flow will connect the inverter to the grid when the SOC drops below 50%, keeping the batteries charged, and will disconnect from the grid when the SOC rises above 60% again.
If you then set your ESS to maintain the SOC at 55%, you use solar as much as possible while keeping the batteries charged with the grid when they get too low.
You can achieve the same result using the general flag and programmable relay assistants in VEConfig, save for the problem mentioned above. Additionally, changing the parameters in Node-RED can be done on the fly and online, while changing the assistants requires the inverter to restart.
Hope this helps!
[
{
"id": "0549d5c71e3229fa",
"type": "tab",
"label": "SOC-based Ignore AC-In",
"disabled": false,
"info": "",
"env": []
},
{
"id": "cfc276ba408d239a",
"type": "victron-output-vebus",
"z": "0549d5c71e3229fa",
"service": "com.victronenergy.vebus/276",
"path": "/Mode",
"serviceObj": {
"service": "com.victronenergy.vebus/276",
"name": "Quattro 24/8000/200-2x100"
},
"pathObj": {
"path": "/Mode",
"type": "enum",
"name": "Switch Position",
"enum": {
"1": "Charger Only",
"2": "Inverter Only",
"3": "On",
"4": "Off"
},
"mode": "both"
},
"initial": 2,
"name": "",
"onlyChanges": false,
"x": 1070,
"y": 440,
"wires": []
},
{
"id": "1a8c7182eca3314e",
"type": "victron-input-system",
"z": "0549d5c71e3229fa",
"service": "com.victronenergy.system/0",
"path": "/Dc/Battery/Soc",
"serviceObj": {
"service": "com.victronenergy.system/0",
"name": "Venus system"
},
"pathObj": {
"path": "/Dc/Battery/Soc",
"type": "float",
"name": "Battery State of Charge (%)"
},
"name": "",
"onlyChanges": true,
"roundValues": "0",
"x": 310,
"y": 440,
"wires": [
[
"daf40684e6a11c5e"
]
]
},
{
"id": "8d42d6b2f7d32f05",
"type": "function",
"z": "0549d5c71e3229fa",
"name": "Inverter Only/On ",
"func": "let soc = flow.get('soc')\nlet mppt_power = flow.get('mppt_power')\nlet ac_pv_power = flow.get('ac_pv_power')\n\nif (soc < 50) {\n // switch inverter switch to \"on\"\n // effectively disables AC pv\n // enabling grid charging\n msg.payload = 3;\n return msg;\n} else if (soc >= 60) {\n // switch inverter switch to \"inverter only\"\n // effectively enables AC pv\n // disables grid charging\n msg.payload = 2;\n return msg;\n}",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 780,
"y": 440,
"wires": [
[
"cfc276ba408d239a"
]
]
},
{
"id": "daf40684e6a11c5e",
"type": "change",
"z": "0549d5c71e3229fa",
"name": "",
"rules": [
{
"t": "set",
"p": "soc",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 590,
"y": 440,
"wires": [
[
"8d42d6b2f7d32f05"
]
]
}
]