Erratic Multiplus change of state

This is probably for a Victron engineer or possibly someone who had a similar experience.

In my Node-Red running from Venus, I have designed a flow that controls the Multiplus state (On, OFF, Charger only, Inverter only) so that at a certain designated time will switch from Inverter only to Charger only.

However, more often than not, this cycle will not perform as intended, and the inverter switch will go from one of these two states to the “on” instead of the chosen one.

In these two examples, after a correct couple of sequences, we can see that eventually the error appears, resulting in the erroneous state “ON” when it should have been either “charger only” or “inverter only”.

I have tried disabling DVCC, recycling the VE. Bus and rebooting Venus, but the problem persists, always happening, not on the first nor on the second change of state, but the third time around.

Importantly, this occurs even by cycling between the two modes directly from the Cerbo Console. and it never happens between “On” and “Charger only” or vice versa.

What on earth is going on inside the Inverter to corrupt the intended received signal?

Pls post your NR Flow to reproduce for others. I only know this state from the hardware rocker switch at the Multi. Check other contributions on how to submit a flow. This forum contains the mermaid.js plugin what also shows NR flow graphics.

[{"id":"20c7e42d04a89526","type":"tab","label":"REVISED-Charge Copy","disabled":false,"info":"This Flow controls the house energy source PV/Grid\n\nGen-AutoStart On/Off\nThis function determines whether the Generator Autostart is active or disabled subject to predetermined battery SOC%\n\n\nHouse to grid On/Off\nThis function controls am MQTT relay which, acting on the Tranfer Switch, disconnects the House consumer from the PV energy and connects it to the Grid","env":[]},{"id":"4038995ba39be0cb","type":"victron-output-generator","z":"20c7e42d04a89526","d":true,"service":"com.victronenergy.generator/0","path":"/ManualStart","serviceObj":{"service":"com.victronenergy.generator/0","name":"Generator start/stop"},"pathObj":{"path":"/ManualStart","type":"enum","name":"Manual Start","enum":{"0":"Stop generator","1":"Start generator"},"mode":"both"},"name":"","onlyChanges":false,"x":980,"y":80,"wires":[],"info":"# Generator start stop manual"},{"id":"521b0cd1cf680b1f","type":"victron-input-battery","z":"20c7e42d04a89526","d":true,"service":"com.victronenergy.battery/0","path":"/Soc","serviceObj":{"service":"com.victronenergy.battery/0","name":"Lynx Shunt"},"pathObj":{"path":"/Soc","type":"float","name":"State of charge (%)"},"name":"","onlyChanges":true,"roundValues":"1","x":170,"y":240,"wires":[["3da139c390ca02f2"]],"info":"This node detects the Battery SOC"},{"id":"9e2f105c3fdd8b1a","type":"debug","z":"20c7e42d04a89526","d":true,"name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":980,"y":200,"wires":[]},{"id":"757c59a609b112a6","type":"function","z":"20c7e42d04a89526","d":true,"name":"Gen / SOC Threshold","func":"// Retrieve thresholds from flow context\nconst thresholdHigh = flow.get(\"thresholdHigh\") || 81; // Default if not set\nconst thresholdLow = flow.get(\"thresholdLow\") || 70;   // Default if not set\n\n// Log the incoming payload to check its structure\nnode.warn(\"Payload received: \" + JSON.stringify(msg.payload));\n\nif (!msg.payload || isNaN(parseFloat(msg.payload))) {\n    node.warn(\"Invalid payload format.\");\n    return null; // Exit if payload is invalid\n}\n\nconst batterySoC = parseFloat(msg.payload);\nnode.warn(\"Parsed Battery SoC: \" + batterySoC);\n\n// Determine relay state\nif (batterySoC > thresholdHigh) {\n    msg.payload = 0;  // OFF\n    node.warn(\"Relay OFF: SoC > \" + thresholdHigh);\n} else if (batterySoC < thresholdLow) {\n    msg.payload = 1;  // ON\n    node.warn(\"Relay ON: SoC < \" + thresholdLow);\n} else {\n    node.warn(\"No relay change: SoC within thresholds\");\n    return null;  // No change\n}\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":80,"wires":[["4038995ba39be0cb","9e2f105c3fdd8b1a"]],"info":"# SOC charge window settings\nmin-max"},{"id":"07050f3b67039393","type":"inject","z":"20c7e42d04a89526","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"%","payload":"76","payloadType":"num","x":150,"y":100,"wires":[["81c246ad233ab6f3"]],"info":"# Manual SOC inkject Max"},{"id":"87bdb79a1adbb94e","type":"inject","z":"20c7e42d04a89526","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"%","payload":"64","payloadType":"num","x":150,"y":140,"wires":[["81c246ad233ab6f3"]],"info":"# Manual SOC inkject Min"},{"id":"d24932f774729e21","type":"victron-output-vebus","z":"20c7e42d04a89526","service":"com.victronenergy.vebus/276","path":"/Mode","serviceObj":{"service":"com.victronenergy.vebus/276","name":"Multi 01"},"pathObj":{"path":"/Mode","type":"enum","name":"Switch Position","enum":{"1":"Charger Only","2":"Inverter Only","3":"On","4":"Off"},"mode":"both"},"name":"","onlyChanges":false,"x":910,"y":360,"wires":[],"info":"# Inverter Swithch Position\nStet to switch from Inverter only to Charger only and viceversa."},{"id":"39dd81ea2b77bfc2","type":"inject","z":"20c7e42d04a89526","name":"2-Inverter ONLY @ 6:58","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"58 06 * * *","once":false,"onceDelay":0.1,"topic":"2","payload":"2","payloadType":"num","x":190,"y":360,"wires":[["d24932f774729e21","484597973e272619"]],"info":"# Changes the Inverter status to \"inverter only\"\nso that the inverter output resume and the grid disconnects Soon after as the relay in the solar shed is deactivated by eWelink"},{"id":"565e0d2dcb6ceb08","type":"inject","z":"20c7e42d04a89526","name":"1-Charger Only @ 1:01","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"02 01 * * *","once":false,"onceDelay":0.1,"topic":"1","payload":"1","payloadType":"num","x":190,"y":320,"wires":[["d24932f774729e21","484597973e272619"]],"info":"# Changes the Inverter status to \"charger only\" \nso that the inverter output stops and the grid is connected and available for charging\nas long as the relay in the solar shed is activated by eWelink"},{"id":"864154c24ad5726c","type":"inject","z":"20c7e42d04a89526","name":"3-Iverter ON ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"3","payload":"3","payloadType":"num","x":130,"y":520,"wires":[["d24932f774729e21"]]},{"id":"56cb896dd32a3a33","type":"inject","z":"20c7e42d04a89526","name":"4-Iverter OFF","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"4","payload":"4","payloadType":"num","x":150,"y":580,"wires":[["d24932f774729e21"]],"info":"# Dasboard switch inverter OFF"},{"id":"3da139c390ca02f2","type":"function","z":"20c7e42d04a89526","d":true,"name":"Store SOC","func":"flow.set(\"soc\", msg.payload);\nreturn null; // or return msg if you want to pass it downstream\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":240,"wires":[["01d657f7469abe8f"]],"info":"# Stores the SOC"},{"id":"01d657f7469abe8f","type":"function","z":"20c7e42d04a89526","d":true,"name":"Repeat SOC","func":"let soc = flow.get(\"soc\");\nif (soc !== undefined) {\n    msg.payload = soc;\n    return msg;\n}\nreturn null;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":240,"wires":[["81c246ad233ab6f3","9e2f105c3fdd8b1a"]],"info":"# Relays the SOC every at intervals"},{"id":"81c246ad233ab6f3","type":"function","z":"20c7e42d04a89526","d":true,"name":"TIME 1:03 > 6:55","func":"let now = new Date();\nlet hour = now.getHours();\nlet minute = now.getMinutes();\n\nif (\n    (hour === 1 && minute >= 03) ||\n    (hour > 1 && hour < 6) ||\n    (hour === 6 && minute <= 55)\n) {\n    return msg; // allow during 01:05–06:58\n}\nreturn null; // block outside that window\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":80,"wires":[["757c59a609b112a6"]],"info":"# Charge time window setting"},{"id":"36c23dc4c63dcc97","type":"inject","z":"20c7e42d04a89526","d":true,"name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"15","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":580,"y":280,"wires":[["01d657f7469abe8f"]],"info":"# Inject which frequently triggers the time watchdog  "},{"id":"484597973e272619","type":"debug","z":"20c7e42d04a89526","name":"debug 26","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":480,"wires":[]}]

I can’t get the ```flows to convert the Jason to visual.

But you can run the same test from the console with the same result, at least this is what my Multiplus does.

First step to post a flow is to select the “compact” export format. Then only one abbreviated line appears in the forum but copy back to NR is possible in full formated length. See attached screendump with the two small buttons “compact/formated” over the red “copy to clipboard” button.

[{"id":"ab634e45d7e7eeba","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"7f432f9ce59a8129","type":"victron-output-generator","z":"ab634e45d7e7eeba","d":true,"service":"com.victronenergy.generator/0","path":"/ManualStart","serviceObj":{"service":"com.victronenergy.generator/0","name":"Generator start/stop"},"pathObj":{"path":"/ManualStart","type":"enum","name":"Manual Start","enum":{"0":"Stop generator","1":"Start generator"},"mode":"both"},"name":"","onlyChanges":false,"x":1000,"y":160,"wires":[],"info":"# Generator start stop manual"},{"id":"73e88e364b581bfe","type":"victron-input-battery","z":"ab634e45d7e7eeba","d":true,"service":"com.victronenergy.battery/0","path":"/Soc","serviceObj":{"service":"com.victronenergy.battery/0","name":"Lynx Shunt"},"name":"","onlyChanges":true,"roundValues":"1","x":150,"y":320,"wires":[["11fbfc5b85bf01a9"]],"info":"This node detects the Battery SOC"},{"id":"8877e23f47740b62","type":"debug","z":"ab634e45d7e7eeba","d":true,"name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":280,"wires":[]},{"id":"04ee42a3c8ef1f76","type":"function","z":"ab634e45d7e7eeba","d":true,"name":"Gen-On/Off - Times","func":"// Desired thresholds\nconst thresholdHigh = 79; // Relay OFF when SoC > xx%\nconst thresholdLow = 70;  // Relay ON when SoC < xx%\n\n// Log the incoming payload to check its structure\nnode.warn(\"Payload received: \" + JSON.stringify(msg.payload));\n\nif (!msg.payload || isNaN(parseFloat(msg.payload))) {\n    node.warn(\"Invalid payload format.\");\n    return null; // Exit if payload is invalid\n}\n\nconst batterySoC = parseFloat(msg.payload);\nnode.warn(\"Parsed Battery SoC: \" + batterySoC);\n\n// Determine relay state\nif (batterySoC > thresholdHigh) {\n    msg.payload = 0;  // OFF\n} else if (batterySoC < thresholdLow) {\n    msg.payload = 1;  // ON\n} else {\n    return null;  // No change\n}\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":160,"wires":[["7f432f9ce59a8129","8877e23f47740b62"]],"info":"# SOC charge window settings\nmin-max"},{"id":"23b43a727e0dd464","type":"inject","z":"ab634e45d7e7eeba","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"%","payload":"76","payloadType":"num","x":170,"y":160,"wires":[["b9646e387912699b"]],"info":"# Manual SOC inkject Max"},{"id":"b7e689232af619a3","type":"inject","z":"ab634e45d7e7eeba","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"%","payload":"64","payloadType":"num","x":170,"y":220,"wires":[["b9646e387912699b"]],"info":"# Manual SOC inkject Min"},{"id":"11fbfc5b85bf01a9","type":"function","z":"ab634e45d7e7eeba","d":true,"name":"Store SOC","func":"flow.set(\"soc\", msg.payload);\nreturn null; // or return msg if you want to pass it downstream\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":320,"wires":[["ca7753a24b1e15f3"]],"info":"# Stores the SOC"},{"id":"ca7753a24b1e15f3","type":"function","z":"ab634e45d7e7eeba","d":true,"name":"Repeat SOC","func":"let soc = flow.get(\"soc\");\nif (soc !== undefined) {\n    msg.payload = soc;\n    return msg;\n}\nreturn null;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":320,"wires":[["b9646e387912699b","8877e23f47740b62"]],"info":"# Relays the SOC every at intervals"},{"id":"b9646e387912699b","type":"function","z":"ab634e45d7e7eeba","d":true,"name":"TIME 1:03 > 6:55","func":"let now = new Date();\nlet hour = now.getHours();\nlet minute = now.getMinutes();\n\nif (\n    (hour === 1 && minute >= 04) ||\n    (hour > 1 && hour < 6) ||\n    (hour === 6 && minute <= 55)\n) {\n    return msg; // allow during 01:05–06:58\n}\nreturn null; // block outside that window\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":160,"wires":[["04ee42a3c8ef1f76"]],"info":"# Charge time window setting"},{"id":"1803f318c3429e51","type":"inject","z":"ab634e45d7e7eeba","d":true,"name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":580,"y":380,"wires":[["ca7753a24b1e15f3"]],"info":"# Inject which frequently triggers the time watchdog  "}]

What I can see in your flow is only polling of a Lynx BMS but no MP2. The flow is dashed as I dont have any Lynx in my system.

[{“id”:“20c7e42d04a89526”,“type”:“tab”,“label”:“REVISED-Charge Copy”,“disabled”:false,“info”:“This Flow controls the house energy source PV/Grid\n\nGen-AutoStart On/Off\nThis function determines whether the Generator Autostart is active or disabled subject to predetermined battery SOC%\n\n\nHouse to grid On/Off\nThis function controls am MQTT relay which, acting on the Tranfer Switch, disconnects the House consumer from the PV energy and connects it to the Grid”,“env”:},{“id”:“d24932f774729e21”,“type”:“victron-output-vebus”,“z”:“20c7e42d04a89526”,“service”:“com.victronenergy.vebus/276”,“path”:“/Mode”,“serviceObj”:{“service”:“com.victronenergy.vebus/276”,“name”:“Multi 01”},“pathObj”:{“path”:“/Mode”,“type”:“enum”,“name”:“Switch Position”,“enum”:{“1”:“Charger Only”,“2”:“Inverter Only”,“3”:“On”,“4”:“Off”},“mode”:“both”},“name”:“”,“onlyChanges”:false,“x”:910,“y”:360,“wires”:,“info”:“# Inverter Swithch Position\nStet to switch from Inverter only to Charger only and viceversa.”},{“id”:“39dd81ea2b77bfc2”,“type”:“inject”,“z”:“20c7e42d04a89526”,“name”:“2-Inverter ONLY @ 6:58”,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:“”,“crontab”:“58 06 * * *”,“once”:false,“onceDelay”:0.1,“topic”:“2”,“payload”:“2”,“payloadType”:“num”,“x”:190,“y”:360,“wires”:[[“d24932f774729e21”,“484597973e272619”]],“info”:“# Changes the Inverter status to “inverter only”\nso that the inverter output resume and the grid disconnects Soon after as the relay in the solar shed is deactivated by eWelink”},{“id”:“565e0d2dcb6ceb08”,“type”:“inject”,“z”:“20c7e42d04a89526”,“name”:“1-Charger Only @ 1:01”,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:“”,“crontab”:“02 01 * * *”,“once”:false,“onceDelay”:0.1,“topic”:“1”,“payload”:“1”,“payloadType”:“num”,“x”:190,“y”:320,“wires”:[[“d24932f774729e21”,“484597973e272619”]],“info”:“# Changes the Inverter status to “charger only” \nso that the inverter output stops and the grid is connected and available for charging\nas long as the relay in the solar shed is activated by eWelink”},{“id”:“864154c24ad5726c”,“type”:“inject”,“z”:“20c7e42d04a89526”,“name”:“3-Iverter ON “,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:””,“crontab”:“”,“once”:false,“onceDelay”:0.1,“topic”:“3”,“payload”:“3”,“payloadType”:“num”,“x”:130,“y”:520,“wires”:[[“d24932f774729e21”]]},{“id”:“56cb896dd32a3a33”,“type”:“inject”,“z”:“20c7e42d04a89526”,“name”:“4-Iverter OFF”,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:“”,“crontab”:“”,“once”:false,“onceDelay”:0.1,“topic”:“4”,“payload”:“4”,“payloadType”:“num”,“x”:150,“y”:580,“wires”:[[“d24932f774729e21”]],“info”:“# Dasboard switch inverter OFF”},{“id”:“484597973e272619”,“type”:“debug”,“z”:“20c7e42d04a89526”,“name”:“debug 26”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:“”,“statusType”:“auto”,“x”:900,“y”:480,“wires”:}]

Dont know what went wrong with your export.

Cannot import also if I delete the ```flows keyword.

Maybe @guystewart can help us what is wrong with the ```flows keyword?

Strange, the instruction tells me to insert the ```flows at the top.

However, the part that you were showing earlier is disabled because it is not what causes the issue.

It’s the second part in the image below, a very simple flow that injects the two different states at a given time;

It works randomly, or better, it works correctly twice, but it fails from there on.

The flows keyword appears when you try to insert it as a node red flow in the post.

1 Like