Nodered - multiplus2 - charger current limit

Good evening, I have a victron system based on multiplu2 and cerbo. I already use nodered for many applications and I would like to add a control that changes the charge current limit. Is there a nodered command that allows me to change this parameter in the multiplus2?

image

Thanks! But there is something else wrong: I set the limit to 10A, but it continues to charge at 20A.


Do you have “DC-coupled PV - Feed in excess” enabled in the ESS settings ?
If you do, it’s documented that this disables the DVCC current limiter.

Since you’re already using Node Red: what you can do is monitor the charge current and increase/decrease the DVCC Maximum charge voltage to match your desired charge current.

1 Like

CCL only limits AC coupled PV if you have DC-coupled PV - Feed in excess enabled. The MPPTs will ignore CCL if DC Feed in enabled.

Just read the Victron documentation about DVCC.

@fonzy1983

I’m just starting out with NodeRed and found your post because I have a similar desire to change the DVCC Maximum charge current on a daily schedule.

I want to do this to achieve what seems to be called “Feed-In Priority mode” in other systems - that is to export all of my surplus AC-input coupled PV to grid during the day, and charge the battery from the grid during my nighttime off-peak tariff.

But reading through this thread it occurs that I can achieve what I need using existing menu items in the CerboGX.

  • Don’t enable DVCC>Limit charge current (or set it to a non-zero value you like).
  • set ESS>Scheduled charge Levels>schedule 1 to the off-peak tariff times and desired nighttime SoC limit.
  • set ESS>Scheduled charge Levels>schedule 2 to all daylight hours and a very low SoC (eg. 10%)

I would like to try to achieve a solution in NodeRed, and if you can offer any hints or an example I’d be grateful for the tuition :slight_smile:

@fonzy1983 I have a very simple piece of Node Red code that changes my Charge Current daily at Midnight and 07:00. I use this to have a lower charge rate overnight to reduce the noise from my noise generator, otherwise known as a Multiplus ii 5000.

Thanks for the pointers Tony.

I’ve tried to recreate your NodeRed but I couldn’t find the “DVCC system max charge current” node you are using

Which container is it in?

Also, in the inject nodes are you using the “repeat at a specific time” section to trigger your Amperage changes?

[
    {
        "id": "8e798fc93e6ce007",
        "type": "tab",
        "label": "Current Limit",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "1bf1b1153d785ce4",
        "type": "inject",
        "z": "8e798fc93e6ce007",
        "name": "Set Night charge current to 40A",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 00 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "40",
        "payloadType": "num",
        "x": 190,
        "y": 60,
        "wires": [
            [
                "1bf4a183e575b02e"
            ]
        ]
    },
    {
        "id": "2b1c7cc0cfa37022",
        "type": "inject",
        "z": "8e798fc93e6ce007",
        "name": "Set Day charge current to 45A",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 07 * * *",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "45",
        "payloadType": "num",
        "x": 190,
        "y": 180,
        "wires": [
            [
                "1bf4a183e575b02e"
            ]
        ]
    },
    {
        "id": "a0cef552435bfdba",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/AcPowerSetPoint",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/AcPowerSetPoint",
            "type": "integer",
            "name": "Grid set-point (W)",
            "mode": "both"
        },
        "name": "",
        "onlyChanges": false,
        "x": 520,
        "y": 280,
        "wires": []
    },
    {
        "id": "906bf64ba92f9246",
        "type": "inject",
        "z": "8e798fc93e6ce007",
        "name": "Set Grid Set Point",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 07 * * *",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-20",
        "payloadType": "num",
        "x": 150,
        "y": 280,
        "wires": [
            [
                "a0cef552435bfdba"
            ]
        ]
    },
    {
        "id": "1bf4a183e575b02e",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/SystemSetup/MaxChargeCurrent",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/SystemSetup/MaxChargeCurrent",
            "type": "float",
            "name": "DVCC Charge current limit (A)",
            "mode": "both"
        },
        "name": "",
        "onlyChanges": false,
        "x": 600,
        "y": 120,
        "wires": []
    },
    {
        "id": "39e7ad38ed940d51",
        "type": "inject",
        "z": "8e798fc93e6ce007",
        "name": "Start",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "3600",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 90,
        "y": 520,
        "wires": [
            [
                "91f80cf7d9db846f",
                "37c2c496a6af87db"
            ]
        ]
    },
    {
        "id": "91f80cf7d9db846f",
        "type": "moment",
        "z": "8e798fc93e6ce007",
        "name": "Identify current month",
        "topic": "",
        "input": "payload",
        "inputType": "msg",
        "inTz": "Europe/London",
        "adjAmount": "0",
        "adjType": "days",
        "adjDir": "subtract",
        "format": "MMMM",
        "locale": "London",
        "output": "month",
        "outputType": "msg",
        "outTz": "London",
        "x": 320,
        "y": 520,
        "wires": [
            [
                "15beb0459842335f",
                "8629ad718e3ec467"
            ]
        ]
    },
    {
        "id": "37c2c496a6af87db",
        "type": "debug",
        "z": "8e798fc93e6ce007",
        "name": "[1 - inject] timestamp",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 235,
        "y": 580,
        "wires": [],
        "l": false
    },
    {
        "id": "15beb0459842335f",
        "type": "debug",
        "z": "8e798fc93e6ce007",
        "name": "[2 - date node] get month",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 515,
        "y": 600,
        "wires": [],
        "l": false
    },
    {
        "id": "8629ad718e3ec467",
        "type": "switch",
        "z": "8e798fc93e6ce007",
        "name": "Diff depend on mth",
        "property": "month",
        "propertyType": "msg",
        "rules": [
            {
                "t": "regex",
                "v": "April|May|June|July",
                "vt": "str",
                "case": true
            },
            {
                "t": "regex",
                "v": "March|August",
                "vt": "str",
                "case": true
            },
            {
                "t": "regex",
                "v": "September",
                "vt": "str",
                "case": true
            },
            {
                "t": "regex",
                "v": "October|February",
                "vt": "str",
                "case": true
            },
            {
                "t": "regex",
                "v": "January|November|December",
                "vt": "str",
                "case": true
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 5,
        "x": 590,
        "y": 520,
        "wires": [
            [
                "78bbedd2aec11d5a"
            ],
            [
                "6da4450b1efd86de"
            ],
            [
                "9d6f3ca611908ac0"
            ],
            [
                "4f037c0808887923"
            ],
            [
                "fa58510aec42b983"
            ]
        ]
    },
    {
        "id": "8f31411ce2277ce8",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "It is Apr, May, Jun or Jul",
        "info": "January|February|March|December",
        "x": 1260,
        "y": 360,
        "wires": []
    },
    {
        "id": "b6345f299a623c40",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "It is Nov, Dec or Jan",
        "info": "January|February|March|December",
        "x": 1250,
        "y": 680,
        "wires": []
    },
    {
        "id": "2d00b717308342ba",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "Deploy regex",
        "info": "",
        "x": 590,
        "y": 440,
        "wires": []
    },
    {
        "id": "4b0293d9d3d90043",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
            "type": "integer",
            "name": "Schedule 1: State of charge (%)",
            "mode": "both"
        },
        "name": "Set SOC to 50%",
        "onlyChanges": false,
        "x": 1060,
        "y": 360,
        "wires": []
    },
    {
        "id": "806fe0128a303503",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
            "type": "integer",
            "name": "Schedule 1: State of charge (%)",
            "mode": "both"
        },
        "name": "Set SOC to 60%",
        "onlyChanges": false,
        "x": 1060,
        "y": 440,
        "wires": []
    },
    {
        "id": "63523c9ba9c13cdb",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
            "type": "integer",
            "name": "Schedule 1: State of charge (%)",
            "mode": "both"
        },
        "name": "Set SOC to 75%",
        "onlyChanges": false,
        "x": 1060,
        "y": 520,
        "wires": []
    },
    {
        "id": "c4c9c9c85660d583",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
            "type": "integer",
            "name": "Schedule 1: State of charge (%)",
            "mode": "both"
        },
        "name": "Set SOC to 90%",
        "onlyChanges": false,
        "x": 1060,
        "y": 680,
        "wires": []
    },
    {
        "id": "269e886ae508c08e",
        "type": "victron-output-ess",
        "z": "8e798fc93e6ce007",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/0/Soc",
            "type": "integer",
            "name": "Schedule 1: State of charge (%)",
            "mode": "both"
        },
        "name": "Set SOC to 80%",
        "onlyChanges": false,
        "x": 1060,
        "y": 600,
        "wires": []
    },
    {
        "id": "4e6251b2d5d72024",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "It is Feb or Oct",
        "info": "January|February|March|December",
        "x": 1240,
        "y": 600,
        "wires": []
    },
    {
        "id": "7490536bcb4899e2",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "It is Sep",
        "info": "January|February|March|December",
        "x": 1220,
        "y": 520,
        "wires": []
    },
    {
        "id": "887e6e548e99f62c",
        "type": "comment",
        "z": "8e798fc93e6ce007",
        "name": "It is Mar or Aug",
        "info": "January|February|March|December",
        "x": 1240,
        "y": 440,
        "wires": []
    },
    {
        "id": "0a9c27b7fd113da2",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 220,
        "y": 1080,
        "wires": [
            []
        ]
    },
    {
        "id": "9d6f3ca611908ac0",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "Set Payload to 75%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "75",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 520,
        "wires": [
            [
                "63523c9ba9c13cdb"
            ]
        ]
    },
    {
        "id": "fa58510aec42b983",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "Set Payload to 90%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "90",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 680,
        "wires": [
            [
                "c4c9c9c85660d583"
            ]
        ]
    },
    {
        "id": "4f037c0808887923",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "Set Payload to 76%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "76",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 600,
        "wires": [
            [
                "269e886ae508c08e"
            ]
        ]
    },
    {
        "id": "78bbedd2aec11d5a",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "Set Payload to 50%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "50",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 360,
        "wires": [
            [
                "4b0293d9d3d90043"
            ]
        ]
    },
    {
        "id": "6da4450b1efd86de",
        "type": "change",
        "z": "8e798fc93e6ce007",
        "name": "Set Payload to 60%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "60",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 440,
        "wires": [
            [
                "806fe0128a303503"
            ]
        ]
    }
]

I am not very clued up on Node Red but I have some code that works.

In the above the first part sets the charge current at different times of day - Midnight and 07:00 in my case. You can click on the first two nodes to adjust the current and time. I changed the container for the Victron-output-ESS as the one in this post is more logical.

The second bit of Node Red just sets the Grid Set Point - I was trying to balance consumption from the Grid and the set values available didn’t achieve what I was after so I added that bit of code.

Your post inspired me to do a bit more work in adjusting my scheduled SoC to different levels depending upon the month. In the summer I don’t need my batteries to be charged as high as in the winter. This is a very new addition but appears to be working. Note the SOC charge numbers for Feb/Oct don’t match at the moment. This is because I am going away on holiday at the end of September and I just want to see that the SoC set point changes but I don’t really need it to go to 80% as our consumption will be lower so I have set it to 76% (negligible difference I know, but I am just playing about). When we get back I will adjust it back to 80% throughout.

This last section works with Schedule 1 of ESS - Scheduled Charge Levels. My timer comes on at midnight for 7 hours and the target SoC is set from the Node Red code.

Any constructive comments are most welcome. I based a lot of the code in the month identification section from someone else, but I cannot recall who to give acknowledge them. If you recognise the flow please let me know so that I can correct this omission.

1 Like

Thank you Tony @teejay I’ve successfully deployed the daily MaxChargeRate setting part of your flow, which achieves what I wanted - a “Feed-in Priority” for daytime PV and nighttime charging from grid.

I’ll take a look at the seasonal adjustment part of your flow later, but my system doesn’t recognise the “identify current month, moments” object What does that do?

Much appreciated, David.

1 Like

@dmajwool Hi David, Pleased to see that you have achieved your original objective.

The Inject function (Labelled - Start) obtains the current time/date information. The output (Payload) of that goes to the Date/Time Formatter (Labelled - Identify Current Month), which uses that information to determine what month it is, in MMMM format. That information is passed to the Switch Node (Labelled - Diff depend on mth), which compares the text against text in the switch links. The correct link for the specific month is then selected. The respective Change Node (Labelled - Set Payload to xx%) then has a specific Payload set for the value that I want to be applied to the Scheduled SoC. That information is passed to the Edit ESS Control Node (Labelled - Set SOC to xx%), which sets the xx% value to Schedule 1: State of Charge (%). The result being that when my Schedule 1 is activated (under System Setup, ESS, Scheduled Charge Levels, Schedule 1) the desired SoC level is set for that particular month.

1 Like

Thanks again Tony. I have your “different target SoC per current month” section running now. Interesting idea. I’ll try it and see if it is beneficial with my setup.

One thing that I didn’t mention before about my installation is that I have 1.5kW MPPT and 9kW of AC coupled solar. Having only the MPPT charging the batteries during the day is enough during the summer but of course the daytime solar fades away during the winter. So leaving a larger amount of uncharged space in the batteries on a summer morning (to catch some DC-DC charging during the day) is more efficient than charging from AC solar or grid.

The bit that’s missing from your excellent description is that a plugin is required (on my Cerbo at least) to drive your “identify current month” node. From the Node-RED Manage palate menu I searched for “node-red-contrib-moment” and installed it. Then that node stopped erroring and sprang into life :slight_smile:

1 Like

I tried this approach but it didn’t work. The AC coupled solar kept charging the batteries during the day even when the batteries were way above the target SoC in the scheduled charge.

I don’t understand why this happens. My AC coupled solar is on AC input so I can’t see why it is treated any differently from the other scheduled charge event requesting charge from grid overnight.

Perhaps somewhere in the MP2 code there is a setting that force diverts exports to the battery. “Self-consumption priority” when what I want is “Feed-in priority”

But I’m sorted now thanks to node-RED and @teejay responses in this thread.

1 Like

@dmajwool Thank you for the extra bit of information in your last paragraph. I must have input that extra node at some earlier time. I only implemented the monthly SoC adjustment code in the last few days. It was good to be able to share it. I would really like to acknowledge the person who posted some similar code that I used as a basis, but despite searching I cannot find the source again :frowning: