Waveshare Modbus RS485 Relay Board via Node-Red and ZLAN Ethernet Modbus Gateway - full Guide

Since i found a viable solution to substitute the Tuya-Energy-Meters with ORNO-Modbus-Meters i still wanted to have a way of switching the electrical circuits i am measuring ON/OFF.

Must Haves:

  • switch things on and off
    ** maybe will become a Emergency Power Transfer Box with prority-based switchable circuits
  • all typical Voltages should be swhitchable
    ** 5V= Power Supply / USB-Power
    ** 12V= Power Supply, DIN-Rail-Relay
    ** 24V= Solar Battery Power, DIN-Rail-Relay
    ** 48V= Solar Battery Power
    ** 230V~
    ** 400V~
  • not use a Wireless connection

Since i already had a ZLAN 5143D Ethernet to Modbus RS485 Gateway lying around
image
i settled for the Waveshare RTU Relay Board
image

And then the Node-Red-Waltz went 1-2-3, 1-2-3 and with a little reading around the internet and documentation …

… i came up with this:

The upper half shows fetching the Relay-State:

1.)
We read the values every 10 seconds
image

2.)
We use a function mode to prep the read-command for the MODBUS Flex Getter
image

msg.payload = {
    'fc': 1,
    'unitid': 1,
    'address': 0x00ff,
    'quantity': 1,
};
return msg;

Then feed it to the Flex-Getter that accesses the Server-Settings
image

We get a message-Object that reads:
image

…and contains an array with the relay-states:
image

3.)
We use a function node to split that array into 8 descreet messages
image

var msg1= { payload: msg.payload[0] };
var msg2= { payload: msg.payload[1] };
var msg3= { payload: msg.payload[2] };
var msg4= { payload: msg.payload[3] };
var msg5= { payload: msg.payload[4] };
var msg6= { payload: msg.payload[5] };
var msg7= { payload: msg.payload[6] };
var msg8= { payload: msg.payload[7] };
return [msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8];

Each “exit” then transports a specific relay state over to home assistant.

4.)
A Home-Assistant Entity is created and fed the relay-state:
image

image

Voilà - we did not need to yammer into the config-file

The lower half shows, how to trigger a specific relay
1.)
A Home Assistant Switch entity is created:
image

image

The JSON-Payload shows the two states that are represented by the two outputs.

2.)
We use a fuction-node to create the payload for switching a single relay according to the switch state the message-payload announces
image

var val;
if (msg.payload=='on') {
    val= true;
}
if (msg.payload=='off') {
    val= false;
}
msg.payload = {
    'value': val,
    'fc': 5,
    'unitid': 1,
    'address': 0x0000,
    'quantity': 1,
};
return msg;

3.)
The MODBUS Flex writer is used to trigger the Relay-Board
image

Now we can create a Lovelace Dashboard:

And now we are ready to flip some switches…
e.g. when the battery state is below 15% we switch off the feed to the Inverter

1 Like

for your delight - The Node-Red-JSON
Have fun, Playing around!

[
    {
        "id": "659bdcb5f51541a2",
        "type": "tab",
        "label": "Waveshare Relay",
        "disabled": false,
        "info": ""
    },
    {
        "id": "51d9992770d87d77",
        "type": "inject",
        "z": "659bdcb5f51541a2",
        "name": "10s",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "10",
        "crontab": "",
        "once": true,
        "onceDelay": "10",
        "topic": "",
        "payloadType": "date",
        "x": 110,
        "y": 140,
        "wires": [
            [
                "ce162f6023373f49"
            ]
        ]
    },
    {
        "id": "ce162f6023373f49",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "read 0x00ff",
        "func": "msg.payload = {\n    'fc': 1,\n    'unitid': 1,\n    'address': 0x00ff,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 190,
        "y": 220,
        "wires": [
            [
                "824c5a6f45089bb2",
                "b1413baba168e2b7"
            ]
        ]
    },
    {
        "id": "824c5a6f45089bb2",
        "type": "modbus-flex-getter",
        "z": "659bdcb5f51541a2",
        "name": "Get relay state",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "bd4c735308ae1a40",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 320,
        "y": 140,
        "wires": [
            [
                "8f6b07b964a1df38"
            ],
            [
                "b1413baba168e2b7"
            ]
        ]
    },
    {
        "id": "b1413baba168e2b7",
        "type": "debug",
        "z": "659bdcb5f51541a2",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 690,
        "y": 380,
        "wires": []
    },
    {
        "id": "8f6b07b964a1df38",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "split payload",
        "func": "var msg1= { payload: msg.payload[0] };\nvar msg2= { payload: msg.payload[1] };\nvar msg3= { payload: msg.payload[2] };\nvar msg4= { payload: msg.payload[3] };\nvar msg5= { payload: msg.payload[4] };\nvar msg6= { payload: msg.payload[5] };\nvar msg7= { payload: msg.payload[6] };\nvar msg8= { payload: msg.payload[7] };\nreturn [msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8];",
        "outputs": 8,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 80,
        "wires": [
            [
                "41658a0c3e4cf6e7",
                "b1413baba168e2b7"
            ],
            [
                "71f84316ad9247c0",
                "b1413baba168e2b7"
            ],
            [
                "baca705d8a4fe442",
                "b1413baba168e2b7"
            ],
            [
                "b1413baba168e2b7",
                "d847e6b60bc9098b"
            ],
            [
                "b1413baba168e2b7",
                "83e56a37c90c03ed"
            ],
            [
                "b1413baba168e2b7",
                "065d1393b7f6924f"
            ],
            [
                "b1413baba168e2b7",
                "743e916784976ae3"
            ],
            [
                "b1413baba168e2b7",
                "a8517879db8a249f"
            ]
        ]
    },
    {
        "id": "41658a0c3e4cf6e7",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 1",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 1 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1000,
        "y": 20,
        "wires": [
            []
        ]
    },
    {
        "id": "71f84316ad9247c0",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 2",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 2 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "baca705d8a4fe442",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 3",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 3 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "d847e6b60bc9098b",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 4",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 4 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "83e56a37c90c03ed",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 5",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 5 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1000,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "065d1393b7f6924f",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 6",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 6 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 980,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "743e916784976ae3",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 7",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 7 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 960,
        "y": 380,
        "wires": [
            []
        ]
    },
    {
        "id": "a8517879db8a249f",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Relay 8",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "waveshare relay 8 state"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 920,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "056f9c4a8fa467ad",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0000",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0000,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 250,
        "y": 520,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "da2cb8f1688f1716",
        "type": "modbus-flex-write",
        "z": "659bdcb5f51541a2",
        "name": "flip switch",
        "showStatusActivities": false,
        "showErrors": true,
        "server": "bd4c735308ae1a40",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 960,
        "y": 540,
        "wires": [
            [
                "6a2e6922872c6bce"
            ],
            [
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "6a2e6922872c6bce",
        "type": "debug",
        "z": "659bdcb5f51541a2",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 690,
        "y": 440,
        "wires": []
    },
    {
        "id": "b8d41cdf21be77c5",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 1",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 1 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 80,
        "y": 520,
        "wires": [
            [
                "056f9c4a8fa467ad"
            ],
            [
                "056f9c4a8fa467ad"
            ]
        ]
    },
    {
        "id": "fcad836e9c6a6d96",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0001",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0001,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 270,
        "y": 560,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "96a61288d8fca7c9",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 2",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 2 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 80,
        "y": 580,
        "wires": [
            [
                "fcad836e9c6a6d96"
            ],
            [
                "fcad836e9c6a6d96"
            ]
        ]
    },
    {
        "id": "0812d9a2c9f9bcc1",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0002",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0002,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 290,
        "y": 600,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "dbe556841143b733",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 3",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 3 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 80,
        "y": 640,
        "wires": [
            [
                "0812d9a2c9f9bcc1"
            ],
            [
                "0812d9a2c9f9bcc1"
            ]
        ]
    },
    {
        "id": "99e7c2da0e79d023",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0003",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0003,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 640,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "4e0097f58dfc9d4b",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 4",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 4 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 80,
        "y": 700,
        "wires": [
            [
                "99e7c2da0e79d023"
            ],
            [
                "99e7c2da0e79d023"
            ]
        ]
    },
    {
        "id": "419daf65d8f65636",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0004",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0004,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 680,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "6516cc742509e357",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 5",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 5 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 80,
        "y": 760,
        "wires": [
            [
                "419daf65d8f65636"
            ],
            [
                "419daf65d8f65636"
            ]
        ]
    },
    {
        "id": "2fd863635b747c90",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0005",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0005,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 730,
        "y": 660,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "4e0e595466442e5e",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 6",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 6 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 560,
        "y": 680,
        "wires": [
            [
                "2fd863635b747c90"
            ],
            [
                "2fd863635b747c90"
            ]
        ]
    },
    {
        "id": "61cc935cf845bd04",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0006",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0006,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 700,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "237f2ebe1642f5cb",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 7",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 7 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 560,
        "y": 740,
        "wires": [
            [
                "61cc935cf845bd04"
            ],
            [
                "61cc935cf845bd04"
            ]
        ]
    },
    {
        "id": "d849a2effaf96b3d",
        "type": "function",
        "z": "659bdcb5f51541a2",
        "name": "write 0x0007",
        "func": "var val;\nif (msg.payload=='on') {\n    val= true;\n}\nif (msg.payload=='off') {\n    val= false;\n}\nmsg.payload = {\n    'value': val,\n    'fc': 5,\n    'unitid': 1,\n    'address': 0x0007,\n    'quantity': 1,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 790,
        "y": 740,
        "wires": [
            [
                "da2cb8f1688f1716",
                "6a2e6922872c6bce"
            ]
        ]
    },
    {
        "id": "5a325959beb30c03",
        "type": "ha-entity",
        "z": "659bdcb5f51541a2",
        "name": "Switch 8",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 2,
        "entityType": "switch",
        "config": [
            {
                "property": "name",
                "value": "Waveshare Relay 8 Switch"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": true,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 560,
        "y": 800,
        "wires": [
            [
                "d849a2effaf96b3d"
            ],
            [
                "d849a2effaf96b3d"
            ]
        ]
    },
    {
        "id": "bd4c735308ae1a40",
        "type": "modbus-client",
        "name": "Waveshare",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "10.0.0.69",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "69eb452d.8a610c",
        "type": "server",
        "name": "Home Assistant",
        "version": 1,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]
2 Likes

Hi Thomas,

Interesting to read about your experience with this RS485 workflow.
I will definitely look further into it as I’m looking into working with RS485 at the moment.
I would like to implement a lot of sensors relatively close to each other (in an area of 12x8m approx)
For this I wanted to have a lot (about 100) of sensors with a good reliability and no hassle with changing out batteries. Among these sensors there will be motion, door/reed, waterleak, pressure, temperature & humidity, pushbuttons, rotarydails, …
Have a look at the thread I created for it with a bit more information how I would like to set evrything up here: A lot of sensors

For some of them it’s no problem to refresh them on an interval like 5/10/30s. But for the door/reed, and motion sensors for example it would be crucial in HA to get the update as soon as the change happens.
Is that possible with RS485?

For now I’ve always come across an update interval.
How would I manage something like that?
Any help is appreciated, thanks!

Pieter

There is no way to get the state change without polling the sensor.
Some Modbus-devices also act as Servers writing to other modbus devices… maybe your sensor supports that?

Works with the Waveshare 8CH Relay PoE Ethernet too.
Just change node function “read 0x00ff” the paramters adress to 0x0000 and quantity to 8 for states (ON/OFF) of the switches (i recomend to change the node name “read 0x00ff” to “read 0x0000” too):

msg.payload = {
‘fc’: 1,
‘unitid’: 1,
‘address’: 0x0000,
‘quantity’: 8,
};
return msg;

BIG THX 4 THAT !!!

Hello everyone

I’m new to Waveshare CH8 POE relays, I connected the latter to a Mosquitto server and a Node-Red

So I communicate with all these little people in MQTT, however I need your help because I want to retrieve the status of the relays and for the moment I cannot do it

However, with the tutorial above I have the impression that it could really help me :slight_smile:

Can you help me and have you modified the relay json config?

THANKS

Hello JujuBois,

i have the Waveshare 8CH to ETH… but musst be the same like the POE.
If you need further help, let me know. The Relais working fine with NodeRed.

SADMSG

This is my config: with switch verify


Modbus [001].json

1 Like

Thanks for the great work, I have the POE version up and running within minutes using this guide. I would just want to add the functionality to restore the state after power reset.

Hi, can you please provide the JSON to implement the verify? I assume that this is to sync the state with the relay position?

Hi, did you manage to get relay b working and could you share the code?

[{“id”:“659bdcb5f51541a2”,“type”:“tab”,“label”:“Waveshare Relay”,“disabled”:false,“info”:“”},{“id”:“51d9992770d87d77”,“type”:“inject”,“z”:“659bdcb5f51541a2”,“name”:“10s”,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:“295200”,“crontab”:“”,“once”:true,“onceDelay”:“10”,“topic”:“”,“payload”:“”,“payloadType”:“date”,“x”:110,“y”:140,“wires”:[[“ce162f6023373f49”]]},{“id”:“ce162f6023373f49”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“read 0x00ff”,“func”:“msg.payload = {\n ‘fc’: 1,\n ‘unitid’: 1,\n ‘address’: 0x0000,\n ‘quantity’: 8,\n};\nreturn msg;”,“outputs”:1,“timeout”:“”,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:190,“y”:220,“wires”:[[“824c5a6f45089bb2”,“b1413baba168e2b7”]]},{“id”:“824c5a6f45089bb2”,“type”:“modbus-flex-getter”,“z”:“659bdcb5f51541a2”,“name”:“Get relay state”,“showStatusActivities”:true,“showErrors”:true,“showWarnings”:true,“logIOActivities”:false,“server”:“bd4c735308ae1a40”,“useIOFile”:false,“ioFile”:“”,“useIOForPayload”:false,“emptyMsgOnFail”:false,“keepMsgProperties”:false,“delayOnStart”:false,“startDelayTime”:“”,“x”:320,“y”:140,“wires”:[[“8f6b07b964a1df38”],[“b1413baba168e2b7”]]},{“id”:“b1413baba168e2b7”,“type”:“debug”,“z”:“659bdcb5f51541a2”,“name”:“”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:“”,“statusType”:“auto”,“x”:690,“y”:380,“wires”:},{“id”:“8f6b07b964a1df38”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“split payload”,“func”:“var msg1= { payload: msg.payload[0] };\nvar msg2= { payload: msg.payload[1] };\nvar msg3= { payload: msg.payload[2] };\nvar msg4= { payload: msg.payload[3] };\nvar msg5= { payload: msg.payload[4] };\nvar msg6= { payload: msg.payload[5] };\nvar msg7= { payload: msg.payload[6] };\nvar msg8= { payload: msg.payload[7] };\nreturn [msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8];”,“outputs”:8,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:550,“y”:80,“wires”:[[“b1413baba168e2b7”,“736a5c0593a642f0”],[“b1413baba168e2b7”,“74d461df46df778e”],[“b1413baba168e2b7”,“6713f01b557d1fd4”],[“b1413baba168e2b7”,“ef37d8f1b685821e”],[“b1413baba168e2b7”,“acc60c3ec5d8b8ca”],[“b1413baba168e2b7”,“97bfe12af38d51ab”],[“b1413baba168e2b7”,“fee966c19b363599”],[“b1413baba168e2b7”,“b5af8b81c34e480b”]]},{“id”:“056f9c4a8fa467ad”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0000”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0000,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:250,“y”:520,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“da2cb8f1688f1716”,“type”:“modbus-flex-write”,“z”:“659bdcb5f51541a2”,“name”:“flip switch”,“showStatusActivities”:false,“showErrors”:true,“server”:“bd4c735308ae1a40”,“emptyMsgOnFail”:false,“keepMsgProperties”:false,“x”:960,“y”:540,“wires”:[[“6a2e6922872c6bce”],[“6a2e6922872c6bce”]]},{“id”:“6a2e6922872c6bce”,“type”:“debug”,“z”:“659bdcb5f51541a2”,“name”:“”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“statusVal”:“”,“statusType”:“auto”,“x”:690,“y”:440,“wires”:},{“id”:“fcad836e9c6a6d96”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0001”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0001,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:270,“y”:560,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“0812d9a2c9f9bcc1”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0002”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0002,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:290,“y”:600,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“99e7c2da0e79d023”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0003”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0003,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:310,“y”:640,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“419daf65d8f65636”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0004”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0004,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:330,“y”:680,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“2fd863635b747c90”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0005”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0005,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:730,“y”:660,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“61cc935cf845bd04”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0006”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0006,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:770,“y”:700,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“d849a2effaf96b3d”,“type”:“function”,“z”:“659bdcb5f51541a2”,“name”:“write 0x0007”,“func”:“var val;\nif (msg.payload==‘on’) {\n val= true;\n}\nif (msg.payload==‘off’) {\n val= false;\n}\nmsg.payload = {\n ‘value’: val,\n ‘fc’: 5,\n ‘unitid’: 1,\n ‘address’: 0x0007,\n ‘quantity’: 1,\n};\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:“”,“finalize”:“”,“libs”:,“x”:790,“y”:740,“wires”:[[“da2cb8f1688f1716”,“6a2e6922872c6bce”]]},{“id”:“736a5c0593a642f0”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 1”,“entityConfig”:“41658a0c3e4cf6e7”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:1000,“y”:20,“wires”:[]},{“id”:“74d461df46df778e”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 2”,“entityConfig”:“71f84316ad9247c0”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:1020,“y”:80,“wires”:[]},{“id”:“6713f01b557d1fd4”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 3”,“entityConfig”:“baca705d8a4fe442”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:1020,“y”:140,“wires”:[]},{“id”:“ef37d8f1b685821e”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 4”,“entityConfig”:“d847e6b60bc9098b”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:1020,“y”:200,“wires”:[]},{“id”:“acc60c3ec5d8b8ca”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 5”,“entityConfig”:“83e56a37c90c03ed”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:1000,“y”:260,“wires”:[]},{“id”:“97bfe12af38d51ab”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 6”,“entityConfig”:“065d1393b7f6924f”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:980,“y”:320,“wires”:[]},{“id”:“fee966c19b363599”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 7”,“entityConfig”:“743e916784976ae3”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:960,“y”:380,“wires”:[]},{“id”:“b5af8b81c34e480b”,“type”:“ha-binary-sensor”,“z”:“659bdcb5f51541a2”,“name”:“Relay 8”,“entityConfig”:“a8517879db8a249f”,“version”:0,“state”:“payload”,“stateType”:“msg”,“attributes”:,“inputOverride”:“allow”,“outputProperties”:,“x”:920,“y”:440,“wires”:[]},{“id”:“7e0545de99882fe6”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 1”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“b8d41cdf21be77c5”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:80,“y”:520,“wires”:[[“056f9c4a8fa467ad”],[“056f9c4a8fa467ad”]]},{“id”:“d9ff71e3853ef0f8”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 2”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“96a61288d8fca7c9”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:80,“y”:580,“wires”:[[“fcad836e9c6a6d96”],[“fcad836e9c6a6d96”]]},{“id”:“233e450d5ae76ce4”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 3”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“dbe556841143b733”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:80,“y”:640,“wires”:[[“0812d9a2c9f9bcc1”],[“0812d9a2c9f9bcc1”]]},{“id”:“1c129e52eb69c1b0”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 4”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“4e0097f58dfc9d4b”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:80,“y”:700,“wires”:[[“99e7c2da0e79d023”],[“99e7c2da0e79d023”]]},{“id”:“f958df5d847917eb”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 5”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“6516cc742509e357”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:80,“y”:760,“wires”:[[“419daf65d8f65636”],[“419daf65d8f65636”]]},{“id”:“a1e044589f93a96e”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 6”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“4e0e595466442e5e”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:560,“y”:680,“wires”:[[“2fd863635b747c90”],[“2fd863635b747c90”]]},{“id”:“6f9309605945e555”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 7”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“237f2ebe1642f5cb”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:560,“y”:740,“wires”:[[“61cc935cf845bd04”],[“61cc935cf845bd04”]]},{“id”:“069a9e1abc8f6868”,“type”:“ha-switch”,“z”:“659bdcb5f51541a2”,“name”:“Switch 8”,“version”:0,“inputs”:1,“outputs”:2,“entityConfig”:“5a325959beb30c03”,“enableInput”:true,“outputOnStateChange”:true,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:“$entity().state ? "on": "off"”,“valueType”:“jsonata”}],“x”:560,“y”:800,“wires”:[[“d849a2effaf96b3d”],[“d849a2effaf96b3d”]]},{“id”:“bd4c735308ae1a40”,“type”:“modbus-client”,“name”:“Waveshare”,“clienttype”:“tcp”,“bufferCommands”:true,“stateLogEnabled”:false,“queueLogEnabled”:false,“failureLogEnabled”:false,“tcpHost”:“192.168.10.115”,“tcpPort”:“502”,“tcpType”:“DEFAULT”,“serialPort”:“/dev/ttyUSB”,“serialType”:“RTU-BUFFERD”,“serialBaudrate”:“9600”,“serialDatabits”:“8”,“serialStopbits”:“1”,“serialParity”:“none”,“serialConnectionDelay”:“100”,“serialAsciiResponseStartDelimiter”:“”,“unit_id”:1,“commandDelay”:1,“clientTimeout”:1000,“reconnectOnTimeout”:true,“reconnectTimeout”:2000,“parallelUnitIdsAllowed”:true,“showErrors”:false,“showWarnings”:true,“showLogs”:true},{“id”:“41658a0c3e4cf6e7”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 1”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 1 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“71f84316ad9247c0”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 2”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 2 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“baca705d8a4fe442”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 3”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 3 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“d847e6b60bc9098b”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 4”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 4 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“83e56a37c90c03ed”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 5”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 5 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“065d1393b7f6924f”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 6”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 6 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“743e916784976ae3”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 7”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 7 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“a8517879db8a249f”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“binary sensor config for Relay 8”,“version”:6,“entityType”:“binary_sensor”,“haConfig”:[{“property”:“name”,“value”:“waveshare relay 8 state”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“b8d41cdf21be77c5”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 1”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 1 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“96a61288d8fca7c9”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 2”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 2 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“dbe556841143b733”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 3”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 3 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“4e0097f58dfc9d4b”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 4”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 4 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“6516cc742509e357”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 5”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 5 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“4e0e595466442e5e”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 6”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 6 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“237f2ebe1642f5cb”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 7”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 7 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“5a325959beb30c03”,“type”:“ha-entity-config”,“server”:“69eb452d.8a610c”,“deviceConfig”:“”,“name”:“switch config for Switch 8”,“version”:6,“entityType”:“switch”,“haConfig”:[{“property”:“name”,“value”:“Waveshare Relay 8 Switch”},{“property”:“device_class”,“value”:“”},{“property”:“icon”,“value”:“”},{“property”:“unit_of_measurement”,“value”:“”},{“property”:“state_class”,“value”:“”},{“property”:“last_reset”,“value”:“”}],“resend”:true},{“id”:“69eb452d.8a610c”,“type”:“server”,“name”:“Home Assistant”,“version”:5,“addon”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:true,“cacheJson”:true,“heartbeat”:false,“heartbeatInterval”:30,“areaSelector”:“friendlyName”,“deviceSelector”:“friendlyName”,“entitySelector”:“friendlyName”,“statusSeparator”:"at: ",“statusYear”:“hidden”,“statusMonth”:“short”,“statusDay”:“numeric”,“statusHourCycle”:“h23”,“statusTimeFormat”:“h:m”,“enableGlobalContextStore”:true}]

hi, can you reupload the json file?

[
    {
        "id": "fd177ccddb85d7c6",
        "type": "tab",
        "label": "Smart Entry [01]",
        "disabled": false,
        "info": "",
        "env": [
            {
                "name": "unitid",
                "value": "1",
                "type": "num"
            },
            {
                "name": "vendor",
                "value": "100",
                "type": "num"
            },
            {
                "name": "expire",
                "value": "{\"R06\":{\"mode\":false,\"time\":2500}}",
                "type": "json"
            }
        ]
    },
    {
        "id": "650182fc5d13a5ce",
        "type": "inject",
        "z": "fd177ccddb85d7c6",
        "name": "Watch",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": true,
        "onceDelay": "0",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 100,
        "y": 660,
        "wires": [
            [
                "4bd156c3ca253f21",
                "01d9ef7ebb2b8446"
            ]
        ]
    },
    {
        "id": "4bd156c3ca253f21",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "let payload = {\n    fc: 0x01,\n    address: 0x0000,\n    quantity: 0x0008\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid')\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 560,
        "wires": [
            [
                "37dc00204e7817bd"
            ]
        ]
    },
    {
        "id": "37dc00204e7817bd",
        "type": "modbus-flex-getter",
        "z": "fd177ccddb85d7c6",
        "name": "Read",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": false,
        "logIOActivities": false,
        "server": "834cbec7d439bdc8",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": true,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 510,
        "y": 480,
        "wires": [
            [
                "d25281c187441bdd",
                "ccbbf4ac6dab235d"
            ],
            []
        ]
    },
    {
        "id": "d25281c187441bdd",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Status",
        "func": "return [\n    { payload: ((msg?.payload?.[0] === true) ? true : false), topic: 'R01' },\n    { payload: ((msg?.payload?.[1] === true) ? true : false), topic: 'R02' },\n    { payload: ((msg?.payload?.[2] === true) ? true : false), topic: 'R03' },\n    { payload: ((msg?.payload?.[3] === true) ? true : false), topic: 'R04' },\n    { payload: ((msg?.payload?.[4] === true) ? true : false), topic: 'R05' },\n    { payload: ((msg?.payload?.[5] === true) ? true : false), topic: 'R06' },\n    { payload: ((msg?.payload?.[6] === true) ? true : false), topic: 'R07' },\n    { payload: ((msg?.payload?.[7] === true) ? true : false), topic: 'R08' }\n];",
        "outputs": 8,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 710,
        "y": 340,
        "wires": [
            [
                "3311b4b564659ac1"
            ],
            [
                "7c0b61d11e23a9bb"
            ],
            [
                "1f523b392a4b32b0"
            ],
            [
                "34bf9fd113479277"
            ],
            [
                "45f11524474369a4"
            ],
            [
                "07091909b5414809"
            ],
            [],
            []
        ]
    },
    {
        "id": "3311b4b564659ac1",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 01",
        "entityConfig": "464d56838e4e33cf",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 60,
        "wires": [
            [
                "f55f7b7329899f5b"
            ]
        ]
    },
    {
        "id": "f55f7b7329899f5b",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 60,
        "wires": [
            [
                "ec625274bfdc5841"
            ]
        ]
    },
    {
        "id": "ec625274bfdc5841",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0000,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 60,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "7c0b61d11e23a9bb",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 02",
        "entityConfig": "e8794c2a86da9183",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 140,
        "wires": [
            [
                "0b0527a4b8010966"
            ]
        ]
    },
    {
        "id": "0b0527a4b8010966",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 140,
        "wires": [
            [
                "1da735adbcce4a2c"
            ]
        ]
    },
    {
        "id": "1da735adbcce4a2c",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0001,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 140,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "1f523b392a4b32b0",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 03",
        "entityConfig": "d4d18e2dfc66ed56",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 220,
        "wires": [
            [
                "83421827add10e58"
            ]
        ]
    },
    {
        "id": "83421827add10e58",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 220,
        "wires": [
            [
                "e04acf328d243bbf"
            ]
        ]
    },
    {
        "id": "e04acf328d243bbf",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0002,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 220,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "34bf9fd113479277",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 04",
        "entityConfig": "2a316d14fc5249ff",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 300,
        "wires": [
            [
                "d2c305830198ff81"
            ]
        ]
    },
    {
        "id": "d2c305830198ff81",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 300,
        "wires": [
            [
                "2e4262a958322637"
            ]
        ]
    },
    {
        "id": "2e4262a958322637",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0003,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 300,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "45f11524474369a4",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 05",
        "entityConfig": "6b5bc229451d9033",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 380,
        "wires": [
            [
                "a879a95e15bee57e"
            ]
        ]
    },
    {
        "id": "a879a95e15bee57e",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 380,
        "wires": [
            [
                "cf6147144c72993d"
            ]
        ]
    },
    {
        "id": "cf6147144c72993d",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0004,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 380,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "07091909b5414809",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 06",
        "entityConfig": "e1316df49e02b6be",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 460,
        "wires": [
            [
                "5ce87d83f52301ef"
            ]
        ]
    },
    {
        "id": "5ce87d83f52301ef",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Verify",
        "func": "let audit = flow.get(msg.topic);\nlet track = env.get('expire')?.[msg.topic];\n\nlet stamp = (typeof audit?.stamp === 'number') ? audit.stamp : 0;\nlet state = (typeof audit?.state === 'boolean') ? audit.state : null;\n\nreturn (\n    typeof track?.mode === 'boolean' &&\n    typeof track?.time === 'number' &&\n    Date.now() - track.time > stamp &&\n    msg.payload !== track.mode\n) ? { enable: track.mode, payload: track.mode, topic: msg.topic } : (\n    Date.now() - 1000 > stamp &&\n    msg.payload !== state\n) ? { enable: msg.payload, payload: msg.payload, topic: msg.topic } : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 460,
        "wires": [
            [
                "985d224e756abd74",
                "60a98160de3eea6b"
            ]
        ]
    },
    {
        "id": "985d224e756abd74",
        "type": "ha-switch",
        "z": "fd177ccddb85d7c6",
        "name": "Open",
        "version": 0,
        "debugenabled": false,
        "inputs": 1,
        "outputs": 2,
        "entityConfig": "fad9f109465b6187",
        "enableInput": true,
        "outputOnStateChange": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "R06",
                "valueType": "str"
            }
        ],
        "x": 1230,
        "y": 460,
        "wires": [
            [
                "60a98160de3eea6b"
            ],
            [
                "60a98160de3eea6b"
            ]
        ]
    },
    {
        "id": "60a98160de3eea6b",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0005,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 460,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "c7eb07def0a26091",
        "type": "modbus-flex-write",
        "z": "fd177ccddb85d7c6",
        "name": "Write",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": false,
        "server": "834cbec7d439bdc8",
        "emptyMsgOnFail": true,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 1910,
        "y": 340,
        "wires": [
            [
                "8d88d476e8def5bd"
            ],
            []
        ]
    },
    {
        "id": "8d88d476e8def5bd",
        "type": "debug",
        "z": "fd177ccddb85d7c6",
        "name": "Write",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 2030,
        "y": 340,
        "wires": []
    },
    {
        "id": "01d9ef7ebb2b8446",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Input",
        "func": "let payload = {\n    fc: 0x02,\n    address: 0x0000,\n    quantity: 0x0008\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid')\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 760,
        "wires": [
            [
                "a0c64898a15343c6"
            ]
        ]
    },
    {
        "id": "a0c64898a15343c6",
        "type": "modbus-flex-getter",
        "z": "fd177ccddb85d7c6",
        "name": "Read",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": false,
        "logIOActivities": false,
        "server": "834cbec7d439bdc8",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": true,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 510,
        "y": 840,
        "wires": [
            [
                "3c6cfe167d1daeb6"
            ],
            []
        ]
    },
    {
        "id": "3c6cfe167d1daeb6",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Status",
        "func": "return [\n    { payload: ((msg?.payload?.[0] === true) ? true : false), topic: 'I01' },\n    { payload: ((msg?.payload?.[1] === true) ? true : false), topic: 'I02' },\n    { payload: ((msg?.payload?.[2] === true) ? true : false), topic: 'I03' },\n    { payload: ((msg?.payload?.[3] === true) ? true : false), topic: 'I04' },\n    { payload: ((msg?.payload?.[4] === true) ? true : false), topic: 'I05' },\n    { payload: ((msg?.payload?.[5] === true) ? true : false), topic: 'I06' },\n    { payload: ((msg?.payload?.[6] === true) ? true : false), topic: 'I07' },\n    { payload: ((msg?.payload?.[7] === true) ? true : false), topic: 'I08' }\n];",
        "outputs": 8,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 710,
        "y": 980,
        "wires": [
            [
                "451f6f2b1497bfb9"
            ],
            [
                "190dc3b4a4a2165b"
            ],
            [
                "e4b750a10a8b9e04"
            ],
            [
                "9f499537158ed561"
            ],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "451f6f2b1497bfb9",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 01",
        "entityConfig": "5b8ef36ab2deac10",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 700,
        "wires": [
            []
        ]
    },
    {
        "id": "190dc3b4a4a2165b",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 02",
        "entityConfig": "7f638f7126437189",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 780,
        "wires": [
            []
        ]
    },
    {
        "id": "e4b750a10a8b9e04",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 03",
        "entityConfig": "4e88bde68612c3bd",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 860,
        "wires": [
            []
        ]
    },
    {
        "id": "9f499537158ed561",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Sensor 04",
        "entityConfig": "b2ac7adbb9de137a",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 930,
        "y": 940,
        "wires": [
            []
        ]
    },
    {
        "id": "bb1e1daa0e4d6e29",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Ping",
        "func": "let payload = {\n    fc: 0x03,\n    address: 0x8000,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid')\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 210,
        "y": 100,
        "wires": [
            [
                "6bd0663bb7e7a7ee"
            ]
        ]
    },
    {
        "id": "6bd0663bb7e7a7ee",
        "type": "modbus-flex-getter",
        "z": "fd177ccddb85d7c6",
        "name": "Read",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": false,
        "logIOActivities": false,
        "server": "834cbec7d439bdc8",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 330,
        "y": 100,
        "wires": [
            [
                "c46901b4dbefe21f",
                "f4175a1dcbb19c4d"
            ],
            []
        ]
    },
    {
        "id": "c46901b4dbefe21f",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Pong",
        "func": "return (msg?.payload?.[0] === env.get('vendor')) ? msg : null;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 210,
        "y": 60,
        "wires": [
            [
                "92cf168a731beabf"
            ]
        ]
    },
    {
        "id": "9a8411b320c710d8",
        "type": "ha-binary-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Alive",
        "entityConfig": "bfcd0f7fd8cb7e75",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 450,
        "y": 60,
        "wires": [
            []
        ]
    },
    {
        "id": "efee3a78879b952a",
        "type": "inject",
        "z": "fd177ccddb85d7c6",
        "name": "Send",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": true,
        "onceDelay": "0",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 90,
        "y": 80,
        "wires": [
            [
                "bb1e1daa0e4d6e29"
            ]
        ]
    },
    {
        "id": "92cf168a731beabf",
        "type": "trigger",
        "z": "fd177ccddb85d7c6",
        "name": "Reset",
        "op1": "true",
        "op2": "false",
        "op1type": "bool",
        "op2type": "bool",
        "duration": "30",
        "extend": true,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 330,
        "y": 60,
        "wires": [
            [
                "9a8411b320c710d8"
            ]
        ]
    },
    {
        "id": "f4175a1dcbb19c4d",
        "type": "debug",
        "z": "fd177ccddb85d7c6",
        "name": "Alive",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 450,
        "y": 100,
        "wires": []
    },
    {
        "id": "5de19b9dea92a9f4",
        "type": "inject",
        "z": "fd177ccddb85d7c6",
        "name": "Pull",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "0",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 90,
        "y": 980,
        "wires": [
            [
                "dbd6bfdb8575649e"
            ]
        ]
    },
    {
        "id": "dbd6bfdb8575649e",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Mode",
        "func": "let payload = {\n    fc: 0x03,\n    address: 0x1000,\n    quantity: 0x0008\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid')\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 210,
        "y": 980,
        "wires": [
            [
                "9671129ff00cd78b"
            ]
        ]
    },

    {
        "id": "9671129ff00cd78b",
        "type": "modbus-flex-getter",
        "z": "fd177ccddb85d7c6",
        "name": "Pull",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": false,
        "logIOActivities": false,
        "server": "834cbec7d439bdc8",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 330,
        "y": 980,
        "wires": [
            [
                "191d79d87720287e"
            ],
            []
        ]
    },
    {
        "id": "191d79d87720287e",
        "type": "debug",
        "z": "fd177ccddb85d7c6",
        "name": "Logic",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 450,
        "y": 1000,
        "wires": []
    },
    {
        "id": "17e16f87b372357f",
        "type": "inject",
        "z": "fd177ccddb85d7c6",
        "name": "Push",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "0",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 90,
        "y": 1020,
        "wires": [
            [
                "cca150b333d1aff9"
            ]
        ]
    },
    {
        "id": "cca150b333d1aff9",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Mode",
        "func": "let payload = {\n    fc: 0x06,\n    value: 0x0000,\n    quantity: 0x0001\n};\n\nfor (let address = 0x1000; address < 0x1008; address++) {\n    node.send({\n        payload: {\n            ...payload,\n            address: address,\n            unitid: env.get('unitid')\n        }\n    });\n}",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 210,
        "y": 1020,
        "wires": [
            [
                "31bba33ecc67b883"
            ]
        ]
    },
    {
        "id": "31bba33ecc67b883",
        "type": "modbus-flex-write",
        "z": "fd177ccddb85d7c6",
        "name": "Push",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": false,
        "server": "834cbec7d439bdc8",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 330,
        "y": 1020,
        "wires": [
            [
                "191d79d87720287e"
            ],
            []
        ]
    },
    {
        "id": "3202bd1f60bcb3d1",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Switch",
        "func": "let push = [];\n\nswitch(msg.payload) {\n    case 'lock': {\n        push = [true, false, false, false, false];\n        break;\n    }\n    case 'auto': {\n        push = [true, true, false, false, false];\n        break;\n    }\n    case 'exit': {\n        push = [true, true, true, false, false];\n        break;\n    }\n    case 'open': {\n        push = [true, true, true, true, false];\n        break;\n    }\n    case 'free': {\n        push = [true, true, true, true, true];\n        break;\n    }\n    default: {\n        push = [false, false, false, false, false];\n        break;\n    }\n}\n\nreturn [\n    { payload: push[0], topic: 'R01' },\n    { payload: push[1], topic: 'R02' },\n    { payload: push[2], topic: 'R03' },\n    { payload: push[3], topic: 'R04' },\n    { payload: push[4], topic: 'R05' }\n];",
        "outputs": 5,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1390,
        "y": 220,
        "wires": [
            [
                "ec625274bfdc5841"
            ],
            [
                "1da735adbcce4a2c"
            ],
            [
                "e04acf328d243bbf"
            ],
            [
                "2e4262a958322637"
            ],
            [
                "cf6147144c72993d"
            ]
        ]
    },
    {
        "id": "4a2749079febc0cd",
        "type": "ha-select",
        "z": "fd177ccddb85d7c6",
        "name": "Mode",
        "version": 1,
        "debugenabled": false,
        "inputs": 0,
        "outputs": 1,
        "entityConfig": "ca04ae043636e7f3",
        "exposeAsEntityConfig": "",
        "mode": "listen",
        "value": "payload",
        "valueType": "msg",
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "value"
            }
        ],
        "x": 1230,
        "y": 220,
        "wires": [
            [
                "3202bd1f60bcb3d1"
            ]
        ]
    },
    {
        "id": "ccbbf4ac6dab235d",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Mode",
        "func": "let l = msg?.payload;\n\nif (l?.[4] === true) {\n    let x = [l?.[3], l?.[2], l?.[1], l?.[0]];\n    return { payload: ((x.every(v => v === true)) ? 'free' : 'error') };\n}\n\nif (l?.[3] === true) {\n    let x = [l?.[2], l?.[1], l?.[0]];\n    return { payload: ((x.every(v => v === true)) ? 'open' : 'error') };\n}\n\nif (l?.[2] === true) {\n    let x = [l?.[1], l?.[0]];\n    return { payload: ((x.every(v => v === true)) ? 'exit' : 'error') };\n}\n\nif (l?.[1] === true) {\n    let x = [l?.[0]];\n    return { payload: ((x.every(v => v === true)) ? 'auto' : 'error') };\n}\n\nif (l?.[0] === true) {\n    return { payload: 'lock' };\n}\n\nreturn { payload: 'off' };",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 710,
        "y": 420,
        "wires": [
            [
                "646b03b01b70adda"
            ]
        ]
    },
    {
        "id": "646b03b01b70adda",
        "type": "ha-sensor",
        "z": "fd177ccddb85d7c6",
        "name": "Mode",
        "entityConfig": "612694ec9714f853",
        "version": 0,
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "inputOverride": "block",
        "outputProperties": [],
        "x": 710,
        "y": 460,
        "wires": [
            []
        ]
    },
    {
        "id": "b3fc59de77e2da10",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0006,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 540,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "2eab7bfd7991dfe8",
        "type": "function",
        "z": "fd177ccddb85d7c6",
        "name": "Relay",
        "func": "flow.set(msg.topic, {\n    state: (msg.payload === true ? true : false),\n    stamp: (Date.now())\n});\n\nlet payload = {\n    fc: 0x05,\n    address: 0x0007,\n    quantity: 0x0001\n};\n\nreturn {\n    payload: {\n        ...payload,\n        unitid: env.get('unitid'),\n        value: flow.get(msg.topic).state\n    }\n};",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1710,
        "y": 620,
        "wires": [
            [
                "c7eb07def0a26091"
            ]
        ]
    },
    {
        "id": "834cbec7d439bdc8",
        "type": "modbus-client",
        "name": "RS485 [01]",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": false,
        "tcpHost": "10.252.100.51",
        "tcpPort": "502",
        "tcpType": "TCP-RTU-BUFFERED",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": 0,
        "commandDelay": 100,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 1000,
        "parallelUnitIdsAllowed": false,
        "showErrors": false,
        "showWarnings": false,
        "showLogs": false
    },
    {
        "id": "464d56838e4e33cf",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode Lock",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode Lock"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "e8794c2a86da9183",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode Auto",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode Auto"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "d4d18e2dfc66ed56",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode Exit",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode Exit"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "2a316d14fc5249ff",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode Open",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode Open"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "6b5bc229451d9033",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode Free",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode Free"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "e1316df49e02b6be",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Open",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Open"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": "diagnostic"
            },
            {
                "property": "device_class",
                "value": "door"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "fad9f109465b6187",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Open",
        "version": "6",
        "entityType": "switch",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Open"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "switch"
            }
        ],
        "resend": false,
        "debugEnabled": false
    },
    {
        "id": "5b8ef36ab2deac10",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Lock",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Lock"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "7f638f7126437189",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Grant",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Grant"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "lock"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "4e88bde68612c3bd",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Door",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Door"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": ""
            },
            {
                "property": "device_class",
                "value": "door"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "b2ac7adbb9de137a",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Error",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Error"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": "diagnostic"
            },
            {
                "property": "device_class",
                "value": "problem"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "bfcd0f7fd8cb7e75",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Status",
        "version": "6",
        "entityType": "binary_sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Status"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": "diagnostic"
            },
            {
                "property": "device_class",
                "value": "running"
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "ca04ae043636e7f3",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode",
        "version": 6,
        "entityType": "select",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": "config"
            },
            {
                "property": "options",
                "value": [
                    "off",
                    "lock",
                    "auto",
                    "exit",
                    "open",
                    "free"
                ]
            }
        ],
        "resend": false,
        "debugEnabled": false
    },
    {
        "id": "612694ec9714f853",
        "type": "ha-entity-config",
        "server": "33fe3dc4c76c022c",
        "deviceConfig": "4d07bec8c54776d9",
        "name": "Smart Entry [01] Mode",
        "version": 6,
        "entityType": "sensor",
        "haConfig": [
            {
                "property": "name",
                "value": "Smart Entry [01] Mode"
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "entity_picture",
                "value": ""
            },
            {
                "property": "entity_category",
                "value": "diagnostic"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            },
            {
                "property": "state_class",
                "value": ""
            }
        ],
        "resend": true,
        "debugEnabled": false
    },
    {
        "id": "33fe3dc4c76c022c",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": true,
        "heartbeatInterval": "60",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": ": ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "default",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": false
    },
    {
        "id": "4d07bec8c54776d9",
        "type": "ha-device-config",
        "name": "Smart Entry [01]",
        "hwVersion": "RS485",
        "manufacturer": "Modbus",
        "model": "Control",
        "swVersion": "1.00"
    },
    {
        "id": "acdc23e6578c1a49",
        "type": "global-config",
        "env": [],
        "modules": {
            "node-red-contrib-modbus": "5.43.0",
            "node-red-contrib-home-assistant-websocket": "0.74.2"
        }
    }
]

Two posts, because code is greater then 32000 :man_shrugging: