Skip to content

Instantly share code, notes, and snippets.

@shortbloke
Created March 30, 2024 23:14
Show Gist options
  • Save shortbloke/98d4b4b9ae8304bb6e18b97fc8a61dec to your computer and use it in GitHub Desktop.
Save shortbloke/98d4b4b9ae8304bb6e18b97fc8a61dec to your computer and use it in GitHub Desktop.
[
{
"id": "63b8d2c4.c0b72c",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "98970a3050192af7",
"type": "modbus-client",
"name": "Dingtian IOT Relay",
"clienttype": "serial",
"bufferCommands": true,
"stateLogEnabled": true,
"queueLogEnabled": false,
"failureLogEnabled": false,
"tcpHost": "192.168.0.211",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyAMA4",
"serialType": "RTU",
"serialBaudrate": "115200",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"serialAsciiResponseStartDelimiter": "0x3A",
"unit_id": "1",
"commandDelay": "1",
"clientTimeout": "1000",
"reconnectOnTimeout": true,
"reconnectTimeout": "2000",
"parallelUnitIdsAllowed": true,
"showErrors": true,
"showWarnings": false,
"showLogs": true
},
{
"id": "b80da51a.e9df88",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "Read Register 0",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 140,
"wires": [
[
"15aae45b.b0db2c"
]
]
},
{
"id": "15aae45b.b0db2c",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Read_Val",
"func": "msg.payload = {\n 'fc' : 3,\n 'unitid' : 1,\n 'address' : 0,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 140,
"wires": [
[
"db0d349c.ebfbb8"
]
]
},
{
"id": "a45e7fe5.f5dea",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 140,
"wires": []
},
{
"id": "1dd7a4d2.0bc71b",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "Relay 1",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 300,
"wires": [
[
"34a8f90c.dfed16"
]
]
},
{
"id": "34a8f90c.dfed16",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "On",
"func": "msg.payload = {\n 'value' : 257,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 300,
"wires": [
[
"8a58329c.efda8"
]
]
},
{
"id": "1c1a1739.e0c899",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Off",
"func": "msg.payload = {\n 'value' : 256,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 340,
"wires": [
[
"8a58329c.efda8"
]
]
},
{
"id": "3ede0e6b.3caba2",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "Relay 1",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 340,
"wires": [
[
"1c1a1739.e0c899"
]
]
},
{
"id": "da2dcd55.c2d2a",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 320,
"wires": []
},
{
"id": "1cc5fa8c.5c1125",
"type": "comment",
"z": "63b8d2c4.c0b72c",
"name": "Read Digital I/O",
"info": "",
"x": 120,
"y": 100,
"wires": []
},
{
"id": "39efc19f.fa39ae",
"type": "comment",
"z": "63b8d2c4.c0b72c",
"name": "Write Digital I/O (Register 3)",
"info": "",
"x": 160,
"y": 260,
"wires": []
},
{
"id": "6c15caeb860b79d0",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "Read Register 1",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": "1",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 200,
"wires": [
[
"e7d03bb78455bcca"
]
]
},
{
"id": "e7d03bb78455bcca",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Read_Val",
"func": "msg.payload = {\n 'fc' : 3,\n 'unitid' : 1,\n 'address' : 1,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 200,
"wires": [
[
"f96326b40b388c6e"
]
]
},
{
"id": "4e66930a68c75259",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 200,
"wires": []
},
{
"id": "fee6a3a214bb194f",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 2",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 400,
"wires": [
[
"2746c7c77eb203b4"
]
]
},
{
"id": "2746c7c77eb203b4",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "On",
"func": "msg.payload = {\n 'value' : 514,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 400,
"wires": [
[
"1b45b679f5843322"
]
]
},
{
"id": "ff9422c4c414d112",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Off",
"func": "msg.payload = {\n 'value' : 512,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 440,
"wires": [
[
"1b45b679f5843322"
]
]
},
{
"id": "776a2e35c5712787",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 2",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 440,
"wires": [
[
"ff9422c4c414d112"
]
]
},
{
"id": "1d9cf9df43ee47b3",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 420,
"wires": []
},
{
"id": "b7217ccb9d9f8d55",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 3",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 500,
"wires": [
[
"c1b4d0210c8ca44a"
]
]
},
{
"id": "c1b4d0210c8ca44a",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "On",
"func": "msg.payload = {\n 'value' : 1028,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 500,
"wires": [
[
"f8edb847fb978a02"
]
]
},
{
"id": "f99dd2b7dfd4ccb9",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Off",
"func": "msg.payload = {\n 'value' : 1024,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 540,
"wires": [
[
"f8edb847fb978a02"
]
]
},
{
"id": "4d34133a9384f78e",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 3",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 540,
"wires": [
[
"f99dd2b7dfd4ccb9"
]
]
},
{
"id": "c120910b4a784646",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 520,
"wires": []
},
{
"id": "4905c4ebf34c5cb0",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 4",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 600,
"wires": [
[
"d4088b42ce14d4fa"
]
]
},
{
"id": "d4088b42ce14d4fa",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "On",
"func": "msg.payload = {\n 'value' : 2056,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 600,
"wires": [
[
"1e51b9518ca6f516"
]
]
},
{
"id": "4c46f17d872709d6",
"type": "function",
"z": "63b8d2c4.c0b72c",
"name": "Off",
"func": "msg.payload = {\n 'value' : 2048,\n 'fc' : 6,\n 'unitid' : 1,\n 'address' : 2,\n 'quantity' : 1\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 330,
"y": 640,
"wires": [
[
"1e51b9518ca6f516"
]
]
},
{
"id": "2a4f70dc92b175cf",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "relay 4",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 640,
"wires": [
[
"4c46f17d872709d6"
]
]
},
{
"id": "3d6806d984150fba",
"type": "debug",
"z": "63b8d2c4.c0b72c",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 720,
"y": 620,
"wires": []
},
{
"id": "db0d349c.ebfbb8",
"type": "modbus-flex-getter",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"server": "98970a3050192af7",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 510,
"y": 140,
"wires": [
[
"a45e7fe5.f5dea"
],
[]
]
},
{
"id": "f96326b40b388c6e",
"type": "modbus-flex-getter",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"server": "98970a3050192af7",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 510,
"y": 200,
"wires": [
[
"4e66930a68c75259"
],
[]
]
},
{
"id": "8a58329c.efda8",
"type": "modbus-flex-write",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": true,
"showErrors": true,
"showWarnings": true,
"server": "98970a3050192af7",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"delayOnStart": false,
"startDelayTime": "",
"x": 510,
"y": 320,
"wires": [
[
"da2dcd55.c2d2a"
],
[]
]
},
{
"id": "1b45b679f5843322",
"type": "modbus-flex-write",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": true,
"showErrors": true,
"server": "98970a3050192af7",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 510,
"y": 420,
"wires": [
[
"1d9cf9df43ee47b3"
],
[]
]
},
{
"id": "f8edb847fb978a02",
"type": "modbus-flex-write",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": true,
"showErrors": true,
"server": "98970a3050192af7",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 510,
"y": 520,
"wires": [
[
"c120910b4a784646"
],
[]
]
},
{
"id": "1e51b9518ca6f516",
"type": "modbus-flex-write",
"z": "63b8d2c4.c0b72c",
"name": "",
"showStatusActivities": true,
"showErrors": true,
"server": "98970a3050192af7",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 510,
"y": 620,
"wires": [
[
"3d6806d984150fba"
],
[]
]
},
{
"id": "16a1170e09b87401",
"type": "rpi-gpio out",
"z": "63b8d2c4.c0b72c",
"name": "Buzzer",
"pin": "6",
"set": true,
"level": "0",
"freq": "",
"out": "out",
"bcm": true,
"x": 700,
"y": 780,
"wires": []
},
{
"id": "ab0c94c309112e18",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 110,
"y": 760,
"wires": [
[
"16a1170e09b87401"
]
]
},
{
"id": "c984aebcf7b1d517",
"type": "inject",
"z": "63b8d2c4.c0b72c",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "false",
"payloadType": "bool",
"x": 110,
"y": 800,
"wires": [
[
"16a1170e09b87401"
]
]
},
{
"id": "ee47e9e507d09137",
"type": "comment",
"z": "63b8d2c4.c0b72c",
"name": "Buzzer (GPIO 6)",
"info": "",
"x": 100,
"y": 720,
"wires": []
},
{
"id": "dda94251c3d7ecde",
"type": "comment",
"z": "63b8d2c4.c0b72c",
"name": "RS485",
"info": "",
"x": 70,
"y": 60,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment