Node-Red detect a disconnected device

Hello,

I’d like to know if we can detect a disconnected victron node ?

My orion XS 1400 disconnect some time from the VE.direct. My good DIY or victron cable change nothing…

All node from orion XS in Node-Red show “disconnected” and in fact stop sending data.

I’d like to detect that to include it to the flow to send it to Domoticz.

The actual flow just for the Orion XS:

[[
    {
        "id": "a548cd11041c030a",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/Dc/0/Current",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/Dc/0/Current",
            "type": "float",
            "name": "/Dc/0/Current (A DC)"
        },
        "name": "CHG_I_OUT",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 90,
        "y": 4360,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "eb8cccadb2b609fd",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/Dc/0/Voltage",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/Dc/0/Voltage",
            "type": "float",
            "name": "/Dc/0/Voltage (V DC)"
        },
        "name": "CHG_V_OUT",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 90,
        "y": 4420,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "a187cd04a9fb552c",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/Dc/In/V",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/Dc/In/V",
            "type": "float",
            "name": "/Dc/In/V (V DC)"
        },
        "name": "CHG_V_IN",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 80,
        "y": 4480,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "685fe27e9a6604ac",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/Dc/In/P",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/Dc/In/P",
            "type": "float",
            "name": "/Dc/In/P (W)"
        },
        "name": "CHG_P_IN",
        "onlyChanges": false,
        "roundValues": "2",
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 80,
        "y": 4540,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "6da82b478de67908",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/State",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/State",
            "type": "enum",
            "name": "/State",
            "enum": {
                "0": "Off",
                "2": "Fault",
                "3": "Bulk",
                "4": "Absorption",
                "5": "Float",
                "6": "Storage",
                "7": "Equalize"
            }
        },
        "name": "CHG_STATE",
        "onlyChanges": false,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 90,
        "y": 4600,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "b5c23be5656154db",
        "type": "join",
        "z": "0db419827d85c08d",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "6",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 340,
        "y": 4460,
        "wires": [
            [
                "b4701dac991a4489"
            ]
        ]
    },
    {
        "id": "b4701dac991a4489",
        "type": "function",
        "z": "0db419827d85c08d",
        "name": "IDx 181",
        "func": "var iout = msg.payload.CHG_I_OUT;\nvar vout = msg.payload.CHG_V_OUT;\n\nvar vin = msg.payload.CHG_V_IN;\nvar pin = msg.payload.CHG_P_IN;\n\nvar ste = msg.payload.CHG_STATE;\nvar err = msg.payload.CHG_ERR;\n\nvar val = \"CHG|\"+iout+\"|\"+vout+\"|\"+vin+\"|\"+pin+\"|\"+ste+\"|\"+err+\"\";\nmsg.payload = {};\nmsg.payload.idx = 181;\nmsg.payload.nvalue = 0;\nmsg.payload.svalue =\"\" + val + \"\";\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 480,
        "y": 4460,
        "wires": [
            [
                "64228d0456df8cd2"
            ]
        ]
    },
    {
        "id": "64228d0456df8cd2",
        "type": "delay",
        "z": "0db419827d85c08d",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "10",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "allowrate": false,
        "outputs": 1,
        "x": 680,
        "y": 4460,
        "wires": [
            [
                "deb1600bb16b9c97",
                "c55f7ea5490a7942"
            ]
        ]
    },
    {
        "id": "deb1600bb16b9c97",
        "type": "function",
        "z": "0db419827d85c08d",
        "name": "Send to domoticz",
        "func": "msg.url = \"http://192.168.11.100:8080/json.htm?type=command&param=udevice\"\n+\"&idx=\"+msg.payload.idx\n+\"&nvalue=\"+msg.payload.nvalue\n+\"&svalue=\"+msg.payload.svalue\nmsg.payload = {};\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 870,
        "y": 4460,
        "wires": [
            [
                "d54864bff318fd28"
            ]
        ]
    },
    {
        "id": "d54864bff318fd28",
        "type": "http request",
        "z": "0db419827d85c08d",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "url": "",
        "tls": "",
        "x": 1070,
        "y": 4460,
        "wires": [
            [
                "5c55d316fa23ccf0"
            ]
        ]
    },
    {
        "id": "9b33517e60206c33",
        "type": "victron-input-dcdc",
        "z": "0db419827d85c08d",
        "service": "com.victronenergy.dcdc/288",
        "path": "/ErrorCode",
        "serviceObj": {
            "service": "com.victronenergy.dcdc/288",
            "name": "Chargeur pack AUX",
            "communityTag": "dcdc"
        },
        "pathObj": {
            "path": "/ErrorCode",
            "type": "enum",
            "name": "/ErrorCode",
            "enum": {
                "0": "No error",
                "1": "Battery temperature too high",
                "2": "Battery voltage too high",
                "3": "Battery temperature sensor miswired (+)",
                "4": "Battery temperature sensor miswired (-)",
                "5": "Battery temperature sensor disconnected",
                "6": "Battery voltage sense miswired (+)",
                "7": "Battery voltage sense miswired (-)",
                "8": "Battery voltage sense disconnected",
                "9": "Battery voltage wire losses too high",
                "17": "Charger temperature too high",
                "18": "Charger over-current",
                "19": "Charger current polarity reversed",
                "20": "Bulk time limit reached",
                "22": "Charger temperature sensor miswired",
                "23": "Charger temperature sensor disconnected",
                "34": "Input current too high"
            }
        },
        "name": "CHG_ERR",
        "onlyChanges": false,
        "outputs": 1,
        "conditionalMode": false,
        "outputTrue": "",
        "outputFalse": "",
        "debounce": "",
        "x": 80,
        "y": 4660,
        "wires": [
            [
                "b5c23be5656154db"
            ]
        ]
    },
    {
        "id": "5c55d316fa23ccf0",
        "type": "json",
        "z": "0db419827d85c08d",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": true,
        "x": 650,
        "y": 4540,
        "wires": [
            [
                "4120ce3a6857c41f"
            ]
        ]
    },
    {
        "id": "4120ce3a6857c41f",
        "type": "function",
        "z": "0db419827d85c08d",
        "name": "traitement erreur",
        "func": "var stat = msg.payload.status;\nvar titl = msg.payload.title;\nmsg.payload = {};\nif(stat!=\"OK\"){\n    msg.payload = stat;\n}\nelse{\n    msg.payload = \"OK\";\n}\nmsg.log = titl + \": \" + stat;\nreturn msg; ",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 840,
        "y": 4540,
        "wires": [
            [
                "81888398f9765009"
            ]
        ]
    },
    {
        "id": "81888398f9765009",
        "type": "change",
        "z": "0db419827d85c08d",
        "name": "SendCHG",
        "rules": [
            {
                "t": "set",
                "p": "chg.resp",
                "pt": "global",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1070,
        "y": 4540,
        "wires": [
            []
        ]
    },
    {
        "id": "00bb554e42119a4f",
        "type": "http request",
        "z": "0db419827d85c08d",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "url": "",
        "tls": "",
        "x": 1070,
        "y": 4420,
        "wires": [
            []
        ]
    },
    {
        "id": "c55f7ea5490a7942",
        "type": "function",
        "z": "0db419827d85c08d",
        "name": "Send to domoticz BKP",
        "func": "msg.url = \"http://192.168.11.250:8080/json.htm?type=command&param=udevice\"\n+\"&idx=\"+msg.payload.idx\n+\"&nvalue=\"+msg.payload.nvalue\n+\"&svalue=\"+msg.payload.svalue\nmsg.payload = {};\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 880,
        "y": 4420,
        "wires": [
            [
                "00bb554e42119a4f"
            ]
        ]
    },
    {
        "id": "886657bc9ee18638",
        "type": "comment",
        "z": "0db419827d85c08d",
        "name": "PVE_BKP",
        "info": "",
        "x": 1240,
        "y": 4420,
        "wires": []
    },
    {
        "id": "1c6cece8874fdf9c",
        "type": "comment",
        "z": "0db419827d85c08d",
        "name": "Box Domoticz",
        "info": "",
        "x": 1250,
        "y": 4460,
        "wires": []
    },
    {
        "id": "dba139ae5a26bee8",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.6.64"
        }
    }
]]

Because a disconnected node does not send any data, i’m looking for a function or something to read that “disconnected” text on a node.

Did someone already try something like that ?

Thanks

cordialy,