DESS issue prevention
💡 Flow Purpose: Battery Protection and DESS Bug Fix
This flow (named "Force Batt charge after grid off") acts as an automatic safeguard for your Victron energy system.
Its primary goal is to solve a potential issue (labeled as "DESS bug fix") where Dynamic ESS (DESS) might prevent the battery from charging if its State of Charge (SoC) has dropped below the configured minimum threshold (e.g., after a grid failure).
The flow constantly monitors the battery's charge level.
- If the charge drops below the minimum, it forcibly disables DESS and switches the ESS mode to "Keep batteries charged".
- As soon as the charge rises above the minimum, it re-enables DESS ("Auto" mode) and sets the ESS mode back to "Optimized".
⚙️ How it Works: Step-by-Step Logic
The entire process runs automatically every minute.
Trigger (Every 60 seconds):
- An
injectnode (ee53d79e0c881a0b) automatically starts the flow every 60 seconds to check the system's status.
- An
Data Collection:
- Two
victron-inputnodes read the current system settings:victron-input-battery(b57899fa2275874e): Gets the current Battery State of Charge (SoC) (e.g., 80%).victron-input-ess(2288bbeffd17b4e1): Gets your configured Minimum Discharge SoC (e.g., 85%).
- These two values are stored in flow-level variables (
flow.batt_socandflow.ess_min_soc) for the main logic to use.
- Two
Main Logic (Node "DESS bug fix"):
- The core
functionnode (bbd2556b12dc9218) receives the trigger from the timer. - It reads the stored current SoC and minimum SoC values.
- It compares them and makes a decision:
➡️ Scenario A: Battery is Low (Current SoC < Minimum SoC)
- Example: Current = 80%, Minimum = 85%
- Action: The flow generates a message to force the battery to charge.
- It sets:
ess_state: 9(Mode "Keep batteries charged")dess_mode: 0(Mode "Off" for Dynamic ESS)
➡️ Scenario B: Battery is OK (Current SoC > Minimum SoC)
- Example: Current = 86%, Minimum = 85%
- Action: The flow generates a message to return to normal operation.
- It sets:
ess_state: 10(Mode "Optimized mode w/o BatteryLife")dess_mode: 1(Mode "Auto" for Dynamic ESS)
- The core
Execute Commands:
- The message from the logic node is sent to two
victron-outputnodes:victron-output-dess(a7cebd46357993ab): Receives thedess_mode(0 or 1) and turns Dynamic ESS "Off" or "Auto".victron-output-ess(f415d212bbd74d18): Receives theess_state(9 or 10) and changes the main ESS mode (to "Keep charged" or "Optimized").
- The message from the logic node is sent to two
📋 Key Node Overview
- Inject (Timer): Triggers the check every 60 seconds.
- Victron Input (Battery SoC): Reads the current charge percentage.
- Victron Input (ESS Min SoC): Reads the configured minimum percentage.
- Function "DESS bug fix": The brains of the operation. Compares current vs. minimum SoC.
- Victron Output (DESS Mode): Sets DESS to "Auto" (1) or "Off" (0).
- Victron Output (ESS State): Sets ESS to "Optimized" (10) or "Keep batteries charged" (9).
- Debug: Helps you see what decisions the flow is making.
[{"id":"3783c66376cb9e8e","type":"group","z":"4f1dca6f6b282738","name":"Force Batt charge after grid off","style":{"label":true},"nodes":["b57899fa2275874e","2288bbeffd17b4e1","e8c0355c31d2e490","42a10f3296094173","bbd2556b12dc9218","ee53d79e0c881a0b","b7b272df275d8efd","f415d212bbd74d18","a7cebd46357993ab","3d217de65636c13e","b5aeb1b4d475159a"],"x":14,"y":39,"w":752,"h":622},{"id":"b57899fa2275874e","type":"victron-input-battery","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","service":"com.victronenergy.battery/512","path":"/Soc","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/Soc","type":"float","name":"State of charge (%)"},"name":"","onlyChanges":false,"roundValues":"2","x":190,"y":80,"wires":[["e8c0355c31d2e490"]]},{"id":"2288bbeffd17b4e1","type":"victron-input-ess","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","service":"com.victronenergy.settings","path":"/Settings/CGwacs/BatteryLife/MinimumSocLimit","serviceObj":{"service":"com.victronenergy.settings","name":"Venus settings"},"pathObj":{"path":"/Settings/CGwacs/BatteryLife/MinimumSocLimit","type":"integer","name":"Minimum Discharge SOC (%)","mode":"both"},"name":"","onlyChanges":false,"x":210,"y":160,"wires":[["42a10f3296094173"]]},{"id":"e8c0355c31d2e490","type":"change","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"","rules":[{"t":"set","p":"batt_soc","pt":"flow","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":80,"wires":[[]]},{"id":"42a10f3296094173","type":"change","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"","rules":[{"t":"set","p":"ess_min_soc","pt":"flow","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":160,"wires":[[]]},{"id":"bbd2556b12dc9218","type":"function","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"DESS bug fix","func":"batt_soc = flow.get(\"batt_soc\", 101);\ness_min_soc = flow.get(\"ess_min_soc\", 101);\n\nif (batt_soc == 101 || ess_min_soc == 101) {\n return null;\n}\n// ess_min_soc = 99;\nif (batt_soc < ess_min_soc) {\n // Disable DESS, Enable Keep batteries charged\n msq = {\n payload: \"DESS bug prevention\",\n ess_state: 9,\n dess_mode: 0\n }\n return msq;\n}\nelse if (batt_soc > ess_min_soc) {\n // Enable DESS, Enable Optimized w/o BatteryLife\n msq = {\n payload: \"DESS bug prevention\",\n ess_state: 10,\n dess_mode: 1\n }\n return msq;\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":620,"wires":[["b5aeb1b4d475159a","3d217de65636c13e","b7b272df275d8efd"]]},{"id":"ee53d79e0c881a0b","type":"inject","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":540,"wires":[["bbd2556b12dc9218"]]},{"id":"b7b272df275d8efd","type":"debug","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":540,"wires":[]},{"id":"f415d212bbd74d18","type":"victron-output-ess","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","service":"com.victronenergy.settings","path":"/Settings/CGwacs/BatteryLife/State","serviceObj":{"service":"com.victronenergy.settings","name":"Venus settings"},"pathObj":{"path":"/Settings/CGwacs/BatteryLife/State","type":"enum","name":"ESS state","enum":{"1":"BatteryLife enabled (GUI controlled)","2":"Optimized Mode /w BatteryLife: self consumption","3":"Optimized Mode /w BatteryLife: self consumption, SoC exceeds 85%","4":"Optimized Mode /w BatteryLife: self consumption, SoC at 100%","5":"Optimized Mode /w BatteryLife: SoC below dynamic SoC limit","6":"Optimized Mode /w BatteryLife: SoC has been below SoC limit for more than 24 hours. Charging the battery (5A)","7":"Optimized Mode /w BatteryLife: Inverter/Charger is in sustain mode","8":"Optimized Mode /w BatteryLife: recharging, SoC dropped by 5% or more below the minimum SoC","9":"'Keep batteries charged' mode is enabled","10":"Optimized mode w/o BatteryLife: self consumption, SoC at or above minimum SoC","11":"Optimized mode w/o BatteryLife: self consumption, SoC is below minimum SoC","12":"Optimized mode w/o BatteryLife: recharging, SoC dropped by 5% or more below minimum SoC"}},"name":"","onlyChanges":false,"x":630,"y":320,"wires":[]},{"id":"a7cebd46357993ab","type":"victron-output-dess","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","service":"com.victronenergy.settings","path":"/Settings/DynamicEss/Mode","serviceObj":{"service":"com.victronenergy.settings","name":"Venus settings"},"pathObj":{"path":"/Settings/DynamicEss/Mode","type":"enum","name":"Dynamic ESS mode","enum":{"0":"Off","1":"Auto","4":"Node-RED"},"mode":"both"},"name":"","onlyChanges":false,"x":590,"y":240,"wires":[]},{"id":"3d217de65636c13e","type":"function","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"DESS off","func":"if (msg.payload == \"DESS bug prevention\") {\n msg.payload = msg.dess_mode;\n return msg;\n}\nreturn null;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":360,"wires":[["b7b272df275d8efd","a7cebd46357993ab"]]},{"id":"b5aeb1b4d475159a","type":"function","z":"4f1dca6f6b282738","g":"3783c66376cb9e8e","name":"ESS: Keep batteries charged","func":"if (msg.payload == \"DESS bug prevention\") {\n msg.payload = msg.ess_state;\n return msg;\n}\nreturn null;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":440,"wires":[["b7b272df275d8efd","f415d212bbd74d18"]]}]