Grid voltage protection
Grid Voltage Protection & dynamic Current Limiter
This flow implements an intelligent grid protection mechanism for a Victron Energy system. It monitors the AC input voltage (Phase L3) and dynamically adjusts the AC Input Current Limit and ESS Power Setpoint based on grid stability and battery State of Charge (SoC).
Key Features
- Voltage Hysteresis: Categorizes grid voltage into three states: Low/Unstable, Normal, and High.
- Low Voltage Protection: Restricts grid current when voltage drops (< 215V) to prevent further grid collapse, unless the battery is critically low (< 11%).
- Over-Voltage Prevention: Disables feed-in (sets ESS setpoint to 0) if grid voltage is high (> 250V) and the battery is nearly full (> 92%) to prevent inverter trips.
- Normal Operation: Allows full current capacity (39A) during standard voltage ranges (215V - 250V).
Configuration Details
| Parameter | Value | Description |
|---|---|---|
| Normal Range | 215V - 250V | Standard operating window. Current limit set to max (39A). |
| Low/High Logic | < 215V / > 280V | Considered unstable. If battery > 11%, throttles grid input to 10A. If battery critical (< 11%), allows 39A to prevent blackout. |
| High Voltage Logic | 250V - 280V | If Voltage is high AND Battery > 92%, sets ESS Setpoint to 0 to stop feed-in. |
Prerequisites
- Hardware: Victron MultiPlus/Quattro, Cerbo GX (or Raspberry Pi).
- Software: Node-RED with @victronenergy/node-red-contrib-victron installed.
Note: This flow includes simulation nodes (Inject/Delay) to test the "High Voltage + High SOC" scenario, which are helpful for verification before deploying to a live system.
[{"id":"33128c737c9bc0f6","type":"tab","label":"GRID Protection","disabled":false,"info":"","env":[]},{"id":"81cdf251c044a28a","type":"group","z":"33128c737c9bc0f6","name":"Protect grid by playing with P(U)","style":{"label":true},"nodes":["e405c2459aef216a","2895b87a47388af4","649d9ca3f5e76a03","07d753cfd56f66ed","69639e994604db3e","4495a27c1cbc7a1b","f4a41ec869821cd5","bc51472d17874f22","a39ccf2a68a451b7","4c3b21ba242ed4b4","22287f5987377795","9dad228c2fe776c0","2f850e07c15f8e61","745aa5b14b7ef3f6","37fb95d6aa399e98"],"x":74,"y":79,"w":952,"h":502},{"id":"e405c2459aef216a","type":"victron-input-multi","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","service":"com.victronenergy.multi/1","path":"/Ac/In/1/L3/V","serviceObj":{"service":"com.victronenergy.multi/1","name":"MultRS1"},"pathObj":{"path":"/Ac/In/1/L3/V","type":"float","name":"Input 1 voltage phase L3 (V AC)"},"name":"","onlyChanges":false,"roundValues":"2","rateLimit":"0.2","x":300,"y":120,"wires":[["2895b87a47388af4"]]},{"id":"2895b87a47388af4","type":"switch","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"Range","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"215","vt":"num","v2":"0","v2t":"num"},{"t":"btwn","v":"215","vt":"num","v2":"250","v2t":"num"},{"t":"btwn","v":"250","vt":"num","v2":"280","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":290,"y":280,"wires":[["69639e994604db3e"],["07d753cfd56f66ed"],["a39ccf2a68a451b7"],["69639e994604db3e"]]},{"id":"649d9ca3f5e76a03","type":"victron-output-multi","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","service":"com.victronenergy.multi/1","path":"/Ac/In/1/CurrentLimit","serviceObj":{"service":"com.victronenergy.multi/1","name":"MultRS1"},"pathObj":{"path":"/Ac/In/1/CurrentLimit","type":"float","name":"Ac input 1 current limit (A)","mode":"both"},"initial":39,"name":"AC in 1 current limit ( 39A )","onlyChanges":false,"rateLimit":0,"x":880,"y":360,"wires":[]},{"id":"07d753cfd56f66ed","type":"change","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"39 A","rules":[{"t":"set","p":"payload","pt":"msg","to":"39","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":280,"wires":[["649d9ca3f5e76a03","bc51472d17874f22"]]},{"id":"69639e994604db3e","type":"change","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"15 A","rules":[{"t":"set","p":"payload","pt":"msg","to":"15","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":220,"wires":[["4495a27c1cbc7a1b"]]},{"id":"4495a27c1cbc7a1b","type":"function","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"SOC protection","func":"lynx_soc = flow.get(\"lynx_soc\", 10);\nif (lynx_soc < 11) {\n msg.payload = 39;\n} \nelse {\n msg.payload = 10;\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":220,"wires":[["f4a41ec869821cd5","649d9ca3f5e76a03","bc51472d17874f22"]]},{"id":"f4a41ec869821cd5","type":"debug","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"debug 11","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":220,"wires":[]},{"id":"bc51472d17874f22","type":"victron-output-acsystem","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","service":"com.victronenergy.acsystem/0","path":"/Settings/Ac/In/CurrentLimitEnergyMeter","serviceObj":{"service":"com.victronenergy.acsystem/0","name":"MultiRS1"},"pathObj":{"path":"/Settings/Ac/In/CurrentLimitEnergyMeter","type":"float","name":"Ac current limit at grid meter (A)","mode":"both"},"initial":39,"name":"AC current limit at energy meter","onlyChanges":false,"rateLimit":0,"x":830,"y":420,"wires":[]},{"id":"a39ccf2a68a451b7","type":"change","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"39 A","rules":[{"t":"set","p":"payload","pt":"msg","to":"39","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":360,"wires":[["4c3b21ba242ed4b4"]]},{"id":"4c3b21ba242ed4b4","type":"function","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"SOC/Grid protection","func":"lynx_soc = flow.get(\"lynx_soc\", 10);\nif (lynx_soc > 92) {\n // High V in grid, disable feed-in.\n msg.payload = 0;\n} \nelse {\n // keep it as is\n return null;\n}\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":480,"wires":[["f4a41ec869821cd5","22287f5987377795"]]},{"id":"22287f5987377795","type":"victron-output-custom","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","service":"com.victronenergy.multi/1","path":"/Ess/AcPowerSetpoint","serviceObj":{"service":"com.victronenergy.multi/1","name":"MultRS1 (1)"},"pathObj":{"path":"/Ess/AcPowerSetpoint","name":"/Ess/AcPowerSetpoint","type":"object","value":null},"name":"","onlyChanges":false,"x":690,"y":540,"wires":[]},{"id":"9dad228c2fe776c0","type":"inject","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"Test grid HV and SOC > 92","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"260","payloadType":"num","x":230,"y":480,"wires":[["2f850e07c15f8e61","745aa5b14b7ef3f6"]]},{"id":"2f850e07c15f8e61","type":"change","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"","rules":[{"t":"set","p":"lynx_soc","pt":"flow","to":"93","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":540,"wires":[[]]},{"id":"745aa5b14b7ef3f6","type":"delay","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":410,"y":420,"wires":[["a39ccf2a68a451b7"]]},{"id":"37fb95d6aa399e98","type":"comment","z":"33128c737c9bc0f6","g":"81cdf251c044a28a","name":"","info":"Phase voltage meter would be different in your \ncase. Just change it to whatever input devise you have\n\nSame for trigger - current limiter would be a different device in your case - change it accordingly","x":780,"y":120,"wires":[]},{"id":"800a20a17ae691c4","type":"global-config","env":[],"modules":{"@victronenergy/node-red-contrib-victron":"1.6.55"}}]