Node-RED Multiplus Starter Trickle Charge

**Updated flow added April 1 2026

Read this first:** How does the Multiplus trickle charger work

Summary:
For an RV build, I’ve built a Node-RED Flow to control when the Multiplus’ trickle charge circuit is allowed to be connected to the starter battery. I wanted to use the MPs built-in feature, but I wanted it to be switched (on-screen and remotely) and wanted it to be automated, and wanted it to be smarter than just based on voltages or voltage drop. The behavior described in the link above would actually work out just fine for me, but DIY improving it was well worth the effort.

The solution enables using switches (on-screen for me but could be physical+digital-input if desired) in the GX system to toggle the trickle charge on and off. You could do that part without Node-RED. You have more options if you use Node-RED. In the finished product you have the option to fully disable trickle charging, or fully enable it, or let it occur automatically when configured conditions are suitable.

The Outcome:

A 3-state switch is presented in the UI that can be set to Auto, On or Off.
The automated mode waits until the sun is up, gives the starter battery up to 6 hours of trickle charging if warranted, then turns off. This is possible every day, but won’t happen unless the conditions are suitable, including that the starter battery actually needs maintenance charging. Any number of conditions can interrupt and disable the charging if they arise.

  • Auto:
    • May turn on if: the sun is up, OR shore power is connected, AND the starter battery is in low SoC AND the Domestic battery is in good SoC
    • Won’t turn on, Will turn off if: the Domestic battery Voltage is too high for safe AGM charging, OR “enable/disable” switch is off, OR the ignition is on, OR the starter battery is already in good SoC, OR it’s too cold/hot, OR there’s no shore power or PV available.
  • Manual: The user can enable or disable charging regardless of conditions.

Details:

The Node-RED flow handles logic for enabling/disabling the trickle charge circuit conditionally based on all the factors I could think of to include.

  • SoC of the Domestic Battery (Smart Shunt provides)
  • Voltage of Domestic and Starter batteries (Smart Shunt provides)
  • Battery Temperature (MP Provides)
  • Cabin Temperature in starter battery location (instead of actual temp probe on battery)
  • Vehicle Ignition state (Digital Input on GX)
  • Multiplus AC-In state
  • Multiplus on/off/charge/invert switch state
  • MPPT wattage and voltage (to infer available PV power)
  • State of 3-state UI switch

There aren’t many hardware connections. Just the minimally required signals and relay, since the switching is in software.

  • The system is not isolated between Domestic battery and Starter battery. Both batteries are 12V systems. Domestic is LiFePO, Starter is AGM.
  • The MP trickle charge blade is wired to the COMM pin of an external relay controlled by a relay in the GX device. The starter positive circuit is connected to NO pin of that external relay. The external relay just enables me to avoid passing current through the GX onboard relay.
  • An ignition signal wire is connected to a digital input in the GX device via an optocoupler (opto because my GX is a RasPi4 and the input is 5v.)
    • A D+ (engine run) signal would be more appropriate, but in my case ‘Ignition On’ signal was easier available. Beware that if you have autostart or remote start, you could have a vehicle where the engine can run without the ignition being considered “on” or sending that signal. That’s why ‘Engine On’ is a better condition if available.

Pics:

The Flow:

This won’t work out of the box unless your installation is identical to mine. It could be easily reconfigured by anyone who’s already familiar with Node-RED though.

[
    {
        "id": "d554211af8433969",
        "type": "tab",
        "label": "TR Charge V4",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b1ea313624c02296",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Set Limit Values in Flow Context",
        "func": "context.data = context.data || {};\n\nswitch (msg.topic) {\n    case \"HVH\":\n        context.data.hvh = msg.payload;\n        msg = null;\n        break;\n    case \"TEMPLOW\":\n        context.data.templow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPLOW\":\n        context.data.htemplow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPHIGH\":\n        context.data.htemphigh = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVLOW\":\n        context.data.stvlow = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVSUFF\":\n        context.data.stvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"HSOCSUFF\":\n        context.data.hsocsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARVSUFF\":\n        context.data.solarvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARWSUFF\":\n        context.data.solarwsuff = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nflow.set('HOUSEVHIGH',context.data.hvh);\nflow.set('TEMPLOW',context.data.templow);\nflow.set('HTEMPLOW',context.data.htemplow);\nflow.set('HTEMPHIGH',context.data.htemphigh);\nflow.set('STARTVLOW',context.data.stvlow);\nflow.set('STARTVSUFF',context.data.stvsuff);\nflow.set('HSOCSUFF',context.data.hsocsuff);\nflow.set('SOLARVSUFF',context.data.solarvsuff);\nflow.set('SOLARWSUFF',context.data.solarwsuff);\n",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 160,
        "wires": [
            [],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This is used to store the values as flow.context data. "
    },
    {
        "id": "e16aea3266b07db9",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVLOW",
        "payload": "12.50",
        "payloadType": "num",
        "x": 120,
        "y": 40,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c0269fc481fa1d55",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVSUFF",
        "payload": "14.0",
        "payloadType": "num",
        "x": 130,
        "y": 80,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "01cbfc8b9a98576d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House SOC Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HSOCSUFF",
        "payload": "80",
        "payloadType": "num",
        "x": 140,
        "y": 160,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "6413d5a3c9b8d535",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARVSUFF",
        "payload": "12",
        "payloadType": "num",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "3bde1396210daf4d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar W Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARWSUFF",
        "payload": "1",
        "payloadType": "num",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c4dde77756334495",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Ambient Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "TEMPLOW",
        "payload": "2.4",
        "payloadType": "num",
        "x": 130,
        "y": 280,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "f956b125144a76c4",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House V High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HVH",
        "payload": "14.2",
        "payloadType": "num",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "8d3458aa1003f1ad",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Auto-Enable if Conditions Suit",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"INC\":\n        context.data.inc = msg.payload;\n        msg = null;\n        break;\n    case \"STRTR\":\n        context.data.strtr = msg.payload;\n        msg = null;\n        break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null) {\n    \n\t   if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 240 && context.data.mppt >= solarvsuff && context.data.mpptw >= solarwsuff && context.data.ssa == 1 && context.data.strtr == 11 && context.data.inc >= templow ){ //If: STRTV is low, HSOC is suff, No Shore connection, Solar Power Suff, No UISwitch/Ignition/Temp override active\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    }  else if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 0 && (context.data.mpsw == 3 || context.data.mpsw == 1) && context.data.ssa == 1 && context.data.strtr == 11 && context.data.inc >= templow ){ //If: HSOC is suff, Shore Power Available, No UISwitch/Ignition/Temp override active\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    } else return [null,{payload:\"0\"}] // Turn off relay if neither Solar or Shore available\n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 720,
        "wires": [
            [
                "e334c3949a28d67e"
            ],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables trickle charging if the Switch is set to Auto, AND the conditions of the batteries are appropriate for charging, AND one of these conditions are met: A)Shore power is connected B)PV power is available. \nBehavior when the switch is set to On or Off is controlled by a separate function. "
    },
    {
        "id": "a5709779258e3697",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Pv/V",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "MPPT"
        },
        "pathObj": {
            "path": "/Pv/V",
            "type": "float",
            "name": "PV voltage"
        },
        "initial": "",
        "name": "MPPTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "x": 70,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ],
        "outputLabels": [
            "solarA"
        ]
    },
    {
        "id": "b8b6b9634e0b4d4c",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/290",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/290",
            "name": "Main Shunt"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "HSOC",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "x": 70,
        "y": 660,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "aa2ab6cff8fd3b99",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/288",
        "path": "/Ac/ActiveIn/ActiveInput",
        "serviceObj": {
            "service": "com.victronenergy.vebus/288",
            "name": "MultiPlus 12/3000/120-50 120V"
        },
        "pathObj": {
            "path": "/Ac/ActiveIn/ActiveInput",
            "type": "enum",
            "name": "Active input",
            "enum": {
                "0": "AC Input 1",
                "1": "AC Input 2",
                "240": "Disconnected"
            }
        },
        "initial": "",
        "name": "MPIN",
        "onlyChanges": true,
        "outputs": 1,
        "x": 210,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "10e1ddfa6d52f158",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/290",
        "path": "/Dc/1/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/290",
            "name": "Main Shunt"
        },
        "pathObj": {
            "path": "/Dc/1/Voltage",
            "type": "float",
            "name": "Starter battery voltage (V)"
        },
        "name": "STRTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "x": 70,
        "y": 600,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "65afa19d6674c748",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Yield/Power",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "SmartSolar Charger MPPT 100/20 48V"
        },
        "pathObj": {
            "path": "/Yield/Power",
            "type": "float",
            "name": "PV Power (W)"
        },
        "name": "MPPTW",
        "onlyChanges": true,
        "outputs": 1,
        "x": 220,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "e334c3949a28d67e",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 540,
        "y": 680,
        "wires": [
            [
                "b9c2957c9a55b2ad"
            ]
        ]
    },
    {
        "id": "7b221d78614de648",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/288",
        "path": "/Mode",
        "serviceObj": {
            "service": "com.victronenergy.vebus/288",
            "name": "MultiPlus 12/3000/120-50 120V"
        },
        "pathObj": {
            "path": "/Mode",
            "type": "enum",
            "name": "Switch Position",
            "enum": {
                "1": "Charger Only",
                "2": "Inverter Only",
                "3": "On",
                "4": "Off"
            }
        },
        "initial": "",
        "name": "MPSW",
        "onlyChanges": true,
        "outputs": 1,
        "x": 70,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "a3781e69fc70a373",
        "type": "victron-input-digitalinput",
        "z": "d554211af8433969",
        "service": "com.victronenergy.digitalinput/1",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.digitalinput/1",
            "name": "Engine"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "Digital input state",
            "enum": {
                "0": "low",
                "1": "high",
                "2": "off",
                "3": "on",
                "4": "no",
                "5": "yes",
                "6": "open",
                "7": "closed",
                "8": "ok",
                "9": "alarm",
                "10": "running",
                "11": "stopped"
            }
        },
        "initial": "",
        "name": "STRTR",
        "onlyChanges": true,
        "outputs": 1,
        "x": 210,
        "y": 600,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "63e0b7072a30435b",
        "type": "victron-input-temperature",
        "z": "d554211af8433969",
        "service": "com.victronenergy.temperature/101",
        "path": "/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.temperature/101",
            "name": "Garage",
            "communityTag": "temperature"
        },
        "pathObj": {
            "path": "/Temperature",
            "type": "float",
            "name": "Temperature (°C)"
        },
        "name": "INC",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "704601ce78c7d409",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Non-Auto Disable/Enable",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"INC\":\n        context.data.inc = msg.payload;\n        msg = null;\n        break;\n    case \"STRTR\":\n        context.data.strtr = msg.payload;\n        msg = null;\n        break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SS\":\n        context.data.ss = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null ) {\n    \n\t   if  (context.data.ss == 1 && context.data.ssa == 0 ){ //If: Switch set to Manual + On\n\t        return [{payload:\"1\"},null]  // Turn ON relay\n\t        \n\t    }  else if (context.data.hbattv > hvh){ //If: House V is higher than safe AGM charge V\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t   }   else if (context.data.strtr != 11){ //If: Ignition on\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.mpin == 240 && context.data.ssa == 0 && (context.data.mppt < solarvsuff || context.data.mpptw < solarwsuff)){ //If: MP is unplugged and Solar is insufficient \n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t   }   else if (context.data.hsoc < hsocsuff){ //If: HSOC is low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ss == 0 && context.data.ssa == 0 ){ //If: Switch set to Manual + Off\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.inc < templow){ //If: Temp Low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.strtv > stvsuff){ //If: STRTV is sufficient\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else return [null,null] // \n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 510,
        "y": 400,
        "wires": [
            [
                "dfe7935115d435b6"
            ],
            [
                "ac0fea68fde030e9",
                "d7d509c396feeda9"
            ]
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables or disables trickle charging if the Switch is set to On (enables) or Off (disables) or if any conditions arise which should prevent connecting the trickle charge cicuit (temperature, ignition state, batt voltages, etc.)\nBehavior when the switch is set to Auto is controlled by a separate function. "
    },
    {
        "id": "ac0fea68fde030e9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay Off",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 540,
        "y": 440,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "dd77d6309f786032",
        "type": "victron-output-relay",
        "z": "d554211af8433969",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/3/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/3/State",
            "type": "enum",
            "name": "Venus relay 4 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "mode": "both"
        },
        "name": "TR Charge enable (relay4)",
        "onlyChanges": false,
        "outputs": 0,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 810,
        "y": 500,
        "wires": []
    },
    {
        "id": "c99c035a5ea82cc9",
        "type": "trigger",
        "z": "d554211af8433969",
        "name": "Run for 6hrs then Turn Off",
        "op1": "",
        "op2": "0",
        "op1type": "pay",
        "op2type": "num",
        "duration": "6",
        "extend": false,
        "overrideDelay": false,
        "units": "hr",
        "reset": "reset",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 510,
        "y": 560,
        "wires": [
            [
                "dd77d6309f786032",
                "c0e01e95f8a19728"
            ]
        ]
    },
    {
        "id": "b9c2957c9a55b2ad",
        "type": "chronos-filter",
        "z": "d554211af8433969",
        "name": "Only in Daytime",
        "config": "9ff882c27f5e65db",
        "reference": "",
        "referenceType": "absTime",
        "baseTime": "",
        "baseTimeType": "msgIngress",
        "evaluation": "",
        "evaluationType": "and",
        "conditions": [
            {
                "operator": "between",
                "operands": [
                    {
                        "type": "time",
                        "value": "10:30",
                        "offset": 0,
                        "random": 0,
                        "precision": "minute"
                    },
                    {
                        "type": "time",
                        "value": "17:00",
                        "offset": 0,
                        "random": 0,
                        "precision": "minute"
                    }
                ]
            }
        ],
        "x": 540,
        "y": 640,
        "wires": [
            [
                "87c6317706115d73"
            ]
        ]
    },
    {
        "id": "87c6317706115d73",
        "type": "delay",
        "z": "d554211af8433969",
        "name": "check 4x/hr",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "4",
        "nbRateUnits": "1",
        "rateUnits": "hour",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 550,
        "y": 600,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "5753a6862759c46e",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/290",
        "path": "/Dc/0/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/290",
            "name": "House Batt"
        },
        "pathObj": {
            "path": "/Dc/0/Voltage",
            "type": "float",
            "name": "Battery voltage (V)"
        },
        "name": "HV",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "x": 210,
        "y": 660,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "dfe7935115d435b6",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 540,
        "y": 360,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "ce67ee284a7f7b2c",
        "type": "victron-virtual-switch",
        "z": "d554211af8433969",
        "name": "3-State Switch for UI",
        "outputs": 2,
        "switch_1_type": 9,
        "switch_1_initial": 0,
        "switch_1_label": "",
        "switch_1_customname": "Starter Trickle Charge V4",
        "switch_1_group": "Power",
        "switch_1_include_measurement": false,
        "switch_1_rgb_color_wheel": false,
        "switch_1_cct_wheel": false,
        "switch_1_rgb_white_dimmer": false,
        "x": 400,
        "y": 40,
        "wires": [
            [],
            []
        ],
        "info": "This creates the switch in the UI that will be used to set the On/Off/Auto state by the user."
    },
    {
        "id": "839a5304919bb3dd",
        "type": "victron-input-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge state",
            "mode": "both"
        },
        "name": "3SS",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 420,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "ae6eec175e55e3cf",
        "type": "victron-input-custom",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/Auto",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI (100)"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/Auto",
            "name": "/SwitchableOutput/output_1/Auto",
            "type": "number",
            "value": 1
        },
        "name": "3SSA",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 70,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "c0e01e95f8a19728",
        "type": "victron-output-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge V4 state",
            "mode": "both"
        },
        "name": "",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 0,
        "conditionalMode": false,
        "condition1Operator": ">",
        "condition2Enabled": false,
        "condition2Service": "",
        "condition2Path": "",
        "condition2Operator": ">",
        "logicOperator": "AND",
        "outputTrue": "true",
        "outputFalse": "false",
        "outputOnChange": false,
        "debounce": 2000,
        "x": 850,
        "y": 560,
        "wires": []
    },
    {
        "id": "d7d509c396feeda9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Reset Timer",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "reset",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 550,
        "y": 480,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "17c52f32e678c001",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/288",
        "path": "/Dc/0/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.vebus/288",
            "name": "Invrtr/Chrgr",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Dc/0/Temperature",
            "type": "float",
            "name": "Battery temperature (°C)"
        },
        "name": "HBTI",
        "onlyChanges": false,
        "roundValues": "2",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 720,
        "wires": [
            []
        ]
    },
    {
        "id": "bd2378e89652e448",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPLOW",
        "payload": "-10",
        "payloadType": "num",
        "x": 140,
        "y": 320,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "912ef8db9cb8e564",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPHIGH",
        "payload": "50",
        "payloadType": "num",
        "x": 140,
        "y": 360,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "9ff882c27f5e65db",
        "type": "chronos-config",
        "name": "home",
        "latitudeType": "num",
        "longitudeType": "num",
        "timezone": "",
        "timezoneType": "str",
        "sunPositions": []
    },
    {
        "id": "46798f57a5cf1516",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.6.63",
            "node-red-contrib-chronos": "1.29.3"
        }
    }
]
2 Likes

To keep this post clean, I’ve replaced the original content with updated content instead of just adding the update as a comment. This is the 4th version of the flow. There’s not much worth seeing in the 3rd version that was previously documented. If you want to see it you can look at the edit history.

Hello, I found this solution really smart and tried to reproduce it (it’s really the case !) in my system. I more or less replicated and copied the entire flow, just adjusted to my devices as in below.

You can see that I replaced the STRTR (Engine On digital input) by a node depending on the state of my ORION DC-DC charger (when state is >0 , which means not OFF) the engine is considered to be ON and the trickle charger would stop. Do you think it could work ?

Not being an expert in Node-Red, I tried to adjust the functions code as follow:

For the “Non-Auto Disable/Enable” function: (only modified line shown below)

switch (msg.topic) {   
case "ORION":
        context.data.orion = msg.payload;
        msg = null;
        break;

    }   else if (context.data.orion > 0){ //If: Ignition on (Orion is not OFF --> >0)
        return [null,{payload:"0"}]  // Turn off relay     
   
  //}   else if (context.data.strtr != 11){ //If: Ignition on
  //     return [null,{payload:"0"}]  // Turn off relay

For the “Auto-Enable if Conditions suit” function : (only modified lines)

switch (msg.topic) {

case “ORION”:
context.data.orion = msg.payload;
msg = null;
break;
	   
if(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null) {
    
	   if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 240 && context.data.mppt >= solarvsuff && context.data.mpptw >= solarwsuff && context.data.ssa == 1 && context.data.orion > 0 && context.data.inc >= templow ){ //If: STRTV is low, HSOC is suff, No Shore connection, Solar Power Suff, No UISwitch/Ignition/Temp override active
	        return [{payload:"1"},null]  // Turn on relay
	        
	    }  else if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 0 && (context.data.mpsw == 3 || context.data.mpsw == 1) && context.data.ssa == 1 && context.data.orion > 0 && context.data.inc >= templow ){ //If: HSOC is suff, Shore Power Available, No UISwitch/Ignition/Temp override active
	        return [{payload:"1"},null]  // Turn on relay

I would appreciate any input/comment/correction you would advise to do

Please note also that I get there a small error message on the “Only in Daytime” node, which seems to be badly configured - I don’t see what is wrong there and would appreciate any help :slight_smile:

Hereafter is the attached json file of the whole flux - sorry I was not enable to have it appearing as the nice Node-Red diagram of Mark Kieran, but hopefully you can use/read it

Regards

[
    {
        "id": "d554211af8433969",
        "type": "tab",
        "label": "TR Charge AT",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b1ea313624c02296",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Set Limit Values in Flow Context",
        "func": "context.data = context.data || {};\n\nswitch (msg.topic) {\n    case \"HVH\":\n        context.data.hvh = msg.payload;\n        msg = null;\n        break;\n    case \"TEMPLOW\":\n        context.data.templow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPLOW\":\n        context.data.htemplow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPHIGH\":\n        context.data.htemphigh = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVLOW\":\n        context.data.stvlow = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVSUFF\":\n        context.data.stvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"HSOCSUFF\":\n        context.data.hsocsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARVSUFF\":\n        context.data.solarvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARWSUFF\":\n        context.data.solarwsuff = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nflow.set('HOUSEVHIGH',context.data.hvh);\nflow.set('TEMPLOW',context.data.templow);\nflow.set('HTEMPLOW',context.data.htemplow);\nflow.set('HTEMPHIGH',context.data.htemphigh);\nflow.set('STARTVLOW',context.data.stvlow);\nflow.set('STARTVSUFF',context.data.stvsuff);\nflow.set('HSOCSUFF',context.data.hsocsuff);\nflow.set('SOLARVSUFF',context.data.solarvsuff);\nflow.set('SOLARWSUFF',context.data.solarwsuff);\n",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 160,
        "wires": [
            [],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This is used to store the values as flow.context data. "
    },
    {
        "id": "e16aea3266b07db9",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVLOW",
        "payload": "12.50",
        "payloadType": "num",
        "x": 120,
        "y": 40,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c0269fc481fa1d55",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVSUFF",
        "payload": "14.0",
        "payloadType": "num",
        "x": 130,
        "y": 80,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "01cbfc8b9a98576d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House SOC Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HSOCSUFF",
        "payload": "80",
        "payloadType": "num",
        "x": 140,
        "y": 160,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "6413d5a3c9b8d535",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARVSUFF",
        "payload": "12",
        "payloadType": "num",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "3bde1396210daf4d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar W Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARWSUFF",
        "payload": "1",
        "payloadType": "num",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c4dde77756334495",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Ambient Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "TEMPLOW",
        "payload": "5",
        "payloadType": "num",
        "x": 130,
        "y": 280,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "f956b125144a76c4",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House V High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HVH",
        "payload": "14.2",
        "payloadType": "num",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "8d3458aa1003f1ad",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Auto-Enable if Conditions Suit",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"INC\":\n        context.data.inc = msg.payload;\n        msg = null;\n        break;\n    case \"STRTR\":\n        context.data.strtr = msg.payload;\n        msg = null;\n        break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n\n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null) {\n    \n\t   if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 240 && context.data.mppt >= solarvsuff && context.data.mpptw >= solarwsuff && context.data.ssa == 1 && context.data.orion > 0 && context.data.inc >= templow ){ //If: STRTV is low, HSOC is suff, No Shore connection, Solar Power Suff, No UISwitch/Ignition/Temp override active\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    }  else if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 0 && (context.data.mpsw == 3 || context.data.mpsw == 1) && context.data.ssa == 1 && context.data.orion > 0 && context.data.inc >= templow ){ //If: HSOC is suff, Shore Power Available, No UISwitch/Ignition/Temp override active\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    } else return [null,{payload:\"0\"}] // Turn off relay if neither Solar or Shore available\n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 740,
        "wires": [
            [
                "e334c3949a28d67e"
            ],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables trickle charging if the Switch is set to Auto, AND the conditions of the batteries are appropriate for charging, AND one of these conditions are met: A)Shore power is connected B)PV power is available. \nBehavior when the switch is set to On or Off is controlled by a separate function. "
    },
    {
        "id": "a5709779258e3697",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Pv/V",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Pv/V",
            "type": "float",
            "name": "PV voltage"
        },
        "initial": "",
        "name": "MPPTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ],
        "outputLabels": [
            "solarA"
        ]
    },
    {
        "id": "b8b6b9634e0b4d4c",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "HSOC",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 660,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "aa2ab6cff8fd3b99",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Ac/ActiveIn/ActiveInput",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Ac/ActiveIn/ActiveInput",
            "type": "enum",
            "name": "Active input",
            "enum": {
                "0": "AC Input 1",
                "1": "AC Input 2",
               "240": "Disconnected"
            }
        },
        "initial": "",
        "name": "MPIN",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 210,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "10e1ddfa6d52f158",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/1/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/1/Voltage",
            "type": "float",
            "name": "Starter battery voltage (V)"
        },
        "name": "STRTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 600,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "65afa19d6674c748",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Yield/Power",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Yield/Power",
            "type": "float",
            "name": "PV Power (W)"
        },
        "name": "MPPTW",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 220,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "e334c3949a28d67e",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 740,
        "wires": [
            [
                "b9c2957c9a55b2ad"
            ]
        ]
    },
    {
        "id": "7b221d78614de648",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Mode",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Mode",
            "type": "enum",
            "name": "Switch Position",
            "enum": {
                "1": "Charger Only",
                "2": "Inverter Only",
                "3": "On",
                "4": "Off"
            },
            "mode": "both"
        },
        "initial": "",
        "name": "MPSW",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "63e0b7072a30435b",
        "type": "victron-input-temperature",
        "z": "d554211af8433969",
        "service": "com.victronenergy.temperature/24",
        "path": "/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.temperature/24",
            "name": "Température coffre électrique",
            "communityTag": "temperature"
        },
        "pathObj": {
            "path": "/Temperature",
            "type": "float",
            "name": "Temperature (°C)"
        },
        "name": "INC",
        "onlyChanges": false,
        "roundValues": "1",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "704601ce78c7d409",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Non-Auto Disable/Enable",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"INC\":\n        context.data.inc = msg.payload;\n        msg = null;\n        break;\n    case \"STRTR\":\n        context.data.strtr = msg.payload;\n        msg = null;\n        break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SS\":\n        context.data.ss = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n    \n    \n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null ) {\n    \n\t   if  (context.data.ss == 1 && context.data.ssa == 0 ){ //If: Switch set to Manual + On\n\t        return [{payload:\"1\"},null]  // Turn ON relay\n\t        \n\t    }  else if (context.data.hbattv > hvh){ //If: House V is higher than safe AGM charge V\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t \n\t    }   else if (context.data.orion > 0){ //If: Ignition on (Orion is not OFF --> >0)\n\t        return [null,{payload:\"0\"}]  // Turn off relay     \n\t   \n\t  //}   else if (context.data.strtr != 11){ //If: Ignition on\n\t  //     return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.mpin == 240 && context.data.ssa == 0 && (context.data.mppt < solarvsuff || context.data.mpptw < solarwsuff)){ //If: MP is unplugged and Solar is insufficient \n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t   }   else if (context.data.hsoc < hsocsuff){ //If: HSOC is low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ss == 0 && context.data.ssa == 0 ){ //If: Switch set to Manual + Off\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.inc < templow){ //If: Temp Low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.strtv > stvsuff){ //If: STRTV is sufficient\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else return [null,null] // \n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 470,
        "y": 380,
        "wires": [
            [
                "dfe7935115d435b6"
            ],
            [
                "ac0fea68fde030e9",
                "d7d509c396feeda9"
            ]
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables or disables trickle charging if the Switch is set to On (enables) or Off (disables) or if any conditions arise which should prevent connecting the trickle charge cicuit (temperature, ignition state, batt voltages, etc.)\nBehavior when the switch is set to Auto is controlled by a separate function. "
    },
    {
        "id": "ac0fea68fde030e9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay Off",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 420,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "dd77d6309f786032",
        "type": "victron-output-relay",
        "z": "d554211af8433969",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "mode": "both"
        },
        "name": "TR Charger enable (relay2)",
        "onlyChanges": false,
        "outputs": 0,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 1020,
        "y": 480,
        "wires": []
    },
    {
        "id": "c99c035a5ea82cc9",
        "type": "trigger",
        "z": "d554211af8433969",
        "name": "Run for 6hrs then Turn Off",
        "op1": "",
        "op2": "0",
        "op1type": "pay",
        "op2type": "num",
        "duration": "6",
        "extend": false,
        "overrideDelay": false,
        "units": "hr",
        "reset": "reset",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 730,
        "y": 540,
        "wires": [
            [
                "dd77d6309f786032",
                "c0e01e95f8a19728"
            ]
        ]
    },
    {
        "id": "87c6317706115d73",
        "type": "delay",
        "z": "d554211af8433969",
        "name": "check 4x/hr",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "4",
        "nbRateUnits": "1",
        "rateUnits": "hour",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 690,
        "y": 600,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "5753a6862759c46e",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/0/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/0/Voltage",
            "type": "float",
            "name": "Battery voltage (V)"
        },
        "name": "HV",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 210,
        "y": 660,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "dfe7935115d435b6",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 380,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "ce67ee284a7f7b2c",
        "type": "victron-virtual-switch",
        "z": "d554211af8433969",
        "name": "3-State Switch for UI",
        "outputs": 2,
        "switch_1_type": "9",
        "switch_1_initial": 0,
        "switch_1_label": "",
        "switch_1_customname": "Starter Trickle Charge V4",
        "switch_1_group": "Power",
        "switch_1_include_measurement": false,
        "switch_1_rgb_color_wheel": false,
        "switch_1_cct_wheel": false,
        "switch_1_rgb_white_dimmer": false,
        "x": 400,
        "y": 40,
        "wires": [
            [],
            []
        ],
        "info": "This creates the switch in the UI that will be used to set the On/Off/Auto state by the user."
    },
    {
        "id": "c0e01e95f8a19728",
        "type": "victron-output-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge V4 state",
            "mode": "both"
        },
        "name": "",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 0,
        "conditionalMode": false,
        "condition1Operator": ">",
        "condition2Enabled": false,
        "condition2Service": "",
        "condition2Path": "",
        "condition2Operator": ">",
        "logicOperator": "AND",
        "outputTrue": "true",
        "outputFalse": "false",
        "outputOnChange": false,
        "debounce": 2000,
        "x": 1050,
        "y": 600,
        "wires": []
    },
    {
        "id": "d7d509c396feeda9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Reset Timer",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "reset",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 690,
        "y": 460,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "17c52f32e678c001",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Dc/0/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Dc/0/Temperature",
            "type": "float",
            "name": "Battery temperature (°C)"
        },
        "name": "HBTI",
        "onlyChanges": false,
        "roundValues": "2",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 720,
        "wires": [
            []
        ]
    },
    {
        "id": "bd2378e89652e448",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPLOW",
        "payload": "-10",
        "payloadType": "num",
        "x": 140,
        "y": 320,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "912ef8db9cb8e564",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPHIGH",
        "payload": "50",
        "payloadType": "num",
        "x": 140,
        "y": 360,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "b9c2957c9a55b2ad",
        "type": "chronos-filter",
        "z": "d554211af8433969",
        "name": "Only in Daytime",
        "config": "9ff882c27f5e65db",
        "reference": "",
        "referenceType": "absTime",
        "baseTime": "",
        "baseTimeType": "msgIngress",
        "evaluation": "",
        "evaluationType": "and",
        "conditions": [
            {
                "operator": "between",
                "operands": [
                    {
                        "type": "time",
                        "value": "10:30",
                        "offset": 0,
                        "random": 0,
                        "precision": "minute"
                    },
                    {
                        "type": "time",
                        "value": "17:00",
                        "offset": 0,
                        "random": 0,
                        "precision": "minute"
                    }
                ]
            }
        ],
        "x": 700,
        "y": 660,
        "wires": [
            [
                "87c6317706115d73"
            ]
        ]
    },
    {
        "id": "a99cb9d9316290c5",
        "type": "victron-input-custom",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/Auto",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI (100)"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/Auto",
            "name": "/SwitchableOutput/output_1/Auto",
            "type": "number",
            "value": 1
        },
        "name": "3SSA",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 70,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "b14666dd70cd09df",
        "type": "victron-input-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge state",
            "mode": "both"
        },
        "name": "3SS",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "67950dc9bef2d557",
        "type": "victron-input-alternator",
        "z": "d554211af8433969",
        "service": "com.victronenergy.alternator/277",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.alternator/277",
            "name": "Chargeur en roulant ",
            "communityTag": "alternator"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "Alternator state",
            "enum": {
                "0": "Off",
                "2": "Fault",
                "3": "Bulk",
                "4": "Absorption",
                "5": "Float",
                "6": "Storage",
                "7": "Equalize",
                "11": "Psu",
                "252": "External control"
            }
        },
        "name": "Orion",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 600,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "a3781e69fc70a373",
        "type": "victron-input-digitalinput",
        "z": "d554211af8433969",
        "service": "com.victronenergy.digitalinput/1",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.digitalinput/1",
            "name": "Engine"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "Digital input state",
            "enum": {
                "0": "low",
                "1": "high",
                "2": "off",
                "3": "on",
                "4": "no",
                "5": "yes",
                "6": "open",
                "7": "closed",
                "8": "ok",
                "9": "alarm",
                "10": "running",
                "11": "stopped"
            }
        },
        "initial": "",
        "name": "STRTR",
        "onlyChanges": true,
        "outputs": 1,
        "x": 210,
        "y": 840,
        "wires": [
            []
        ]
    },
    {
        "id": "9ff882c27f5e65db",
        "type": "chronos-config",
        "name": "home",
        "latitudeType": "num",
        "longitudeType": "num",
        "timezone": "",
        "timezoneType": "str",
        "sunPositions": []
    },
    {
        "id": "6f5a2f7be26073fa",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.6.63",
            "node-red-contrib-chronos": "1.30.0"
        }
    }
]
1 Like

The only in daytime node requires this add-on node. I wonder if you just need to enable that to overcome the configuration error.
node-red-contrib-chronos

Hi Mark, the add-on was suggested automatically and I installed it. It made my system to recognise the Node but still apparently wrongly configured…

1 Like

I can’t look at the second flow you pasted, because I get errors for invalid characters when I try to import it. I had the same problem with the first one you added but I was able to guess what to remove to fix it. Maybe if you show us a picture of what you see when you edit that node, someone will be able to see what’s wrong with it.

To add flows in a way that transfers and displays properly in this forum, click the + icon in the editor, then select “node-RED flow.”

There appears to be errors in the cut and pastes, some times special characters are introduced.

1 Like

yeah, it looks like an app removed all the straight double quotes and replaced them with different ones.

I have had an agent parse it and fix the formatting errors. Hopefully it works now.

1 Like

Thanks for helping fixing the issue with my script ‘paste’ operation- appreciated ! :slight_smile:

here below is the image of what I see when opening the node ‘Only in Daytime’:

If someone is able to advise what is wrong …

Here is also a copy of the list of Nodes that became available with the suggested add-on:, maybe thereis one in the list that is more appropriate or easier to use than the filter ? (the scheduler ?)

Thanks in advance for your feedback

I didn’t have the same issue with the “Only in Daytime” node when I imported your flow. Maybe try creating a new Configration in the node settings, to replace “home.” Home is an artifact of my example, so my hope is that replacing it will fix something.

Thanks Mark, I replaced Home by something else (Personel) and found that I should configure this setting with the GPS coordinates of my location. Once I did it, it fixed the bad configuration issue. Now I have to test if it does want I want :slight_smile: . I guess the actual time specified in the filter may be impacted by the time zone I will be traveling in …

[
    {
        "id": "d554211af8433969",
        "type": "tab",
        "label": "TR Charge AT",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b1ea313624c02296",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Set Limit Values in Flow Context",
        "func": "context.data = context.data || {};\n\n\n\n\n\nswitch (msg.topic) {                    /// regarde la valeur de Msg.topic et agit en conséquence\n    case \"HVH\":\n        context.data.hvh = msg.payload; /// stocke msg.payload dans hvh\n        msg = null;                     /// ne laisse pas sortir le message\n        break;                          /// sort du switch et considère le cas suivant\n    case \"TEMPLOW\":\n        context.data.templow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPLOW\":\n        context.data.htemplow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPHIGH\":\n        context.data.htemphigh = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVLOW\":\n        context.data.stvlow = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVSUFF\":\n        context.data.stvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"HSOCSUFF\":\n        context.data.hsocsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARVSUFF\":\n        context.data.solarvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARWSUFF\":\n        context.data.solarwsuff = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n}\nflow.set('HOUSEVHIGH',context.data.hvh);            /// prend la valeur hvh et la stocke dabs la variable HOUSEVHIGH (variable flow est accessible dans tout le flow (onglet) alors que dta.context n'est accessible que dans le noeud)\nflow.set('TEMPLOW',context.data.templow);\nflow.set('HTEMPLOW',context.data.htemplow);\nflow.set('HTEMPHIGH',context.data.htemphigh);\nflow.set('STARTVLOW',context.data.stvlow);\nflow.set('STARTVSUFF',context.data.stvsuff);\nflow.set('HSOCSUFF',context.data.hsocsuff);\nflow.set('SOLARVSUFF',context.data.solarvsuff);\nflow.set('SOLARWSUFF',context.data.solarwsuff);\n\n\n\n",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 160,
        "wires": [
            [],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This is used to store the values as flow.context data. "
    },
    {
        "id": "e16aea3266b07db9",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVLOW",
        "payload": "12.5",
        "payloadType": "num",
        "x": 120,
        "y": 40,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "Voltage of starter battery that should trigger charging with trickle charger\n= minimum Starter voltage accepted"
    },
    {
        "id": "c0269fc481fa1d55",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVSUFF",
        "payload": "14",
        "payloadType": "num",
        "x": 130,
        "y": 80,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "Voltage of starter battery which is considered as sufficient - no need to charge beyond this voltage"
    },
    {
        "id": "01cbfc8b9a98576d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House SOC Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HSOCSUFF",
        "payload": "80",
        "payloadType": "num",
        "x": 140,
        "y": 160,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "we want the House battery by well charged before transfering part of the charge to the starter battery --> the SOC of the house battery should be high enough"
    },
    {
        "id": "6413d5a3c9b8d535",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARVSUFF",
        "payload": "12",
        "payloadType": "num",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "3bde1396210daf4d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar W Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARWSUFF",
        "payload": "1",
        "payloadType": "num",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c4dde77756334495",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Ambient Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "TEMPLOW",
        "payload": "5",
        "payloadType": "num",
        "x": 130,
        "y": 280,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "f956b125144a76c4",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House V High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HVH",
        "payload": "14.2",
        "payloadType": "num",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "High value of the house battery - higher voltage would be an issue to charge the starter battery by trickle charger (HVH -0,3V) should be the max acceptable for the starter battery"
    },
    {
        "id": "8d3458aa1003f1ad",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Auto-Enable if Conditions Suit",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"AMBTemp\":\n        context.data.ambtemp = msg.payload;\n        msg = null;\n        break;\n    //case \"STRTR\":\n      //  context.data.strtr = msg.payload;\n      //  msg = null;\n      //  break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n\n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null) {\n    \n\t   if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 240 && context.data.mppt >= solarvsuff && context.data.mpptw >= solarwsuff && context.data.ssa == 1 && context.data.orion === 0 && context.data.ambtemp >= templow ){ \n\t       \n\t       //Condition générale si charge par le solaire: If hbat < safe max value, STRTV is < lower limit, HSOC is suff, No Shore connection, Solar Power Suff (2 criteria V & W), si UI switch est en AUTO, si Orion en OFF, si temp ambiante > minimum\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    }  else if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.mpin == 0 && (context.data.mpsw == 3 || context.data.mpsw == 1) && context.data.ssa == 1 && context.data.orion === 0 && context.data.ambtemp >= templow ){ \n\t        //Condition générale si charge par le Multiplus 220V :If hbat < safe max value, STRTV is < lower limit, HSOC is suff, MP ACin disponible, Multiplus en mode chargeur ou on, si UI switch est en AUTO, si Orion est OFF, si temp ambiante > minimum\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    } else return [null,{payload:\"0\"}] // Turn off relay if neither Solar or Shore available\n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 740,
        "wires": [
            [
                "e334c3949a28d67e"
            ],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables trickle charging if the Switch is set to Auto, AND the conditions of the batteries are appropriate for charging, AND one of these conditions are met: A)Shore power is connected B)PV power is available. \nBehavior when the switch is set to On or Off is controlled by a separate function. "
    },
    {
        "id": "a5709779258e3697",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Pv/V",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Pv/V",
            "type": "float",
            "name": "PV voltage"
        },
        "initial": "",
        "name": "MPPTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ],
        "outputLabels": [
            "solarA"
        ]
    },
    {
        "id": "b8b6b9634e0b4d4c",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "HSOC",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 660,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "aa2ab6cff8fd3b99",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Ac/ActiveIn/ActiveInput",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Ac/ActiveIn/ActiveInput",
            "type": "enum",
            "name": "Active input",
            "enum": {
                "0": "AC Input 1",
                "1": "AC Input 2",
                "240": "Disconnected"
            }
        },
        "initial": "",
        "name": "MPIN",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 210,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "10e1ddfa6d52f158",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/1/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/1/Voltage",
            "type": "float",
            "name": "Starter battery voltage (V)"
        },
        "name": "STRTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 600,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "65afa19d6674c748",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Yield/Power",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Yield/Power",
            "type": "float",
            "name": "PV Power (W)"
        },
        "name": "MPPTW",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 220,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "e334c3949a28d67e",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 740,
        "wires": [
            [
                "cf03545dbdf2a85b"
            ]
        ]
    },
    {
        "id": "7b221d78614de648",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Mode",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Mode",
            "type": "enum",
            "name": "Switch Position",
            "enum": {
                "1": "Charger Only",
                "2": "Inverter Only",
                "3": "On",
                "4": "Off"
            },
            "mode": "both"
        },
        "initial": "",
        "name": "MPSW",
        "onlyChanges": true,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 70,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "63e0b7072a30435b",
        "type": "victron-input-temperature",
        "z": "d554211af8433969",
        "service": "com.victronenergy.temperature/24",
        "path": "/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.temperature/24",
            "name": "Température coffre électrique",
            "communityTag": "temperature"
        },
        "pathObj": {
            "path": "/Temperature",
            "type": "float",
            "name": "Temperature (°C)"
        },
        "name": "AMBTemp",
        "onlyChanges": false,
        "roundValues": "1",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 80,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ]
        ]
    },
    {
        "id": "704601ce78c7d409",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Non-Auto Disable/Enable",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"AMBTemp\":\n        context.data.ambtemp = msg.payload;\n        msg = null;\n        break;\n    //case \"STRTR\":\n       // context.data.strtr = msg.payload;\n      //  msg = null;\n       // break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SS\":\n        context.data.ss = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n    \n    \n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null ) {  /// si variables (MPPT voltage, Starter battery voltage et home SOC) ont une valeur et ne sont pas vides, on execute la suite\n    \n\t   if  (context.data.ss == 1 && context.data.ssa == 0 ){ //If: Switch set to Manual + On\n\t        return [{payload:\"1\"},null]  // Turn ON relay, si cette condition est fausse (c'est à dire que le switch 3SS n'est pas en manuel / ON, alors vérifie la condition suivante de 'else if'(et le relai n'est pas activé)\n\t        \n\t    }  else if (context.data.hbattv > hvh){ //If: House V is higher than safe AGM charge V\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t \n\t    }   else if (context.data.orion == 3 || context.data.orion == 4 || context.data.orion == 5){\t        //If: Ignition on (Orion is either in bulk (3), absorb (4) or float (5))\n\t        return [null,{payload:\"0\"}]  // Turn off relay     \n\t\n\t    }   else if (context.data.mpin == 240 && context.data.ssa == 0 && (context.data.mppt < solarvsuff || context.data.mpptw < solarwsuff)){ //If: MP is unplugged and Switch is not in AUTO mode and Solar is insufficient \n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t   }   else if (context.data.hsoc < hsocsuff){ //If: HSOC is low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ss == 0 && context.data.ssa == 0 ){ //If: Switch set to Manual + Off\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ambtemp < templow){ //If: Temp Low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.strtv > stvsuff){ //If: STRTV is sufficient\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else return [null,null] // \n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 450,
        "y": 420,
        "wires": [
            [
                "dfe7935115d435b6"
            ],
            [
                "ac0fea68fde030e9",
                "d7d509c396feeda9"
            ]
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables or disables trickle charging if the Switch is set to On (enables) or Off (disables) or if any conditions arise which should prevent connecting the trickle charge cicuit (temperature, ignition state, batt voltages, etc.)\nBehavior when the switch is set to Auto is controlled by a separate function. "
    },
    {
        "id": "ac0fea68fde030e9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay Off",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 420,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "dd77d6309f786032",
        "type": "victron-output-relay",
        "z": "d554211af8433969",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "mode": "both"
        },
        "name": "TR Charger enable (relay2)",
        "onlyChanges": false,
        "outputs": 0,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 1020,
        "y": 480,
        "wires": []
    },
    {
        "id": "c99c035a5ea82cc9",
        "type": "trigger",
        "z": "d554211af8433969",
        "name": "Run for 6hrs then Turn Off",
        "op1": "",
        "op2": "0",
        "op1type": "pay",
        "op2type": "num",
        "duration": "6",
        "extend": false,
        "overrideDelay": false,
        "units": "hr",
        "reset": "reset",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 730,
        "y": 540,
        "wires": [
            [
                "dd77d6309f786032",
                "c0e01e95f8a19728"
            ]
        ]
    },
    {
        "id": "87c6317706115d73",
        "type": "delay",
        "z": "d554211af8433969",
        "name": "check 4x/hr",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "4",
        "nbRateUnits": "1",
        "rateUnits": "hour",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 690,
        "y": 600,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "5753a6862759c46e",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/0/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/0/Voltage",
            "type": "float",
            "name": "Battery voltage (V)"
        },
        "name": "HV",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 210,
        "y": 660,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "dfe7935115d435b6",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 380,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "ce67ee284a7f7b2c",
        "type": "victron-virtual-switch",
        "z": "d554211af8433969",
        "name": "3-State Switch for UI",
        "outputs": 2,
        "switch_1_type": "9",
        "switch_1_initial": 0,
        "switch_1_label": "",
        "switch_1_customname": "Starter Trickle Charge V4",
        "switch_1_group": "Power",
        "switch_1_include_measurement": false,
        "switch_1_rgb_color_wheel": false,
        "switch_1_cct_wheel": false,
        "switch_1_rgb_white_dimmer": false,
        "x": 400,
        "y": 40,
        "wires": [
            [],
            []
        ],
        "info": "This creates the switch in the UI that will be used to set the On/Off/Auto state by the user."
    },
    {
        "id": "c0e01e95f8a19728",
        "type": "victron-output-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge V4 state",
            "mode": "both"
        },
        "name": "",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 0,
        "conditionalMode": false,
        "condition1Operator": ">",
        "condition2Enabled": false,
        "condition2Service": "",
        "condition2Path": "",
        "condition2Operator": ">",
        "logicOperator": "AND",
        "outputTrue": "true",
        "outputFalse": "false",
        "outputOnChange": false,
        "debounce": 2000,
        "x": 1050,
        "y": 600,
        "wires": []
    },
    {
        "id": "d7d509c396feeda9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Reset Timer",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "reset",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 690,
        "y": 460,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "17c52f32e678c001",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Dc/0/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Dc/0/Temperature",
            "type": "float",
            "name": "Battery temperature (°C)"
        },
        "name": "HBTI",
        "onlyChanges": false,
        "roundValues": "2",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "bd2378e89652e448",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPLOW",
        "payload": "5",
        "payloadType": "num",
        "x": 140,
        "y": 320,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "912ef8db9cb8e564",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPHIGH",
        "payload": "50",
        "payloadType": "num",
        "x": 140,
        "y": 360,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "a99cb9d9316290c5",
        "type": "victron-input-custom",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/Auto",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI (100)"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/Auto",
            "name": "/SwitchableOutput/output_1/Auto",
            "type": "number",
            "value": 1
        },
        "name": "3SSA",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 70,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "b14666dd70cd09df",
        "type": "victron-input-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge state",
            "mode": "both"
        },
        "name": "3SS",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "67950dc9bef2d557",
        "type": "victron-input-alternator",
        "z": "d554211af8433969",
        "service": "com.victronenergy.alternator/277",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.alternator/277",
            "name": "Chargeur en roulant ",
            "communityTag": "alternator"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "Alternator state",
            "enum": {
                "0": "Off",
                "2": "Fault",
                "3": "Bulk",
                "4": "Absorption",
                "5": "Float",
                "6": "Storage",
                "7": "Equalize",
                "11": "Psu",
                "252": "External control"
            }
        },
        "name": "Orion",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 600,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "05dae33a8cd8e31a",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "",
        "info": "",
        "x": 650,
        "y": 40,
        "wires": []
    },
    {
        "id": "cf03545dbdf2a85b",
        "type": "chronos-filter",
        "z": "d554211af8433969",
        "name": "During Daytime only (AT)",
        "config": "9ff882c27f5e65db",
        "reference": "",
        "referenceType": "absTime",
        "baseTime": "",
        "baseTimeType": "msgIngress",
        "evaluation": "",
        "evaluationType": "and",
        "conditions": [
            {
                "operator": "between",
                "operands": [
                    {
                        "type": "time",
                        "value": "10:30",
                        "offset": 1,
                        "random": 1,
                        "precision": "minute"
                    },
                    {
                        "type": "time",
                        "value": "17:00",
                        "offset": 1,
                        "random": 1,
                        "precision": "minute"
                    }
                ]
            }
        ],
        "x": 710,
        "y": 660,
        "wires": [
            [
                "87c6317706115d73"
            ]
        ]
    },
    {
        "id": "9ff882c27f5e65db",
        "type": "chronos-config",
        "name": "personel",
        "latitudeType": "num",
        "longitudeType": "num",
        "timezone": "",
        "missingHour": "insert",
        "skipRepeatedHour": false,
        "timezoneType": "str",
        "sunPositions": []
    },
    {
        "id": "a33de4c6d18c3b0e",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.6.63",
            "node-red-contrib-chronos": "1.30.0"
        }
    }
]

If you use “flows” instead of “json” as a tag and only use single open and close square brackets, instead of 2 to wrap the flow, then it will render right.
I edited it for you.

Hi Mark

I exported my flow from NodeRed, into the clipboard , then using the + icon and selected “Node-Red flow”, used json type and pasted my flow between the 2 brackets, is it the right way to do ? It doesn’t seem so as my last attempt is again just a script and no visual … what do I do wrong here ?

@nickdb ,Thanks, I did not see your answer before asking Mark, sorry for this and thanks again for fixing it for me

HI Mark - everything looks fine now, thanks a lot for your help. Next thing to do is to wire it to Multiplus trickle charger blade , starter battery and Cerbo Relay 2. Would you have any advice on the type, and brand of external relay to be used ? (number of poles, load max current ( 10A ?) , any other important characteristics ? …)

Final flow used below:

[ 
{
        "id": "d554211af8433969",
        "type": "tab",
        "label": "Trickle charger logic",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "b1ea313624c02296",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Set Limit Values in Flow Context",
        "func": "context.data = context.data || {};\n\n\n\n\n\nswitch (msg.topic) {                    /// regarde la valeur de Msg.topic et agit en conséquence\n    case \"HVH\":\n        context.data.hvh = msg.payload; /// stocke msg.payload dans hvh\n        msg = null;                     /// ne laisse pas sortir le message\n        break;                          /// sort du switch et considère le cas suivant\n    case \"TEMPLOW\":\n        context.data.templow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPLOW\":\n        context.data.htemplow = msg.payload;\n        msg = null;\n        break;\n    case \"HTEMPHIGH\":\n        context.data.htemphigh = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVLOW\":\n        context.data.stvlow = msg.payload;\n        msg = null;\n        break;\n    case \"STARTVSUFF\":\n        context.data.stvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"HSOCSUFF\":\n        context.data.hsocsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARVSUFF\":\n        context.data.solarvsuff = msg.payload;\n        msg = null;\n        break;\n    case \"SOLARWSUFF\":\n        context.data.solarwsuff = msg.payload;\n        msg = null;\n        break;\n    \n    default:\n        msg = null;\n    \tbreak;\n}\nflow.set('HOUSEVHIGH',context.data.hvh);            /// prend la valeur hvh et la stocke dabs la variable HOUSEVHIGH (variable flow est accessible dans tout le flow (onglet) alors que dta.context n'est accessible que dans le noeud)\nflow.set('TEMPLOW',context.data.templow);\nflow.set('HTEMPLOW',context.data.htemplow);\nflow.set('HTEMPHIGH',context.data.htemphigh);\nflow.set('STARTVLOW',context.data.stvlow);\nflow.set('STARTVSUFF',context.data.stvsuff);\nflow.set('HSOCSUFF',context.data.hsocsuff);\nflow.set('SOLARVSUFF',context.data.solarvsuff);\nflow.set('SOLARWSUFF',context.data.solarwsuff);\n\n\n\n",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 160,
        "wires": [
            [],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This is used to store the values as flow.context data. "
    },
    {
        "id": "e16aea3266b07db9",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVLOW",
        "payload": "12.5",
        "payloadType": "num",
        "x": 120,
        "y": 40,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "Voltage of starter battery that should trigger charging with trickle charger\n= minimum Starter voltage accepted"
    },
    {
        "id": "c0269fc481fa1d55",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Starter V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "STARTVSUFF",
        "payload": "14",
        "payloadType": "num",
        "x": 130,
        "y": 80,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "Voltage of starter battery which is considered as sufficient - no need to charge beyond this voltage"
    },
    {
        "id": "01cbfc8b9a98576d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House SOC Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HSOCSUFF",
        "payload": "80",
        "payloadType": "num",
        "x": 140,
        "y": 160,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "we want the House battery by well charged before transfering part of the charge to the starter battery --> the SOC of the house battery should be high enough"
    },
    {
        "id": "6413d5a3c9b8d535",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar V Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARVSUFF",
        "payload": "12",
        "payloadType": "num",
        "x": 130,
        "y": 200,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "3bde1396210daf4d",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Solar W Sufficient",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "SOLARWSUFF",
        "payload": "1",
        "payloadType": "num",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "c4dde77756334495",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "Ambient Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "TEMPLOW",
        "payload": "5",
        "payloadType": "num",
        "x": 130,
        "y": 280,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "f956b125144a76c4",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House V High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HVH",
        "payload": "14.2",
        "payloadType": "num",
        "x": 120,
        "y": 120,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ],
        "info": "High value of the house battery - higher voltage would be an issue to charge the starter battery by trickle charger (HVH -0,3V) should be the max acceptable for the starter battery"
    },
    {
        "id": "8d3458aa1003f1ad",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Auto-Enable if Conditions Suit",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\nlet htemplow = flow.get('HTEMPLOW');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"AMBTemp\":\n        context.data.ambtemp = msg.payload;\n        msg = null;\n        break;\n    //case \"STRTR\":\n      //  context.data.strtr = msg.payload;\n      //  msg = null;\n      //  break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n    case \"HBTI\":\n        context.data.hbti = msg.payload;\n        msg = null;\n        break;  \n        \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null) {\n    \n\t   if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.hbti >= htemplow && context.data.mpin == 240 && context.data.mppt >= solarvsuff && context.data.mpptw >= solarwsuff && context.data.ssa == 1 && context.data.orion === 0 && context.data.ambtemp >= templow ){ \n\t       \n\t       //Condition générale si charge par le solaire: If hbat < safe max value, STRTV is < lower limit, HSOC is suff, No Shore connection, Solar Power Suff (2 criteria V & W), si UI switch est en AUTO, si Orion en OFF, si temp ambiante > minimum\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    }  else if (context.data.hbattv <= hvh && context.data.strtv <= stvlow && context.data.hsoc >= hsocsuff && context.data.hbti >= htemplow && context.data.mpin == 0 && (context.data.mpsw == 3 || context.data.mpsw == 1) && context.data.ssa == 1 && context.data.orion === 0 && context.data.ambtemp >= templow ){ \n\t        //Condition générale si charge par le Multiplus 220V :If hbat < safe max value, STRTV is < lower limit, HSOC is suff, MP ACin disponible, Multiplus en mode chargeur ou on, si UI switch est en AUTO, si Orion est OFF, si temp ambiante > minimum\n\t        return [{payload:\"1\"},null]  // Turn on relay\n\t        \n\t    } else return [null,{payload:\"0\"}] // Turn off relay if neither Solar or Shore available\n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 740,
        "wires": [
            [
                "e334c3949a28d67e"
            ],
            []
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables trickle charging if the Switch is set to Auto, AND the conditions of the batteries are appropriate for charging, AND one of these conditions are met: A)Shore power is connected B)PV power is available. \nBehavior when the switch is set to On or Off is controlled by a separate function. "
    },
    {
        "id": "a5709779258e3697",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Pv/V",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Pv/V",
            "type": "float",
            "name": "PV voltage"
        },
        "initial": "",
        "name": "MPPTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": ">",
        "condition1Threshold": 12,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 70,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ],
        "outputLabels": [
            "solarA",
            null
        ]
    },
    {
        "id": "b8b6b9634e0b4d4c",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "HSOC",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": ">=",
        "condition1Threshold": 80,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 70,
        "y": 660,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "aa2ab6cff8fd3b99",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Ac/ActiveIn/ActiveInput",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Ac/ActiveIn/ActiveInput",
            "type": "enum",
            "name": "Active input",
            "enum": {
                "0": "AC Input 1",
                "1": "AC Input 2",
                "240": "Disconnected"
            }
        },
        "initial": "",
        "name": "MPIN",
        "onlyChanges": true,
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": "==",
        "condition1Threshold": 0,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 210,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "10e1ddfa6d52f158",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/1/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/1/Voltage",
            "type": "float",
            "name": "Starter battery voltage (V)"
        },
        "name": "STRTV",
        "onlyChanges": true,
        "roundValues": "2",
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": "<",
        "condition1Threshold": 12.5,
        "condition2Enabled": true,
        "condition2Service": "com.victronenergy.battery/279",
        "condition2Path": "/Dc/1/Voltage",
        "condition2ServiceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "relay"
        },
        "condition2PathObj": {
            "path": "/Dc/1/Voltage",
            "type": "float",
            "name": "Starter battery voltage (V)"
        },
        "condition2Operator": "<=",
        "condition2Threshold": 14,
        "logicOperator": "OR",
        "outputTrue": "charging not required",
        "outputFalse": "Trickle charger ON",
        "debounce": 0,
        "x": 70,
        "y": 600,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "65afa19d6674c748",
        "type": "victron-input-solarcharger",
        "z": "d554211af8433969",
        "service": "com.victronenergy.solarcharger/289",
        "path": "/Yield/Power",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/289",
            "name": "PANNEAU PV1",
            "communityTag": "solarcharger"
        },
        "pathObj": {
            "path": "/Yield/Power",
            "type": "float",
            "name": "PV Power (W)"
        },
        "name": "MPPTW",
        "onlyChanges": true,
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": ">",
        "condition1Threshold": 1,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 220,
        "y": 540,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "e334c3949a28d67e",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 740,
        "y": 720,
        "wires": [
            [
                "cf03545dbdf2a85b"
            ]
        ]
    },
    {
        "id": "7b221d78614de648",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Mode",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Mode",
            "type": "enum",
            "name": "Switch Position",
            "enum": {
                "1": "Charger Only",
                "2": "Inverter Only",
                "3": "On",
                "4": "Off"
            },
            "mode": "both"
        },
        "initial": "",
        "name": "MPSW",
        "onlyChanges": true,
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": "!=",
        "condition1Threshold": 3,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 70,
        "y": 480,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "63e0b7072a30435b",
        "type": "victron-input-temperature",
        "z": "d554211af8433969",
        "service": "com.victronenergy.temperature/24",
        "path": "/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.temperature/24",
            "name": "Température coffre électrique",
            "communityTag": "temperature"
        },
        "pathObj": {
            "path": "/Temperature",
            "type": "float",
            "name": "Temperature (°C)"
        },
        "name": "AMBTemp",
        "onlyChanges": false,
        "roundValues": "1",
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": ">=",
        "condition1Threshold": 5,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 80,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad",
                "704601ce78c7d409"
            ],
            []
        ]
    },
    {
        "id": "704601ce78c7d409",
        "type": "function",
        "z": "d554211af8433969",
        "name": "Manual Disable/Enable",
        "func": "context.data = context.data || {};\n\nlet hvh = flow.get('HOUSEVHIGH');\nlet templow = flow.get('TEMPLOW');\nlet stvlow = flow.get('STARTVLOW');\nlet stvsuff = flow.get('STARTVSUFF');\nlet hsocsuff = flow.get('HSOCSUFF');\nlet solarvsuff = flow.get('SOLARVSUFF');\nlet solarwsuff = flow.get('SOLARWSUFF');\nlet htemplow = flow.get('HTEMPLOW');\n\nswitch (msg.topic) {\n    case \"HV\":\n        context.data.hbattv = msg.payload;\n        msg = null;\n        break;\n    case \"AMBTemp\":\n        context.data.ambtemp = msg.payload;\n        msg = null;\n        break;\n    //case \"STRTR\":\n       // context.data.strtr = msg.payload;\n      //  msg = null;\n       // break;\n    case \"MPSW\":\n        context.data.mpsw = msg.payload;\n        msg = null;\n        break;\n    case \"MPIN\":\n        context.data.mpin = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTV\":\n        context.data.mppt = msg.payload;\n        msg = null;\n        break;\n    case \"MPPTW\":\n        context.data.mpptw = msg.payload;\n        msg = null;\n        break;\n    case \"STRTV\":\n        context.data.strtv = msg.payload;\n        msg = null;\n        break;    \n    case \"HSOC\":\n        context.data.hsoc = msg.payload;\n        msg = null;\n        break;\n    case \"3SS\":\n        context.data.ss = msg.payload;\n        msg = null;\n        break;\n    case \"3SSA\":\n        context.data.ssa = msg.payload;\n        msg = null;\n        break;\n    case \"ORION\":\n        context.data.orion = msg.payload;\n        msg = null;\n        break;\n     case \"HBTI\":\n        context.data.hbti = msg.payload;\n        msg = null;\n        break;  \n    \n    default:\n        msg = null;\n    \tbreak;\n\n}\n\nif(context.data.mppt != null && context.data.strtv != null && context.data.hsoc != null ) {  /// si variables (MPPT voltage, Starter battery voltage et home SOC) ont une valeur et ne sont pas vides, on execute la suite\n    \n\t   if  (context.data.ss == 1 && context.data.ssa == 0 ){ //If: Switch set to Manual + On\n\t        return [{payload:\"1\"},null]  // Turn ON relay, si cette condition est fausse (c'est à dire que le switch 3SS n'est pas en manuel / ON, alors vérifie la condition suivante de 'else if'(et le relai n'est pas activé)\n\t        \n\t    }  else if (context.data.hbattv > hvh){ //If: House V is higher than safe AGM charge V\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t \n\t    }   else if (context.data.orion == 3 || context.data.orion == 4 || context.data.orion == 5){\t        //If: Ignition on (Orion is either in bulk (3), absorb (4) or float (5))\n\t        return [null,{payload:\"0\"}]  // Turn off relay     \n\t\n\t    }   else if (context.data.mpin == 240 && context.data.ssa == 0 && (context.data.mppt < solarvsuff || context.data.mpptw < solarwsuff)){ //If: MP is unplugged and Switch is not in AUTO mode and Solar is insufficient \n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t   }   else if (context.data.hsoc < hsocsuff){ //If: HSOC is low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ss == 0 && context.data.ssa == 0 ){ //If: Switch set to Manual + Off\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.ambtemp < templow){ //If: Temp Low\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.hbti < htemplow){ //If: Temp of house battery < minimum temperature for house battery charging\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else if (context.data.strtv > stvsuff){ //If: STRTV is sufficient\n\t        return [null,{payload:\"0\"}]  // Turn off relay\n\t        \n\t    }   else return [null,null] // \n\t    \n    \n} else return msg; //Ends the function without sending a message if one of the context data values is not available",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 450,
        "y": 420,
        "wires": [
            [
                "dfe7935115d435b6"
            ],
            [
                "ac0fea68fde030e9",
                "d7d509c396feeda9"
            ]
        ],
        "outputLabels": [
            "Turn On (close) Relay",
            "Turn OFF (open) Relay"
        ],
        "info": "This enables or disables trickle charging if the Switch is set to On (enables) or Off (disables) or if any conditions arise which should prevent connecting the trickle charge cicuit (temperature, ignition state, batt voltages, etc.)\nBehavior when the switch is set to Auto is controlled by a separate function. "
    },
    {
        "id": "ac0fea68fde030e9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay Off",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 420,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "dd77d6309f786032",
        "type": "victron-output-relay",
        "z": "d554211af8433969",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus device"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "mode": "both"
        },
        "name": "TR Charger enable (relay2)",
        "onlyChanges": false,
        "outputs": 0,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 1020,
        "y": 480,
        "wires": []
    },
    {
        "id": "c99c035a5ea82cc9",
        "type": "trigger",
        "z": "d554211af8433969",
        "name": "Run for 4hrs then Turn Off",
        "op1": "",
        "op2": "0",
        "op1type": "pay",
        "op2type": "num",
        "duration": "4",
        "extend": false,
        "overrideDelay": false,
        "units": "hr",
        "reset": "reset",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 730,
        "y": 540,
        "wires": [
            [
                "dd77d6309f786032",
                "c0e01e95f8a19728"
            ]
        ]
    },
    {
        "id": "87c6317706115d73",
        "type": "delay",
        "z": "d554211af8433969",
        "name": "check 4x/hr",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "4",
        "nbRateUnits": "1",
        "rateUnits": "hour",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 690,
        "y": 600,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "5753a6862759c46e",
        "type": "victron-input-battery",
        "z": "d554211af8433969",
        "service": "com.victronenergy.battery/279",
        "path": "/Dc/0/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.battery/279",
            "name": "MONITEUR BATTERIES",
            "communityTag": "battery"
        },
        "pathObj": {
            "path": "/Dc/0/Voltage",
            "type": "float",
            "name": "Battery voltage (V)"
        },
        "name": "HV",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": "<=",
        "condition1Threshold": 14.2,
        "condition2Enabled": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": 0,
        "x": 210,
        "y": 660,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ],
            []
        ]
    },
    {
        "id": "dfe7935115d435b6",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Turn Relay On",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 700,
        "y": 380,
        "wires": [
            [
                "dd77d6309f786032"
            ]
        ]
    },
    {
        "id": "ce67ee284a7f7b2c",
        "type": "victron-virtual-switch",
        "z": "d554211af8433969",
        "name": "3-State Switch for UI",
        "outputs": 2,
        "switch_1_type": "9",
        "switch_1_initial": 0,
        "switch_1_label": "",
        "switch_1_customname": "Starter Trickle Charge V4",
        "switch_1_group": "Power",
        "switch_1_include_measurement": false,
        "switch_1_rgb_color_wheel": false,
        "switch_1_cct_wheel": false,
        "switch_1_rgb_white_dimmer": false,
        "x": 400,
        "y": 40,
        "wires": [
            [],
            []
        ],
        "info": "This creates the switch in the UI that will be used to set the On/Off/Auto state by the user."
    },
    {
        "id": "c0e01e95f8a19728",
        "type": "victron-output-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3-State Switch for UI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge V4 state",
            "mode": "both"
        },
        "name": "Entretien batterie démarrage",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 0,
        "conditionalMode": false,
        "condition1Operator": ">",
        "condition2Enabled": false,
        "condition2Service": "",
        "condition2Path": "",
        "condition2Operator": ">",
        "logicOperator": "AND",
        "outputTrue": "true",
        "outputFalse": "false",
        "outputOnChange": false,
        "debounce": 2000,
        "x": 1020,
        "y": 600,
        "wires": []
    },
    {
        "id": "d7d509c396feeda9",
        "type": "change",
        "z": "d554211af8433969",
        "name": "Reset Timer",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "reset",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 690,
        "y": 460,
        "wires": [
            [
                "c99c035a5ea82cc9"
            ]
        ]
    },
    {
        "id": "17c52f32e678c001",
        "type": "victron-input-vebus",
        "z": "d554211af8433969",
        "service": "com.victronenergy.vebus/276",
        "path": "/Dc/0/Temperature",
        "serviceObj": {
            "service": "com.victronenergy.vebus/276",
            "name": "CHARGEUR CONVERTISSEUR 220V",
            "communityTag": "vebus"
        },
        "pathObj": {
            "path": "/Dc/0/Temperature",
            "type": "float",
            "name": "Battery temperature (°C)"
        },
        "name": "HBTI",
        "onlyChanges": false,
        "roundValues": "2",
        "rateLimit": 0,
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": ">",
        "condition1Threshold": 5,
        "condition2Enabled": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": 2000,
        "x": 210,
        "y": 720,
        "wires": [
            [
                "8d3458aa1003f1ad"
            ],
            []
        ]
    },
    {
        "id": "bd2378e89652e448",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp Low",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPLOW",
        "payload": "5",
        "payloadType": "num",
        "x": 140,
        "y": 320,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "912ef8db9cb8e564",
        "type": "inject",
        "z": "d554211af8433969",
        "name": "House Batt Temp High",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "HTEMPHIGH",
        "payload": "50",
        "payloadType": "num",
        "x": 140,
        "y": 360,
        "wires": [
            [
                "b1ea313624c02296"
            ]
        ]
    },
    {
        "id": "a99cb9d9316290c5",
        "type": "victron-input-custom",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/Auto",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI (100)"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/Auto",
            "name": "/SwitchableOutput/output_1/Auto",
            "type": "number",
            "value": 1
        },
        "name": "3SSA",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 70,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "b14666dd70cd09df",
        "type": "victron-input-switch",
        "z": "d554211af8433969",
        "service": "com.victronenergy.switch/100",
        "path": "/SwitchableOutput/output_1/State",
        "serviceObj": {
            "service": "com.victronenergy.switch/100",
            "name": "3SSUI",
            "communityTag": "switch"
        },
        "pathObj": {
            "path": "/SwitchableOutput/output_1/State",
            "type": "enum",
            "enum": {
                "0": "Off",
                "1": "On"
            },
            "name": "Starter Trickle Charge state",
            "mode": "both"
        },
        "name": "3SS",
        "onlyChanges": true,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": "2000",
        "x": 210,
        "y": 420,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ]
        ]
    },
    {
        "id": "67950dc9bef2d557",
        "type": "victron-input-alternator",
        "z": "d554211af8433969",
        "service": "com.victronenergy.alternator/277",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.alternator/277",
            "name": "Chargeur en roulant ",
            "communityTag": "alternator"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "Alternator state",
            "enum": {
                "0": "Off",
                "2": "Fault",
                "3": "Bulk",
                "4": "Absorption",
                "5": "Float",
                "6": "Storage",
                "7": "Equalize",
                "11": "Psu",
                "252": "External control"
            }
        },
        "name": "ORION",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "outputs": 2,
        "conditionalMode": true,
        "condition1Operator": "==",
        "condition1Threshold": 0,
        "condition2Enabled": false,
        "outputTrue": "true",
        "outputFalse": "false",
        "debounce": 2000,
        "x": 210,
        "y": 600,
        "wires": [
            [
                "704601ce78c7d409",
                "8d3458aa1003f1ad"
            ],
            []
        ]
    },
    {
        "id": "05dae33a8cd8e31a",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Charge if Vstart = < 12,5 V",
        "info": "",
        "x": 690,
        "y": 40,
        "wires": []
    },
    {
        "id": "cf03545dbdf2a85b",
        "type": "chronos-filter",
        "z": "d554211af8433969",
        "name": "During Daytime only (AT)",
        "config": "9ff882c27f5e65db",
        "reference": "",
        "referenceType": "absTime",
        "baseTime": "",
        "baseTimeType": "msgIngress",
        "evaluation": "",
        "evaluationType": "and",
        "conditions": [
            {
                "operator": "between",
                "operands": [
                    {
                        "type": "time",
                        "value": "10:30",
                        "offset": 1,
                        "random": 1,
                        "precision": "minute"
                    },
                    {
                        "type": "time",
                        "value": "17:00",
                        "offset": 1,
                        "random": 1,
                        "precision": "minute"
                    }
                ]
            }
        ],
        "x": 710,
        "y": 660,
        "wires": [
            [
                "87c6317706115d73"
            ]
        ]
    },
    {
        "id": "85f091a179d3dadb",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Stop charge when Vstart > 14",
        "info": "",
        "x": 700,
        "y": 80,
        "wires": []
    },
    {
        "id": "438d45ebd18db731",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Stop charge when Vhouse > 14,2",
        "info": "",
        "x": 710,
        "y": 120,
        "wires": []
    },
    {
        "id": "6e64feb9507d3b37",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Min SOC for charging: 80%",
        "info": "",
        "x": 700,
        "y": 160,
        "wires": []
    },
    {
        "id": "cbb2a7d71d8c0066",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Solar V min : 12V",
        "info": "",
        "x": 660,
        "y": 200,
        "wires": []
    },
    {
        "id": "d33e416c49a1ec1e",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Solar W min = 1W",
        "info": "",
        "x": 670,
        "y": 240,
        "wires": []
    },
    {
        "id": "42f040de19470ad1",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Temp ambiante min for charging : 5°C",
        "info": "",
        "x": 530,
        "y": 280,
        "wires": []
    },
    {
        "id": "57adb300244079e9",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Temp. min house bat. 5°C",
        "info": "",
        "x": 490,
        "y": 320,
        "wires": []
    },
    {
        "id": "dd871aecea23ee1d",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "Temp high house bat: 50°C",
        "info": "",
        "x": 490,
        "y": 360,
        "wires": []
    },
    {
        "id": "8a8729c856724aa6",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "RED : condition not met to charge start battery",
        "info": "",
        "x": 240,
        "y": 800,
        "wires": []
    },
    {
        "id": "0cec185cf975ff46",
        "type": "comment",
        "z": "d554211af8433969",
        "name": "GREEN : condition met to enable trickle charger",
        "info": "",
        "x": 240,
        "y": 840,
        "wires": []
    },
    {
        "id": "9ff882c27f5e65db",
        "type": "chronos-config",
        "name": "personel",
        "latitudeType": "num",
        "longitudeType": "num",
        "timezone": "",
        "missingHour": "insert",
        "skipRepeatedHour": false,
        "timezoneType": "str",
        "sunPositions": []
    },
    {
        "id": "c0552b3a06663bcb",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.6.63",
            "node-red-contrib-chronos": "1.30.0"
        }
    }
]

Great to hear you have it all set up and ready for testing. One thing you might try: just run the entire flow without connecting to the starter battery, or, modify the flow so it only sends the On/Off command to a ‘Debug’ node. This can enable you to test the software without actually turning on or off the connection to the starter battery. After that round of testing, you could do the real test next, with things fully connected.

I’m not qualified to instruct you on how to wire this. I’m not a professionally trained electrical engineer. Here is what I did in my installation though.

Starter to MP circuit.
I have a wire running from the Multiplus to my starter battery. The wire is sized for being able to carry 10A along its distance. That wire is fused on both ends, because of the possibility of positive voltage originating from either end of the wire. The fuses are 5A, because I never actually expect more than 4A in this circuit, and I want to know if it exceeds 5A. The wire is interrupted by a relay. It’s connected to the Comm and NO circuits on the relay. The relay is then connected to and controlled by the relay output on the GX device. This is the relay that turns the charging circuit on and off. I’m using an external relay so that the charge current doesn’t have to pass through the GX device.

Ignition On? circuit.
A signal wire from the vehicle sends + voltage when the Ignition is in the On position. This wire connects to a digital input on the GX device. This wire is rated for more than 1A but is fused at 1A. In my case, the signal wire is run into an optocoupler which is connected to the GX device, because my GX device is a Raspberry Pi, and the GPOI input I’m using is set up for 5V signals, not 12V. I don’t think this is needed with a Cerbo GX.

Thanks for your advice , once again.

I have not use a debug node for testing as I am not proficient enough to do so, would need to ask ChatGPT how to do that :slight_smile: … I will try though

I made some tests just looking at the status of the relay in Node-Red and changing the condition limits to create conditions that would require opening or closing the GX relay (was possible with StartV low, Hbatt low, HSOC, also when turning on and off the MP…) . Not all tests have been possible (the solar conditions for instance because the van is parked in a garage ), but I should be able to test more during the WE. And as you suggest, I do all testing without actual wiring of the secondary relay.

I have ordered a 4 connection micro-relay (with protecting diode) capable to support up to 40A (much more than enough) - https://www.amazon.com.be/dp/B0778DYRLR?ref=ppx_yo2ov_dt_b_fed_asin_title - and a pair of fuse holders. As far as wiring is concerned, your description fully match what IA was recommending

regards

1 Like

Hi Mark and community

I wired the system last week-end and all seems to be working fine but I have one question on how exactly is working the node “Check 4x/hour” and what it actually does. Is my understanding correct that this node is checking the values of the various condition parameters every 15 minutes and either confirm the message to close the relay if all conditions are met to use the trickle charger or open the relay if one of the conditions is missing ? I noticed during my testing that the AUTO mode was not switching immediately the relay to OFF (open) when one of the condition changed, so I assume it is because of the 15 min frequency for checking … correct ?

Questions:

  1. In the conditions for switching off the trickle charger I introduced a conditions related to the Orion DC-DC charger being in one of the 3 charging mode (bulk, absorb, float) - meaning when the engine is started, the Orion charger status change from 0 to bulk (for instance) and this should disconnect the trickle charger. However, if I understand correctly the logic of the node “Check 4x/hour”, the effective disconnection of the trickle charger will happen 15 min after the Orion starts up, when the node is doing its check. Is there any risk with this situation ? (in this situation vehicle alternator and trickle charger are both sending charging current to the vehicle battery during 15 min !). If risky, what would be the alternative to take care of the engine-on situation ?

  2. Still assuming the node is working as suggested above, what would happen if I simply increase drastically the frequency of checking the status of the conditions ? For instance every 30 seconds or every minutes ? The system would be much more reactive isn’t it ? But I guess there is a price to pay for it :slight_smile: ?

And what if I simply remove this node ? will it still open or close the relay when one condition is changing in the course of the day ?
thanks for your input

1 Like

Your understanding about the “check 4x/hr” Delay node is correct.
Without that node, the “Auto-Enable if Conditions Suit” function would be run every time one of the values in the input nodes changes. With the Delay Node in place, the “Auto-Enable if Conditions Suit” function will only be run once every 15 minutes.

I added the “check 4x/hr” Delay node because when planning the flow behavior, I needed to only let the Auto-Enable script check the conditions every 15 minutes. This was important for me early on before I was using as many input variables as I am now. I was trying to prevent the trickle charge from turning on and off repeatedly when some input variables (ex. starter voltage) bounced up and down.

That was the original motivation for having the Delay node. Currently, I think the only reason to keep it is to reduce Node-RED activity and CPU usage.