UNPKG

node-red-contrib-octocore

Version:

OctoCore implementation for node-red

1,891 lines (1,890 loc) 50.5 kB
[ { "id": "0b30cc47ed4855ca", "type": "tab", "label": "node-red-contrib-octocore", "disabled": false, "info": "", "env": [] }, { "id": "2260c6585d4dbb9e", "type": "group", "z": "0b30cc47ed4855ca", "name": "Publish", "style": { "label": true }, "nodes": [ "1f2a3b20c32ff1bd", "d28972502fa90fdf", "5588887d1c1d9701", "e5e8b8b52ef87365", "118c2bef21d0ae32", "0a5724e9bce8a802", "d6e894188e9a0ff4", "5db4eb6f911cc3a7", "2a0d34f0425af48b", "c567733c17e61870", "686c690098a643fe", "284214b05c4014af", "0c4bbf649dafa2eb" ], "x": 54, "y": 19, "w": 592, "h": 462 }, { "id": "ec9e26937c677349", "type": "group", "z": "0b30cc47ed4855ca", "name": "Subscribe", "style": { "label": true }, "nodes": [ "f72f5a4e7a35fe17", "ac1077437d7f76fd", "c35009cac7b6b6f4", "4836e6464ba70952", "8244a583f814651b", "da1ee4a11d940cef", "308260d44df7f01b", "f7149d54436cafaf", "85fe1d3d2ff91678", "351d7b5291e34d0b", "a737813adeebb8d1", "18f32d37d323161c", "51e40251d09d8dcb", "def83ec262599974", "a6ad7be0a0265a27", "aa768c8e5a07ce03", "80b6e40d1888552d", "2e448b9b3dbf8508", "732c396ad8df58c7", "2e28d522a7bc2456", "2eb8a3111bb988cf" ], "x": 674, "y": 19, "w": 692, "h": 722 }, { "id": "34562cb0d49a22a4", "type": "group", "z": "0b30cc47ed4855ca", "name": "Events", "style": { "label": true }, "nodes": [ "bf32e9c8d2c0f663", "2524f1e6a1f49e29", "4115a3b91feff65d", "1fbac65dec566fcb", "e6034cd2eb6da601", "29cc2c97963d0f70", "c4a70205eda493bf", "1e011858930d8b78", "a6d6e003288a507a", "36b2e3e8cdcc1245", "6d3841cce2cb4c15", "5861508310d1814b", "a50474c195ebe62b", "0af2b3ee932489df", "a25482ec7ec18df9", "138891e866ea6118", "a3c0755621a125d2", "88ac53ae4861941e", "fa99a084b0413b07", "d2e807a46943f2f9", "8f69b5a2a7568c0f", "f6ef07babfdb456a", "eb50702608c8a477", "c018c5b4b4ae6fb6", "efef94677a5bcf7f", "1eafc1d951c7918b" ], "x": 46.5157470703125, "y": 779, "w": 1279.4842529296875, "h": 702 }, { "id": "a9babff0bceefa8b", "type": "group", "z": "0b30cc47ed4855ca", "name": "Request", "style": { "label": true }, "nodes": [ "e79bec4f62c1f36e", "c069a579cde0ed93", "dd3d2e1b4bb8b056", "eeaada3a27d63a2b", "7f81798d719d80c4", "db792b66d7748bb4", "82b6665b4118ed91", "4071816247ec4339", "416b729a0472b39c", "53427b35315f29a3" ], "x": 34, "y": 1539, "w": 1312, "h": 302 }, { "id": "976e10947bdcf325", "type": "group", "z": "0b30cc47ed4855ca", "name": "Request with Auto-Reply", "style": { "label": true }, "nodes": [ "inject-request", "publish-with-autoreply", "process-and-reply", "debug-reply", "subscribe-listen", "debug-request" ], "x": 34, "y": 1879, "w": 1072, "h": 222 }, { "id": "efef94677a5bcf7f", "type": "junction", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "x": 720, "y": 820, "wires": [ [ "0af2b3ee932489df", "eb50702608c8a477" ] ] }, { "id": "1eafc1d951c7918b", "type": "junction", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "x": 780, "y": 1180, "wires": [ [ "e6034cd2eb6da601", "c018c5b4b4ae6fb6" ] ] }, { "id": "110762cb605880d1", "type": "tls-config", "name": "ignore", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": false, "alpnprotocol": "" }, { "id": "9c22963189a40c4c", "type": "tls-config", "name": "ignore", "cert": "", "key": "", "ca": "", "certname": "", "keyname": "", "caname": "", "servername": "", "verifyservercert": false, "alpnprotocol": "" }, { "id": "a90004657a205360", "type": "uns-server", "server": "nats://100.98.43.51:4222", "authMethod": "userpass", "enableTLS": false, "tlsRejectUnauthorized": true, "tlsCaFile": "", "tlsCertFile": "", "tlsKeyFile": "", "maxReconnectAttempts": 10, "reconnectTimeWait": 1000, "timeout": 10000, "pingInterval": 30000, "maxPingOut": 3, "debug": false }, { "id": "5383bf25829606d6", "type": "global-config", "env": [], "modules": { "node-red-contrib-octocore": "0.0.14" } }, { "id": "uns-server-config", "type": "uns-server", "server": "nats://localhost:4222", "maxReconnectAttempts": 10 }, { "id": "bf32e9c8d2c0f663", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 840, "wires": [ [ "2524f1e6a1f49e29" ] ] }, { "id": "2524f1e6a1f49e29", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Point Sim", "func": "function generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n\n// ISO-Zeit mit .toISOString()\nlet now = new Date();\n\nlet payload = msg.payload;\n\nmsg.payload = {\n id: generateUUID(),\n type: \"point\",\n startTime: now.toISOString(), // ISO Format\n endTime: now.toISOString(), // ISO Format\n payload: payload ,\n \n};\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 380, "y": 840, "wires": [ [ "efef94677a5bcf7f" ] ] }, { "id": "4115a3b91feff65d", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Intervall Sim", "func": "// Test-Generator für Intervall-Events (interval_start / interval_end)\n\nfunction generateUUid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n\n// Zustand laden\nlet running = context.get('running') || false; // false -> nächstes Event ist Start\nlet eventid = context.get('eventid') || null;\nconst nowIso = new Date().toISOString();\n\n// Payload-Quelle (optional: eigene Daten via msg.payload übergeben)\nconst payloadData = (msg && msg.payload && typeof msg.payload === 'object' && !Array.isArray(msg.payload))\n ? msg.payload\n : { Message: \"test\" };\n\n// Basisausgabe ohne Zeitfelder (werden je nach Typ ergänzt)\nlet out = {\n \"id\": \"\",\n // \"unsElementid\": \"f00f9cf9-ab6d-4510-ae48-522c635a3341\",\n \"type\": \"\",\n \"payload\": payloadData\n};\n\nif (!running) {\n // interval_start\n eventid = generateUUid();\n context.set('eventid', eventid);\n\n out.id = eventid;\n out.type = \"interval_start\";\n out.startTime = nowIso; // nur startTime\n\n node.status({ fill: 'green', shape: 'dot', text: 'Start: ' + nowIso });\n} else {\n // interval_end\n if (!eventid) {\n // Fallback: falls Kontext verloren ging\n eventid = generateUUid();\n context.set('eventid', eventid);\n }\n\n out.id = eventid;\n out.type = \"interval_end\";\n out.endTime = nowIso; // nur endTime\n\n node.status({ fill: 'grey', shape: 'dot', text: 'Ende: ' + nowIso });\n}\n\n// Zustand umschalten (nächster Aufruf erzeugt das Gegenstück)\ncontext.set('running', !running);\n\n// Nachricht setzen & zurückgeben\nmsg.payload = out;\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 370, "y": 1200, "wires": [ [ "1eafc1d951c7918b" ] ] }, { "id": "1fbac65dec566fcb", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 1200, "wires": [ [ "4115a3b91feff65d" ] ] }, { "id": "e6034cd2eb6da601", "type": "debug", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "debug 10", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1220, "y": 1180, "wires": [] }, { "id": "29cc2c97963d0f70", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 880, "wires": [ [ "c4a70205eda493bf" ] ] }, { "id": "c4a70205eda493bf", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Minimal", "func": "// Minimal\n\nmsg.payload = { value: 42 };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 380, "y": 880, "wires": [ [ "efef94677a5bcf7f" ] ] }, { "id": "1e011858930d8b78", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Mit Event-Type", "func": "msg.type = \"point\";\nmsg.payload = { severity: \"high\", message: \"Temperatur zu hoch\" };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 400, "y": 940, "wires": [ [ "efef94677a5bcf7f" ] ] }, { "id": "a6d6e003288a507a", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Mit benutzerdefinierten Zeiten", "func": "// Mit benutzerdefinierten Zeiten\nlet now = new Date();\n\nmsg.type = \"point\";\nmsg.startTime = now.toISOString();\nmsg.payload = { processId: \"batch-001\" };\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 450, "y": 1000, "wires": [ [ "efef94677a5bcf7f" ] ] }, { "id": "36b2e3e8cdcc1245", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Mit benutzerdefinierter ID", "func": "msg.id = \"custom-event-123\";\nmsg.type = \"point\";\nmsg.payload = { status: \"running\" };\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 430, "y": 1060, "wires": [ [ "efef94677a5bcf7f" ] ] }, { "id": "6d3841cce2cb4c15", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 940, "wires": [ [ "1e011858930d8b78" ] ] }, { "id": "5861508310d1814b", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 1000, "wires": [ [ "a6d6e003288a507a" ] ] }, { "id": "a50474c195ebe62b", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 1060, "wires": [ [ "36b2e3e8cdcc1245" ] ] }, { "id": "0af2b3ee932489df", "type": "debug", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 1220, "y": 820, "wires": [] }, { "id": "a25482ec7ec18df9", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 1260, "wires": [ [ "138891e866ea6118" ] ] }, { "id": "138891e866ea6118", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Automatische ID-Verwaltung interval_start", "func": "msg.type = \"interval_start\";\nmsg.payload = { af: \"af\" };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 460, "y": 1260, "wires": [ [ "1eafc1d951c7918b" ] ] }, { "id": "a3c0755621a125d2", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Automatische ID-Verwaltung interval_end", "func": "msg.type = \"interval_end\";\nmsg.payload = { af: \"af\" };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 460, "y": 1320, "wires": [ [ "1eafc1d951c7918b" ] ] }, { "id": "88ac53ae4861941e", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Benutzerdefinierte ID Start", "func": "// Benutzerdefinierte ID\nmsg.id = \"8e5624b2-4f43-484c-897e-e02f12769c90\";\nmsg.type = \"interval_start\";\nmsg.payload = { processId: \"batch-001\" };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 420, "y": 1380, "wires": [ [ "1eafc1d951c7918b" ] ] }, { "id": "fa99a084b0413b07", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 1320, "wires": [ [ "a3c0755621a125d2" ] ] }, { "id": "d2e807a46943f2f9", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 152.5157470703125, "y": 1381.0220336914062, "wires": [ [ "88ac53ae4861941e" ] ] }, { "id": "8f69b5a2a7568c0f", "type": "function", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "Benutzerdefinierte ID End", "func": "// Benutzerdefinierte ID\nmsg.type = \"interval_end\";\nmsg.payload = { result: \"success\" };\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 1440, "wires": [ [ "1eafc1d951c7918b" ] ] }, { "id": "f6ef07babfdb456a", "type": "inject", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 1440, "wires": [ [ "8f69b5a2a7568c0f" ] ] }, { "id": "eb50702608c8a477", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "server": "a90004657a205360", "debug": false, "message": "", "dataformat": "event", "datapointid": "334ec645-9f05-4df8-bc10-b0938e16e67c", "x": 1230, "y": 860, "wires": [ [] ] }, { "id": "e79bec4f62c1f36e", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "", "server": "a90004657a205360", "dataformat": "specific_subject", "datapointid": "a1ea4241-a274-445e-b707-f03b74904170.1", "topicfield": "subject", "x": 130, "y": 1800, "wires": [ [ "82b6665b4118ed91", "7f81798d719d80c4" ] ] }, { "id": "c069a579cde0ed93", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "", "server": "a90004657a205360", "debug": false, "enableBuffer": false, "bufferSize": "", "bufferMode": "drop-oldest", "message": "", "dataformat": "reply", "datapointid": "", "enableBatch": false, "batchSize": "", "batchInterval": "", "batchMode": "hybrid", "enableAutoReply": false, "replyTimeout": "", "enableRateLimit": false, "rateLimit": "", "rateLimitWindow": "", "rateLimitBurst": "", "x": 1250, "y": 1800, "wires": [ [] ] }, { "id": "f72f5a4e7a35fe17", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "Integer", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "bd30bd5f-8533-4076-ac13-35b72a682b17", "topicfield": "subject", "x": 750, "y": 100, "wires": [ [ "ac1077437d7f76fd", "da1ee4a11d940cef" ] ] }, { "id": "ac1077437d7f76fd", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 60, "wires": [] }, { "id": "c35009cac7b6b6f4", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "String", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "ab7179c4-40ee-447f-a6f7-99d5ef025b3b", "topicfield": "subject", "x": 750, "y": 280, "wires": [ [ "308260d44df7f01b", "f7149d54436cafaf" ] ] }, { "id": "4836e6464ba70952", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "Bool", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "8f5c6cce-e9ae-4e63-a1e9-f4abc45823e9", "x": 750, "y": 380, "wires": [ [ "85fe1d3d2ff91678", "351d7b5291e34d0b" ] ] }, { "id": "8244a583f814651b", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "Event", "server": "a90004657a205360", "dataformat": "uns_event", "datapointid": "8a713b2b-898d-4ea8-b2aa-306189a7be5b", "topicfield": "subject", "x": 750, "y": 680, "wires": [ [ "a737813adeebb8d1", "18f32d37d323161c" ] ] }, { "id": "da1ee4a11d940cef", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 100, "wires": [] }, { "id": "308260d44df7f01b", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 280, "wires": [] }, { "id": "f7149d54436cafaf", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 320, "wires": [] }, { "id": "85fe1d3d2ff91678", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 380, "wires": [] }, { "id": "351d7b5291e34d0b", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 420, "wires": [] }, { "id": "a737813adeebb8d1", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 660, "wires": [] }, { "id": "18f32d37d323161c", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 700, "wires": [] }, { "id": "51e40251d09d8dcb", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "Flaot", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "a140a33b-22a3-4d53-b6cb-f8761f81405f", "topicfield": "subject", "x": 750, "y": 180, "wires": [ [ "def83ec262599974", "a6ad7be0a0265a27" ] ] }, { "id": "def83ec262599974", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 160, "wires": [] }, { "id": "a6ad7be0a0265a27", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 200, "wires": [] }, { "id": "dd3d2e1b4bb8b056", "type": "inject", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{ \"action\": \"read_sensor\", \"target\": { \"device_id\": \"PLC-001\", \"sensor\": \"temperature\" }, \"parameters\": { \"unit\": \"Celsius\", \"timestamp\": \"2025-08-22T10:30:00Z\" } }", "payloadType": "json", "x": 150, "y": 1660, "wires": [ [ "db792b66d7748bb4", "53427b35315f29a3" ] ] }, { "id": "eeaada3a27d63a2b", "type": "debug", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "komplt. msg", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1190, "y": 1660, "wires": [] }, { "id": "7f81798d719d80c4", "type": "function", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "do something", "func": "msg.payload = {\n \"status\": \"success\",\n \"message\": \"Sensorwert erfolgreich abgerufen.\",\n \"result\": {\n \"device_id\": \"PLC-001\",\n \"sensor\": \"temperature\",\n \"value\": 72.5,\n \"unit\": \"Celsius\",\n \"timestamp\": \"2025-08-22T10:30:05Z\"\n }\n}\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 600, "y": 1800, "wires": [ [ "4071816247ec4339" ] ] }, { "id": "db792b66d7748bb4", "type": "debug", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "debug 3", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 580, "y": 1580, "wires": [] }, { "id": "1f2a3b20c32ff1bd", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "Integer", "server": "a90004657a205360", "debug": false, "enableBuffer": false, "bufferSize": "100", "bufferSizeType": "count", "bufferSizeBytes": "", "bufferMode": "drop-oldest", "bufferPersistence": "none", "bufferAutoSaveInterval": "", "message": "", "dataformat": "uns_value", "datapointid": "7a1bacd8-38a4-4f75-b544-5428ac62c6c3", "datatypeOverride": "auto", "enableBatch": false, "batchSize": "10", "batchInterval": "", "batchMode": "size", "enableAutoReply": false, "replyTimeout": "", "enableRateLimit": false, "rateLimit": "", "rateLimitWindow": "", "rateLimitBurst": "", "rateLimitAction": "drop", "x": 560, "y": 60, "wires": [ [] ] }, { "id": "d28972502fa90fdf", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "1", "payloadType": "num", "x": 190, "y": 60, "wires": [ [ "0c4bbf649dafa2eb" ] ] }, { "id": "5588887d1c1d9701", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 190, "y": 120, "wires": [ [ "0a5724e9bce8a802" ] ] }, { "id": "e5e8b8b52ef87365", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "testtring", "payloadType": "str", "x": 180, "y": 200, "wires": [ [ "d6e894188e9a0ff4" ] ] }, { "id": "118c2bef21d0ae32", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "1", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 170, "y": 280, "wires": [ [ "5db4eb6f911cc3a7" ] ] }, { "id": "0a5724e9bce8a802", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "Float", "server": "a90004657a205360", "debug": false, "message": "", "dataformat": "uns_value", "datapointid": "879c839e-8484-4f4e-9f0a-1ac3dd661926", "x": 550, "y": 120, "wires": [ [] ] }, { "id": "d6e894188e9a0ff4", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "String", "server": "a90004657a205360", "debug": false, "message": "", "dataformat": "uns_value", "datapointid": "328c589b-6502-4616-b6fd-edece115bb3a", "x": 550, "y": 200, "wires": [ [] ] }, { "id": "5db4eb6f911cc3a7", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "Bool", "server": "a90004657a205360", "debug": false, "message": "", "dataformat": "uns_value", "datapointid": "37ec7beb-f20a-47dd-b992-df259b88109a", "x": 550, "y": 280, "wires": [ [] ] }, { "id": "82b6665b4118ed91", "type": "debug", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "debug 4", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 580, "y": 1740, "wires": [] }, { "id": "4071816247ec4339", "type": "delay", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "", "pauseType": "delay", "timeout": "5", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 1000, "y": 1800, "wires": [ [ "c069a579cde0ed93" ] ] }, { "id": "c018c5b4b4ae6fb6", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "34562cb0d49a22a4", "name": "", "server": "a90004657a205360", "debug": false, "message": "", "dataformat": "event", "datapointid": "e7bf7358-910c-4e59-b140-4b9c3c5dcba6", "x": 1230, "y": 1220, "wires": [ [] ] }, { "id": "416b729a0472b39c", "type": "debug", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "msg.payload", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1190, "y": 1620, "wires": [] }, { "id": "2a0d34f0425af48b", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "json", "server": "a90004657a205360", "debug": false, "enableBuffer": true, "bufferSize": "", "bufferSizeType": "size", "bufferSizeBytes": "", "bufferMode": "drop-oldest", "bufferPersistence": "file", "bufferAutoSaveInterval": "", "message": "", "dataformat": "uns_value", "datapointid": "37ec7beb-f20a-47dd-b992-df259b881091", "datatypeOverride": "auto", "enableBatch": false, "batchSize": "", "batchInterval": "", "batchMode": "hybrid", "enableAutoReply": false, "replyTimeout": "", "enableRateLimit": false, "rateLimit": "", "rateLimitWindow": "", "rateLimitBurst": "", "x": 550, "y": 360, "wires": [ [] ] }, { "id": "c567733c17e61870", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{ \"device_id\": \"device-001\", \"event\": \"low_battery\", \"timestamp\": \"2025-10-26T09:33:01Z\", \"details\": { \"battery\": { \"level_pct\": 15, \"voltage_v\": 3.20 }, \"recommended_action\": \"replace_battery\" }, \"context\": { \"location\": \"warehouse-3r\", \"operator\": \"automated-monitoring\" } }", "payloadType": "json", "x": 150, "y": 360, "wires": [ [ "2a0d34f0425af48b" ] ] }, { "id": "aa768c8e5a07ce03", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "json", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "37ec7beb-f20a-47dd-b992-df259b881091", "topicfield": "subject", "x": 750, "y": 480, "wires": [ [ "80b6e40d1888552d", "2e448b9b3dbf8508" ] ] }, { "id": "80b6e40d1888552d", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 460, "wires": [] }, { "id": "2e448b9b3dbf8508", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 500, "wires": [] }, { "id": "284214b05c4014af", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "timestamp", "server": "a90004657a205360", "debug": false, "enableBuffer": false, "bufferSize": "", "bufferMode": "drop-oldest", "message": "", "dataformat": "uns_value", "datapointid": "37ec7beb-f20a-47dd-b992-df259b881092", "datatypeOverride": "auto", "enableBatch": false, "batchSize": "", "batchInterval": "", "batchMode": "hybrid", "enableAutoReply": false, "replyTimeout": "", "enableRateLimit": false, "rateLimit": "", "rateLimitWindow": "", "rateLimitBurst": "", "x": 550, "y": 440, "wires": [ [] ] }, { "id": "686c690098a643fe", "type": "inject", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "", "props": [ { "p": "payload" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 170, "y": 440, "wires": [ [ "284214b05c4014af" ] ] }, { "id": "732c396ad8df58c7", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "timestamp", "server": "a90004657a205360", "dataformat": "uns_value", "datapointid": "37ec7beb-f20a-47dd-b992-df259b881092", "topicfield": "subject", "x": 760, "y": 580, "wires": [ [ "2e28d522a7bc2456", "2eb8a3111bb988cf" ] ] }, { "id": "2e28d522a7bc2456", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "complete payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1230, "y": 560, "wires": [] }, { "id": "2eb8a3111bb988cf", "type": "debug", "z": "0b30cc47ed4855ca", "g": "ec9e26937c677349", "name": "msg.,payload", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 600, "wires": [] }, { "id": "53427b35315f29a3", "type": "uns-request", "z": "0b30cc47ed4855ca", "g": "a9babff0bceefa8b", "name": "", "server": "a90004657a205360", "dataformat": "specific_subject", "subject": "a1ea4241-a274-445e-b707-f03b74904170.1", "timeout": "6000", "handleTimeout": true, "debug": false, "x": 650, "y": 1660, "wires": [ [ "eeaada3a27d63a2b", "416b729a0472b39c" ] ] }, { "id": "0c4bbf649dafa2eb", "type": "function", "z": "0b30cc47ed4855ca", "g": "2260c6585d4dbb9e", "name": "Counter", "func": "// Zählerstand aus dem Flow-Kontext holen (oder mit 0 starten)\nlet count = flow.get(\"counter\") || 0;\n\n// Prüfen, ob ein Reset gewünscht ist\nif (msg.reset === true) {\n count = 0;\n} else {\n count = count + msg.payload;\n}\n\n// Zähler speichern\nflow.set(\"counter\", count);\n\n// Zähler im Node-Status anzeigen\nnode.status({ fill: \"green\", shape: \"dot\", text: \"Zähler: \" + count });\n\n// Aktuellen Stand im Payload zurückgeben\nmsg.payload = count;\n\nreturn msg;\n", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 380, "y": 60, "wires": [ [ "1f2a3b20c32ff1bd" ] ] }, { "id": "inject-request", "type": "inject", "z": "0b30cc47ed4855ca", "g": "976e10947bdcf325", "name": "Send Request", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"action\":\"getData\",\"id\":123}", "payloadType": "json", "x": 150, "y": 1920, "wires": [ [ "publish-with-autoreply" ] ] }, { "id": "publish-with-autoreply", "type": "uns-publish", "z": "0b30cc47ed4855ca", "g": "976e10947bdcf325", "name": "Request with Auto-Reply", "server": "a90004657a205360", "debug": false, "enableBuffer": false, "bufferSize": "", "bufferSizeBytes": "", "bufferMode": "drop-oldest", "bufferAutoSaveInterval": "", "dataformat": "specific_topic", "datapointid": "service.request", "enableBatch": false, "batchSize": "", "batchInterval": "", "batchMode": "size", "enableAutoReply": true, "replyTimeout": 5000, "enableRateLimit": false, "rateLimit": "", "rateLimitWindow": "", "rateLimitBurst": "", "x": 410, "y": 1920, "wires": [ [ "process-and-reply" ] ] }, { "id": "process-and-reply", "type": "function", "z": "0b30cc47ed4855ca", "g": "976e10947bdcf325", "name": "Process Request & Generate Reply", "func": "// Simulate processing the request\nconst request = msg.payload;\n\n// Do some processing\nconst result = {\n status: \"success\",\n data: {\n id: request.id,\n value: Math.random() * 100,\n timestamp: Date.now()\n }\n};\n\n// Set reply payload\nmsg.payload = result;\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 710, "y": 1920, "wires": [ [ "publish-with-autoreply", "debug-reply" ] ] }, { "id": "debug-reply", "type": "debug", "z": "0b30cc47ed4855ca", "g": "976e10947bdcf325", "name": "Debug Reply", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 990, "y": 1920, "wires": [] }, { "id": "subscribe-listen", "type": "uns-subscribe", "z": "0b30cc47ed4855ca", "g": "976e10947bdcf325", "name": "Listen for Requests", "server": "a90004657a205360", "dataformat": "specific_subject", "datapointid": "service.request", "topicfield": "subject", "x": 230, "y": 2060, "wires": [ [ "debug-request" ] ]