question

Warwick Bruce Chapman avatar image
Warwick Bruce Chapman asked

Node-RED Relay Control not working?

I have a relay control flow which seems to be unable to toggle the relay.


Relay is configured "Manual" on Venus OS via Remote Console.


When I inject 1 to Relay Control node, nothing happens.


Debug output on Relay state node shows 0.


I am injecting a number rather than a string.


Site is running 2.93.


Test flow is:

[
    {
        "id": "31354d578857de0a",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "5671ca31f217c5b6",
        "type": "victron-output-relay",
        "z": "31354d578857de0a",
        "service": "com.victronenergy.system",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.system",
            "name": "Venus device",
            "paths": [
                {
                    "path": "/Relay/0/State",
                    "type": "enum",
                    "name": "Venus relay 1 state",
                    "enum": {
                        "0": "Open",
                        "1": "Closed"
                    },
                    "writable": true,
                    "disabled": true
                },
                {
                    "path": "/Relay/1/State",
                    "type": "enum",
                    "name": "Venus relay 2 state",
                    "enum": {
                        "0": "Open",
                        "1": "Closed"
                    },
                    "writable": true
                }
            ]
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Venus relay 1 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            },
            "writable": true,
            "disabled": true
        },
        "initial": "",
        "name": "Relay 1 Control",
        "x": 700,
        "y": 200,
        "wires": []
    },
    {
        "id": "41b489a25a7f84ca",
        "type": "inject",
        "z": "31354d578857de0a",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 390,
        "y": 200,
        "wires": [
            [
                "5671ca31f217c5b6"
            ]
        ]
    },
    {
        "id": "b5a78968a6a95d9b",
        "type": "victron-input-relay",
        "z": "31354d578857de0a",
        "service": "com.victronenergy.system",
        "path": "/Relay/0/State",
        "serviceObj": {
            "service": "com.victronenergy.system",
            "name": "com.victronenergy.system",
            "paths": [
                {
                    "path": "/Relay/0/State",
                    "type": "enum",
                    "name": "Venus relay 1 state",
                    "enum": {
                        "0": "Open",
                        "1": "Closed"
                    }
                },
                {
                    "path": "/Relay/1/State",
                    "type": "enum",
                    "name": "Venus relay 2 state",
                    "enum": {
                        "0": "Open",
                        "1": "Closed"
                    }
                }
            ]
        },
        "pathObj": {
            "path": "/Relay/0/State",
            "type": "enum",
            "name": "Venus relay 1 state",
            "enum": {
                "0": "Open",
                "1": "Closed"
            }
        },
        "initial": "",
        "name": "Relay 1 State",
        "x": 390,
        "y": 280,
        "wires": [
            [
                "761e7523d0459975"
            ]
        ]
    },
    {
        "id": "761e7523d0459975",
        "type": "debug",
        "z": "31354d578857de0a",
        "name": "relay 1 state",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 280,
        "wires": []
    }
]
Node-REDgateway relay
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Your flow is working perfectly fine for me on Relay 1, however with v3.00~23...

0 Likes 0 ·
Warwick Bruce Chapman avatar image Warwick Bruce Chapman Stefanie (Victron Energy Staff) ♦♦ commented ·
Thanks - will try update.
0 Likes 0 ·
1 Answer
Dirk-Jan Faber (Victron Energy) avatar image
Dirk-Jan Faber (Victron Energy) answered ·

There are 2:

                    "disabled": true

in the flow. I suggest removing that.

I've seen that before and am not sure where it comes from. In the lower right corner of the edit panel there should be a toggle to (re-)enable it as well.

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Warwick Bruce Chapman avatar image Warwick Bruce Chapman commented ·

Note that after I upgraded to 3.00~23, it started working.


I'm not sure if it was the upgrade or the reboot, but it is working.


This is the site if you want to see the finished flow. It shuts off a Sunny Boy when the battery gets near full: https://vrm.victronenergy.com/installation/275104/dashboard

0 Likes 0 ·
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦ Warwick Bruce Chapman commented ·
In ~20 or ~21 there was an issue with the control nodes not functioning. So it could have been that.
0 Likes 0 ·
Warwick Bruce Chapman avatar image Warwick Bruce Chapman Dirk-Jan Faber (Victron Energy) ♦ commented ·
It was 2.93 and then now 3.00~23.
0 Likes 0 ·