Cerbo GX Relay 2 resets when deploying changes to node red

I’m running the latest firmware (v3.55) on my Cerbo GX and using Relay 2 to control power to my Starlink system. This lets me toggle Starlink on and off via Relay 2, with time-based automation handled through Node-RED.

However, I’ve run into an issue: every time I deploy changes in Node-RED, Relay 2 resets to off, which immediately cuts internet connectivity. In the Relay control node, I’ve already selected “Don’t set initial value”, which I assumed would preserve the relay’s current state—but it still gets reset on deploy.

Is there a way to deploy flows in Node-RED without changing the relay state?

Also, a related request: it would be great if we could rename the relays in the GUI—being able to label Relay 2 as “Starlink” would make things much clearer.

Thanks in advance for any suggestions!

Hi @felizcortez

I think this might be due to how the relay inside the Cerbo is physically designed?

We have a new latching relay type coming with the “GX IO extender” product, rather than just the coil and spring type.

That latching type requires an active change of state command, rather than just the “loss” of active signal or voltage (if the GX power cycles).

I think that will be the solution.

Relay labels in the GUI are coming very soon in an upcoming Venus OS release.

Thanks for the response. That’s great news about the upcoming ability to rename the relay.

I guess I’m a bit confused about how deploying node red changes work. Does it reset the relay no matter what on any changes? The cerbo doesn’t power cycle so i would assume it should still drive the coil of the relay in the previous state.

Latching relays would be very helpful and reduce power consumption, Just wish they were a bit bigger because I’d like to drive my starlink directly from the GX without any intermediary devices.

Not knowing exactly how you have your Node-RED coded it is hard to be specific bit I assume you possibly have your time automation code outputting the required relay position.

One option may be to output the result of your time automation code to a change node that stores the required relay state to a variable. An inject node is then used to run a function node that then sends the stored variable to the relay control node. Variable should persist over a deploy. The inject node can be timed to first run a few seconds after the deploy to give time for your automation code to run.

The other thing is to do is check that your time automation code covers all scenarios, it may allow a null state through for a short period that turns the relay off.

Here is a copy of my code: It shouldn’t do very much, simply turn off the relay at 1am and also check the state of the relay. I have the timerswitch function disabled currently as I’d like to use that to do some more complex scheduling.

[
    {
        "id": "b46453c2d2eaa59f",
        "type": "tab",
        "label": "Relay Control Starlink",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "1f0c091eb53c3e12",
        "type": "debug",
        "z": "b46453c2d2eaa59f",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 430,
        "y": 20,
        "wires": []
    },
    {
        "id": "441797691fafa522",
        "type": "victron-output-relay",
        "z": "b46453c2d2eaa59f",
        "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"
            },
            "writable": true
        },
        "initial": "",
        "name": "GX Relay 2",
        "onlyChanges": false,
        "x": 510,
        "y": 120,
        "wires": []
    },
    {
        "id": "6c666c601d7a7a9d",
        "type": "victron-input-relay",
        "z": "b46453c2d2eaa59f",
        "service": "com.victronenergy.system/0",
        "path": "/Relay/1/State",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Relay/1/State",
            "type": "enum",
            "name": "Venus relay 2 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            }
        },
        "initial": "",
        "name": "Relay 2 State",
        "onlyChanges": true,
        "x": 110,
        "y": 220,
        "wires": [
            [
                "1f0c091eb53c3e12"
            ]
        ]
    },
    {
        "id": "89c7c02b477a1e74",
        "type": "change",
        "z": "b46453c2d2eaa59f",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "on",
                "fromt": "str",
                "to": "1",
                "tot": "num"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "off",
                "fromt": "str",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 280,
        "y": 120,
        "wires": [
            [
                "441797691fafa522",
                "1f0c091eb53c3e12"
            ]
        ]
    },
    {
        "id": "ef24a18303204059",
        "type": "timerswitch",
        "z": "b46453c2d2eaa59f",
        "name": "",
        "ontopic": "",
        "offtopic": "",
        "onpayload": "on",
        "offpayload": "off",
        "disabled": true,
        "schedules": [
            {
                "on_h": "21",
                "on_m": "56",
                "on_s": "10",
                "off_h": "21",
                "off_m": "56",
                "off_s": "28",
                "valid": true
            }
        ],
        "x": 90,
        "y": 120,
        "wires": [
            [
                "89c7c02b477a1e74",
                "1f0c091eb53c3e12"
            ]
        ]
    },
    {
        "id": "17e5683320863df5",
        "type": "inject",
        "z": "b46453c2d2eaa59f",
        "name": "Turn off SL at 1AM",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 01 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 140,
        "y": 20,
        "wires": [
            [
                "1f0c091eb53c3e12",
                "441797691fafa522"
            ]
        ]
    }
]

I think I found the issue, the timerswitch sends a default value of off when deploying. So I disabled the timer and i can now deploy new code without issue shutting off relay.