Daten in Influx: die MongoDB raus genommen

This commit is contained in:
rxf
2026-06-17 18:27:23 +02:00
parent 5dff58283e
commit ddf3a6598f
2 changed files with 8 additions and 417 deletions
+7 -416
View File
@@ -234,8 +234,7 @@
"wires": [ "wires": [
[ [
"e7113fd1f1cb5375", "e7113fd1f1cb5375",
"057123c49327e982", "057123c49327e982"
"4d375d7b71ed95af"
] ]
] ]
}, },
@@ -297,8 +296,7 @@
"wires": [ "wires": [
[ [
"8e697f374b0d59c2", "8e697f374b0d59c2",
"0fed74f96c718b5f", "0fed74f96c718b5f"
"71da459e1eb610b3"
] ]
] ]
}, },
@@ -1622,7 +1620,6 @@
"wires": [ "wires": [
[ [
"cf55cbbf405be02b", "cf55cbbf405be02b",
"67608e37315c60dd",
"980ffcb9b3562a71" "980ffcb9b3562a71"
] ]
] ]
@@ -1893,8 +1890,7 @@
"wires": [ "wires": [
[ [
"ae107129cb3cf180", "ae107129cb3cf180",
"b14419e197014f22", "b14419e197014f22"
"c71309141de72ef5"
] ]
] ]
}, },
@@ -2243,84 +2239,10 @@
"y": 2180, "y": 2180,
"wires": [ "wires": [
[ [
"d9df2ad9c5de5c68", "d9df2ad9c5de5c68"
"7d644edb8b6448d7"
] ]
] ]
}, },
{
"id": "5a1c90bf0fc446ea",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1250,
"y": 2260,
"wires": [
[
"50002a84d65e7602"
]
]
},
{
"id": "7d644edb8b6448d7",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 6",
"func": "const s2r = [\n { name: \"TH_1\", room: \"SZ\" }, \n { name: \"TH_2\", room: \"KT\" },\n { name: \"TH_3\", room: \"EZ\" }, \n { name: \"TH_4\", room: \"KU\" },\n { name: \"TH_5\", room: \"WZ\" },\n { name: \"TH_6\", room: \"EZ\" },\n { name: \"TH_7\", room: \"FL\" },\n { name: \"TH_8\", room: \"KO\" },\n { name: \"TH_9\", room: \"AU\" },\n { name: \"Temp_Feuchte_Mini_1\", room: \"BA\" }, \n { name: \"Licht_Sensor\", room: \"BD\" } \n]\nlet room = \"\"\nlet s = msg.topic.split('/')\nfor (let x of s2r) {\n if (x.name === s[1]) {\n room = x.room\n break\n }\n}\nmsg.operation = \"insertOne\"\nmsg.collection = \"th_sensoren\"\ndelete msg.payload.linkquality\nmsg.payload.room = room\nmsg.payload.datetime = new Date()\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 2260,
"wires": [
[
"dd4f303cf0ebd60a",
"5a1c90bf0fc446ea"
]
]
},
{
"id": "dd4f303cf0ebd60a",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 29",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1240,
"y": 2200,
"wires": []
},
{
"id": "50002a84d65e7602",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 30",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1480,
"y": 2260,
"wires": []
},
{ {
"id": "cf5b8ae7977ea244", "id": "cf5b8ae7977ea244",
"type": "comment", "type": "comment",
@@ -2591,134 +2513,6 @@
] ]
] ]
}, },
{
"id": "c71309141de72ef5",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 10",
"func": "msg.payload.wallbox = 1\nmsg.operation = \"insertOne\"\nmsg.collection = \"auto\"\nmsg.payload.datetime = new Date()\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 1740,
"wires": [
[
"062d4d20ef2912da"
]
]
},
{
"id": "062d4d20ef2912da",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1190,
"y": 1740,
"wires": [
[
"71508f12e88f8608"
]
]
},
{
"id": "71508f12e88f8608",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 34",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1380,
"y": 1740,
"wires": []
},
{
"id": "3569c43cd47502ee",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1190,
"y": 960,
"wires": [
[
"f7e8254c72cfe335"
]
]
},
{
"id": "f7e8254c72cfe335",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 35",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1360,
"y": 960,
"wires": []
},
{
"id": "67608e37315c60dd",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 11",
"func": "let pl = flow.get('pl') || {}\nif (msg.topic.indexOf('chn0') != -1) {\n pl.arbeit = msg.payload\n flow.set('pl', pl)\n}\nif (msg.topic.indexOf('chn1') != -1) {\n pl.leistung = msg.payload\n msg.payload = pl \n flow.set('pl', {})\n msg.operation = \"insertOne\"\n msg.collection = \"strom\"\n msg.payload.meta = 0\n msg.payload.datetime = new Date()\n return msg;\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 590,
"y": 960,
"wires": [
[
"1eadf1113bdf28a7",
"3569c43cd47502ee"
]
]
},
{
"id": "1eadf1113bdf28a7",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 36",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 1000,
"wires": []
},
{ {
"id": "fe04f6c77be768d2", "id": "fe04f6c77be768d2",
"type": "config", "type": "config",
@@ -2767,6 +2561,7 @@
"name": "function 13", "name": "function 13",
"func": "msg.maschine = \"spuelmaschine\"\nreturn msg;", "func": "msg.maschine = \"spuelmaschine\"\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": "",
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
@@ -2816,8 +2611,7 @@
"y": 1300, "y": 1300,
"wires": [ "wires": [
[ [
"0b62dc3894e2849f", "0b62dc3894e2849f"
"34d7609bd881bc68"
] ]
] ]
}, },
@@ -2943,207 +2737,6 @@
] ]
] ]
}, },
{
"id": "d7ec58f8201534a5",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1370,
"y": 1400,
"wires": [
[
"030e4ec5b7dcf040"
]
]
},
{
"id": "030e4ec5b7dcf040",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 38",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1560,
"y": 1400,
"wires": []
},
{
"id": "34d7609bd881bc68",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 17",
"func": "msg.payload.datetime = new Date()\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1510,
"y": 1340,
"wires": [
[
"d7ec58f8201534a5"
]
]
},
{
"id": "4d375d7b71ed95af",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 18",
"func": "msg.payload.meta = msg.measurement\nmsg.operation = 'insertOne'\nmsg.collection = 'therme'\nmsg.payload.datetime = new Date()\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1070,
"y": 180,
"wires": [
[
"357915e1a4f40858",
"fdcedbc2241a3978"
]
]
},
{
"id": "357915e1a4f40858",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 39",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1260,
"y": 180,
"wires": []
},
{
"id": "fdcedbc2241a3978",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1277.1666259765625,
"y": 234.16665649414062,
"wires": [
[
"b6f5d9d1a657e773"
]
]
},
{
"id": "b6f5d9d1a657e773",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 40",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1457.1666259765625,
"y": 234.16665649414062,
"wires": []
},
{
"id": "71da459e1eb610b3",
"type": "function",
"z": "86a9e7aa0c304b46",
"name": "function 19",
"func": "msg.payload.datetime = new Date()\nmsg.operation = 'insertOne'\nmsg.collection = 'heizung'\nmsg.payload.metadata = { \"room\": msg.room, \"type\": \"fenster\"}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1330,
"y": 340,
"wires": [
[
"31d348a98878d4dd",
"4fe3a7b1afc0e974"
]
]
},
{
"id": "31d348a98878d4dd",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 41",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1520,
"y": 340,
"wires": []
},
{
"id": "4fe3a7b1afc0e974",
"type": "mongodb4",
"z": "86a9e7aa0c304b46",
"clientNode": "874361936f1ce815",
"mode": "collection",
"collection": "",
"operation": "",
"output": "toArray",
"maxTimeMS": "0",
"handleDocId": false,
"name": "",
"x": 1410,
"y": 420,
"wires": [
[
"781ebe816973e5c9"
]
]
},
{
"id": "781ebe816973e5c9",
"type": "debug",
"z": "86a9e7aa0c304b46",
"name": "debug 42",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1590,
"y": 420,
"wires": []
},
{ {
"id": "63b409f7976b2641", "id": "63b409f7976b2641",
"type": "mqtt in", "type": "mqtt in",
@@ -15234,9 +14827,7 @@
"x": 1240, "x": 1240,
"y": 340, "y": 340,
"wires": [ "wires": [
[ []
"9c0b8962102aee05"
]
] ]
}, },
{ {
+1 -1
View File
@@ -1,3 +1,3 @@
{ {
"$": "f01513a8b83c3a0887028c54b5640db8gGCrychy+oyTLGyVT8jvkUkRmQNNj325UDBCvh6hVnUxkBbHhBqWkdi1MeiI2cICEMp6AGkbByFPFFHgkccqHsLubCkbkgCvrfxGmCGPuruR4oRGadoLRGMnIewhzvudklce6AJrxjGCuVrv5VP9BeviwBbl1FoA6IC9Giv3JBWEc8/WJAlgtaJEf+97xtqONpP8v00osoL1hPUFAyiF286MjbSCRzzSvEhtBN8tGu0pLjnoIWC9vbNhxpnmZU5hyYKcLnPCjjF0CbZlAQPM2WCqraaABtqMg7s/mqIc2Dh1ftxQDqZxdrWgRu4Fd4MsXcs8WFHeQyPpL9cgBDzcbgu9+ealVJ0v8UNSzAUdWJT2en1sERs8UnNo9Ey8fo/KhJcl7MORKygc4mXu/7OQjcO5YUgTE6R/eTE5AvqGDI2vJmfZO0Saa3GqnFliJK6cAt/JrKbX4JqqctnjSpLLE7YgOBuwq0O5KazAbO1KEaZNQ5LPzoFO4h0IOqhCG7cPLeNxiakuvhAM/MKUIDJ+D11V81Iqv0JRfZMdPpC8bgLKrAmmbAkk4g8SWDplc8UukADntWWHnOpaGgOg6xiEmpYgGEsHLNQ+axEp0ZfjjA+QWtdK4Z7xJbRjdSnROYYSbSPO9EXCIMSjg8AMXsiiD9I+R3sryp3CpMTxkGFW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