Here is an example:
[
{
"id": "5e1ea70e4ed1df8a",
"type": "inject",
"z": "02f78812994b35d8",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 850,
"y": 1540,
"wires": [
[
"43e2a9f5ea06e926"
]
]
},
{
"id": "43e2a9f5ea06e926",
"type": "function",
"z": "02f78812994b35d8",
"name": "add ts",
"func": "const now = new Date();\nnow.setSeconds(0,0);\nnow.setMinutes(0);\nmsg.ts = now.getTime();\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 970,
"y": 1540,
"wires": [
[
"4f102ab31c47bebf"
]
]
},
{
"id": "f927b58ed38a3e4e",
"type": "buffer-parser",
"z": "02f78812994b35d8",
"name": "power",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "floatbe",
"name": "active_power_1",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatbe",
"name": "active_power_2",
"offset": 4,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatbe",
"name": "active_power_3",
"offset": 8,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
},
{
"type": "floatbe",
"name": "power_consumption",
"offset": 12,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "value",
"resultTypeType": "return",
"multipleResult": true,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 1230,
"y": 1540,
"wires": [
[
"51f76b7beb2bfac4"
]
]
},
{
"id": "51f76b7beb2bfac4",
"type": "debug",
"z": "02f78812994b35d8",
"name": "debug",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1350,
"y": 1540,
"wires": []
},
{
"id": "4f102ab31c47bebf",
"type": "function",
"z": "02f78812994b35d8",
"name": "modbus",
"func": "const ts = msg.ts;\nmsg = {\n topic: \"power\",\n payload: [\n 16572,\n 48928,\n 16570,\n 34562,\n 16551,\n 58778,\n 16775,\n 51951,\n 65472,\n 0,\n 65472,\n 0,\n 65472,\n 0,\n 16640,\n 22210,\n 65472,\n 0,\n 65472,\n 0,\n 65472,\n 0,\n 16790,\n 12527\n ],\n \"modbusRequest\": {\n \"unitid\": null,\n \"fc\": 3,\n \"address\": 3053,\n \"quantity\": 24,\n \"emptyMsgOnFail\": false,\n \"keepMsgProperties\": true,\n \"messageId\": \"675c0f83747ecdc714a345fa\"\n },\n \"responseBuffer\": {\n \"data\": [\n 16572,\n 48928,\n 16570,\n 34562,\n 16551,\n 58778,\n 16775,\n 51951,\n 65472,\n 0,\n 65472,\n 0,\n 65472,\n 0,\n 16640,\n 22210,\n 65472,\n 0,\n 65472,\n 0,\n 65472,\n 0,\n 16790,\n 12527\n ],\n \"buffer\": [\n 64,\n 188,\n 191,\n 32,\n 64,\n 186,\n 135,\n 2,\n 64,\n 167,\n 229,\n 154,\n 65,\n 135,\n 202,\n 239,\n 255,\n 192,\n 0,\n 0,\n 255,\n 192,\n 0,\n 0,\n 255,\n 192,\n 0,\n 0,\n 65,\n 0,\n 86,\n 194,\n 255,\n 192,\n 0,\n 0,\n 255,\n 192,\n 0,\n 0,\n 255,\n 192,\n 0,\n 0,\n 65,\n 150,\n 48,\n 239\n ]\n }\n};\n\nmsg.ts = ts;\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 1540,
"wires": [
[
"f927b58ed38a3e4e"
]
]
}
]