mqtt splitter flow
This commit is contained in:
@@ -467,7 +467,7 @@
|
|||||||
},
|
},
|
||||||
"node-red-contrib-telegrambot": {
|
"node-red-contrib-telegrambot": {
|
||||||
"name": "node-red-contrib-telegrambot",
|
"name": "node-red-contrib-telegrambot",
|
||||||
"version": "16.3.2",
|
"version": "15.1.11",
|
||||||
"local": true,
|
"local": true,
|
||||||
"user": true,
|
"user": true,
|
||||||
"nodes": {
|
"nodes": {
|
||||||
@@ -731,7 +731,7 @@
|
|||||||
},
|
},
|
||||||
"node-red-node-email": {
|
"node-red-node-email": {
|
||||||
"name": "node-red-node-email",
|
"name": "node-red-node-email",
|
||||||
"version": "3.0.3",
|
"version": "0.1.29",
|
||||||
"local": true,
|
"local": true,
|
||||||
"user": true,
|
"user": true,
|
||||||
"nodes": {
|
"nodes": {
|
||||||
@@ -739,8 +739,7 @@
|
|||||||
"name": "email",
|
"name": "email",
|
||||||
"types": [
|
"types": [
|
||||||
"e-mail",
|
"e-mail",
|
||||||
"e-mail in",
|
"e-mail in"
|
||||||
"e-mail mta"
|
|
||||||
],
|
],
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"local": true,
|
"local": true,
|
||||||
@@ -768,5 +767,24 @@
|
|||||||
"file": "/data/node_modules/node-red-node-ui-table/node.js"
|
"file": "/data/node_modules/node-red-node-ui-table/node.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"node-red-contrib-inspector": {
|
||||||
|
"name": "node-red-contrib-inspector",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"local": true,
|
||||||
|
"user": true,
|
||||||
|
"nodes": {
|
||||||
|
"node-inspector": {
|
||||||
|
"name": "node-inspector",
|
||||||
|
"types": [
|
||||||
|
"node-inspector"
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"local": true,
|
||||||
|
"user": false,
|
||||||
|
"module": "node-red-contrib-inspector",
|
||||||
|
"file": "/data/node_modules/node-red-contrib-inspector/node_inspector.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
},
|
},
|
||||||
"menu-menu-item-palette": true,
|
"menu-menu-item-palette": true,
|
||||||
"debug": {
|
"debug": {
|
||||||
"filter": "filterCurrent"
|
"filter": "filterCurrent",
|
||||||
|
"clearType": "all"
|
||||||
},
|
},
|
||||||
"menu-deploymenu-item-node": true,
|
"menu-deploymenu-item-node": true,
|
||||||
"menu-deploymenu-item-full": false,
|
"menu-deploymenu-item-full": false,
|
||||||
|
|||||||
1
nodered/.gitignore
vendored
1
nodered/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
.npm
|
||||||
node_modules
|
node_modules
|
||||||
*.backup
|
*.backup
|
||||||
package.json
|
package.json
|
||||||
|
|||||||
@@ -75,7 +75,6 @@
|
|||||||
"sockspassword": "",
|
"sockspassword": "",
|
||||||
"bothost": "",
|
"bothost": "",
|
||||||
"botpath": "",
|
"botpath": "",
|
||||||
"localbothost": "",
|
|
||||||
"localbotport": "8443",
|
"localbotport": "8443",
|
||||||
"publicbotport": "8443",
|
"publicbotport": "8443",
|
||||||
"privatekey": "",
|
"privatekey": "",
|
||||||
@@ -876,11 +875,7 @@
|
|||||||
"z": "88633c3e.1b273",
|
"z": "88633c3e.1b273",
|
||||||
"server": "email-smtp.eu-west-1.amazonaws.com",
|
"server": "email-smtp.eu-west-1.amazonaws.com",
|
||||||
"port": "587",
|
"port": "587",
|
||||||
"authtype": "BASIC",
|
|
||||||
"saslformat": false,
|
|
||||||
"token": "oauth2Response.access_token",
|
|
||||||
"secure": false,
|
"secure": false,
|
||||||
"tls": true,
|
|
||||||
"name": "rik.veenboer@gmail.com",
|
"name": "rik.veenboer@gmail.com",
|
||||||
"dname": "Email",
|
"dname": "Email",
|
||||||
"x": 710,
|
"x": 710,
|
||||||
@@ -1102,7 +1097,7 @@
|
|||||||
"type": "function",
|
"type": "function",
|
||||||
"z": "828acdf03ca58b4b",
|
"z": "828acdf03ca58b4b",
|
||||||
"name": "function 1",
|
"name": "function 1",
|
||||||
"func": "// for (const [key, value] of Object.entries(msg.payload)) {\n// node.send({\n// topic: \"borgmatic/split/\" + key,\n// payload: value\n// });\n// }\nfunction flatten(obj, prefix, baseTopic, result) {\n for (const [key, value] of Object.entries(obj)) {\n const newPrefix = prefix ? prefix + \"/\" + key : key;\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n flatten(value, newPrefix, baseTopic, result);\n } else {\n result.push({\n topic: baseTopic + \"/\" + newPrefix,\n payload: value\n });\n }\n }\n}\n\nlet result = [];\n\nflatten(msg.payload, \"\", msg.topic || \"borgmatic/split\", result);\n\n// return multiple messages\nreturn result;\n\n// return null; // because we already emitted messages",
|
"func": "const selections = [\n // [\"name\", \"name\"],\n [\"start\", \"start\"],\n [\"end\", \"end\"],\n [\"duration\", \"duration\"],\n [\"compressed_size\", \"stats.compressed_size\"],\n [\"deduplicated_size\", \"stats.deduplicated_size\"],\n [\"nfiles\", \"stats.nfiles\"],\n [\"original_size\", \"stats.original_size\"],\n];\n\nconst getPath = (obj, path) =>\n path.split('.').reduce((o, k) => (o?.[k] !== undefined ? o[k] : undefined), obj);\n\nconst namespace = msg.topic.split('/').pop()\n\nconst messages = selections.flatMap(([name, path]) => {\n const val = getPath(msg.payload, path);\n return val === undefined\n ? []\n : [{ topic: `borgmatic/split/${namespace}/${name}`, payload: val }];\n});\n\nreturn [messages];",
|
||||||
"outputs": 1,
|
"outputs": 1,
|
||||||
"timeout": 0,
|
"timeout": 0,
|
||||||
"noerr": 0,
|
"noerr": 0,
|
||||||
@@ -1113,7 +1108,8 @@
|
|||||||
"y": 240,
|
"y": 240,
|
||||||
"wires": [
|
"wires": [
|
||||||
[
|
[
|
||||||
"50a0bb8c03545b5c"
|
"50a0bb8c03545b5c",
|
||||||
|
"13e002897ab3b6ab"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -1124,12 +1120,13 @@
|
|||||||
"name": "debug 1",
|
"name": "debug 1",
|
||||||
"active": true,
|
"active": true,
|
||||||
"tosidebar": true,
|
"tosidebar": true,
|
||||||
"console": false,
|
"console": true,
|
||||||
"tostatus": false,
|
"tostatus": false,
|
||||||
"complete": "false",
|
"complete": "payload",
|
||||||
|
"targetType": "msg",
|
||||||
"statusVal": "",
|
"statusVal": "",
|
||||||
"statusType": "auto",
|
"statusType": "auto",
|
||||||
"x": 360,
|
"x": 650,
|
||||||
"y": 120,
|
"y": 120,
|
||||||
"wires": []
|
"wires": []
|
||||||
},
|
},
|
||||||
@@ -1150,5 +1147,47 @@
|
|||||||
"x": 650,
|
"x": 650,
|
||||||
"y": 240,
|
"y": 240,
|
||||||
"wires": []
|
"wires": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0a5f517589902b57",
|
||||||
|
"type": "node-inspector",
|
||||||
|
"z": "828acdf03ca58b4b",
|
||||||
|
"inputField": "payload",
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"portNumber": 9229,
|
||||||
|
"autoStart": true,
|
||||||
|
"name": "",
|
||||||
|
"x": 580,
|
||||||
|
"y": 340,
|
||||||
|
"wires": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "f297a215e3db36f2",
|
||||||
|
"type": "inject",
|
||||||
|
"z": "828acdf03ca58b4b",
|
||||||
|
"name": "",
|
||||||
|
"props": [
|
||||||
|
{
|
||||||
|
"p": "topic",
|
||||||
|
"vt": "str"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"p": "payload"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repeat": "",
|
||||||
|
"crontab": "",
|
||||||
|
"once": false,
|
||||||
|
"onceDelay": 0.1,
|
||||||
|
"topic": "borgmatic/stats/xyz",
|
||||||
|
"payload": "{\"command_line\":[\"/opt/homebrew/bin/borg\",\"create\",\"--patterns-from\",\"/var/folders/qh/8vg7yzzx6gj8y6tw327zbt380000gn/T/borgmatic-fbvbjxj_/borgmatic/tmpusnc8t0m\",\"--compression\",\"lz4\",\"--umask\",\"22\",\"--log-json\",\"--json\",\"/Users/rik/Downloads/repo::{now:%Y-%m-%d_%H%M%S}\"],\"duration\":0.003158,\"end\":\"2025-09-30T19:45:56.000000\",\"id\":\"467e209e97503853132b3e11ec1c8e3a21e00dd8224fa1e22d541c6d1670c094\",\"limits\":{\"max_archive_size\":0.000031518997777886815},\"name\":\"2025-09-30_194556\",\"start\":\"2025-09-30T19:45:56.000000\",\"stats\":{\"compressed_size\":1170,\"deduplicated_size\":661,\"nfiles\":2,\"original_size\":1286}}",
|
||||||
|
"payloadType": "json",
|
||||||
|
"x": 190,
|
||||||
|
"y": 420,
|
||||||
|
"wires": [
|
||||||
|
[
|
||||||
|
"2cc041d2f5a4a7ee"
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user