[
    {
        "id": "9164612aca85eee6",
        "type": "tab",
        "label": "02-mock2-complex-json",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "6860e3ae8f9de925",
        "type": "function",
        "z": "9164612aca85eee6",
        "name": "generate JSON",
        "func": "msg.topic = \"test/applicationID/deviceID/up\";\nmsg.payload = {\n   \"end_device_ids\":{\n      \"device_id\":\"mydevice\",\n      \"application_ids\":{\n         \"application_id\":\"myaplication\"\n      },\n      \"dev_eui\":\"123412341234\",\n      \"join_eui\":\"0000000000000000\",\n      \"dev_addr\":\"12341234\"\n   },\n   \"correlation_ids\":[\n      \"gs:uplink:01KHRYBJDSY1YE8MVPMHWQKV1V\"\n   ],\n   \"received_at\":\"2026-02-18T17:56:50.952172082Z\",\n   \"uplink_message\":{\n      \"session_key_id\":\"12341234123412341234\",\n      \"f_port\":2,\n      \"f_cnt\":2,\n      \"frm_payload\":\"ABUAIw==\",\n      \"rx_metadata\":[\n         {\n            \"gateway_ids\":{\n               \"gateway_id\":\"eui-24e124fffef47770\",\n               \"eui\":\"24E124FFFEF47770\"\n            },\n            \"time\":\"2026-02-18T17:56:50.533432960Z\",\n            \"timestamp\":2662879158,\n            \"rssi\":-127,\n            \"channel_rssi\":-127,\n            \"snr\":-8.75,\n            \"uplink_token\":\"CiIKIAoUZXVpLTI0ZTEyNGZmZmVmNDc3NzASCCThJP/+9HdwELaf4fUJGgwI4vrXzAYQjLOm4wIg8L3d/7/tHw==\",\n            \"received_at\":\"2026-02-18T17:56:50.730719798Z\"\n         },\n         {\n            \"gateway_ids\":{\n               \"gateway_id\":\"packetbroker\"\n            },\n            \"packet_broker\":{\n               \"message_id\":\"01KHRYBJEHVG257X449S4RMPE2\",\n               \"forwarder_net_id\":\"000013\",\n               \"forwarder_tenant_id\":\"deutschebahn\",\n               \"forwarder_cluster_id\":\"db-v3-prod\",\n               \"forwarder_gateway_id\":\"Ww+O4JMrwTBlL0lGD+/9//BcGc5J1E/JD5gRFabQiV8=\",\n               \"home_network_net_id\":\"000013\",\n               \"home_network_tenant_id\":\"ttn\",\n               \"home_network_cluster_id\":\"eu1.cloud.thethings.network\"\n            },\n            \"time\":\"2026-02-18T17:56:50.724243Z\",\n            \"rssi\":-116,\n            \"channel_rssi\":-116,\n            \"snr\":-5,\n            \"location\":{\n               \"latitude\":53.5472458,\n               \"longitude\":10.0217911\n            },\n            \"uplink_token\":\"CoUBCnUr+zCM6v9++T6vE6JzmSB7tx8l69SlzIcoCNR83xEYRxwI3NWRQ6ZKDBxRhk7PeWvILmzs6WMmMTmlrT+idTk34sz/pvPRXeJ5VFsvdzHBKRp/RgA4UGniYGfbPVWeBrqVb17Ww0HvMVCKvmTJn4YVS3oNEnwSDBcVXFzIhy/D3sGqoBofCgMAABMSDGRldXRzY2hlYmFobhoKZGItdjMtcHJvZA==\",\n            \"received_at\":\"2026-02-18T17:56:50.756201026Z\"\n         }\n      ],\n      \"settings\":{\n         \"data_rate\":{\n            \"lora\":{\n               \"bandwidth\":125000,\n               \"spreading_factor\":10,\n               \"coding_rate\":\"4/5\"\n            }\n         },\n         \"frequency\":\"867900000\",\n         \"timestamp\":2662879158,\n         \"time\":\"2026-02-18T17:56:50.533432960Z\"\n      },\n      \"received_at\":\"2026-02-18T17:56:50.745973500Z\",\n      \"confirmed\":true,\n      \"consumed_airtime\":\"0.370688s\",\n      \"network_ids\":{\n         \"net_id\":\"000013\",\n         \"ns_id\":\"EC656E0000000181\",\n         \"tenant_id\":\"ttn\",\n         \"cluster_id\":\"eu1\",\n         \"cluster_address\":\"eu1.cloud.thethings.network\"\n      }\n   }\n}\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 480,
        "y": 200,
        "wires": [
            [
                "8b08732e1b5cd20f"
            ]
        ]
    },
    {
        "id": "f56c8eefbe149711",
        "type": "inject",
        "z": "9164612aca85eee6",
        "name": "timer",
        "props": [],
        "repeat": "3",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 290,
        "y": 200,
        "wires": [
            [
                "6860e3ae8f9de925"
            ]
        ]
    },
    {
        "id": "8b08732e1b5cd20f",
        "type": "function",
        "z": "9164612aca85eee6",
        "name": "change frm_payload",
        "func": "// Zustand holen/initialisieren (uint16, Faktor 10)\nlet t = context.get(\"t\"); // temp * 10\nlet h = context.get(\"h\"); // hum * 10\nif (t === undefined) t = 220; // 22.0\nif (h === undefined) h = 350; // 35.0\n\n// leicht variieren\nt += Math.round((Math.random() - 0.5) * 35);\nh += Math.round((Math.random() - 0.5) * 41);\n\n// clamp\nt = Math.max(150, Math.min(350, t));\nh = Math.max(200, Math.min(900, h));\n\n// speichern\ncontext.set(\"t\", t);\ncontext.set(\"h\", h);\n\n// 4 Bytes: temp(2) + hum(2), Big Endian\nconst buf = Buffer.alloc(4);\nbuf.writeUInt16BE(t, 0);\nbuf.writeUInt16BE(h, 2);\n\n// base64\nmsg.payload.uplink_message.frm_payload = buf.toString(\"base64\");\n\n// Metadaten aktualisieren\nconst now = new Date().toISOString();\nmsg.payload.received_at = now;\nmsg.payload.uplink_message.received_at = now;\nmsg.payload.uplink_message.f_cnt = (msg.payload.uplink_message.f_cnt || 0) + 1;\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 720,
        "y": 200,
        "wires": [
            [
                "e3ea0e3aa582b26f"
            ]
        ]
    },
    {
        "id": "e3ea0e3aa582b26f",
        "type": "change",
        "z": "9164612aca85eee6",
        "name": "extract payload base64",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.uplink_message.frm_payload",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 500,
        "wires": [
            [
                "26246cb68e5cd966"
            ]
        ]
    },
    {
        "id": "26246cb68e5cd966",
        "type": "function",
        "z": "9164612aca85eee6",
        "name": "decode base64 2x 2bytes",
        "func": "const b64 = msg.payload;\nconst buf = Buffer.from(b64, \"base64\");\n\nif (buf.length < 4) {\n  node.warn(`Zu wenig Daten: ${buf.length} Byte (erwartet 4)`);\n  return [null, null];\n}\n\nconst temp = buf.readUInt16BE(0) / 10;\nconst hum  = buf.readUInt16BE(2) / 10;\n\n//Node hat 2 Ausgänge. Jeder Ausgang\n//bekommt ein topic und payload\nreturn [\n  { topic: \"Temp\", payload: temp }, \n  { topic: \"Hum\",  payload: hum } \n];",
        "outputs": 2,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 710,
        "y": 500,
        "wires": [
            [
                "56ce19cbbca05d5e",
                "c6c44abf3e17e0ac"
            ],
            [
                "56ce19cbbca05d5e",
                "c0481d23166b5a25"
            ]
        ]
    },
    {
        "id": "56ce19cbbca05d5e",
        "type": "ui-chart",
        "z": "9164612aca85eee6",
        "group": "081ff2ce7f6f7b57",
        "name": "dht11",
        "label": "chart",
        "order": 2,
        "chartType": "line",
        "category": "topic",
        "categoryType": "msg",
        "xAxisLabel": "",
        "xAxisProperty": "",
        "xAxisPropertyType": "timestamp",
        "xAxisType": "time",
        "xAxisFormat": "",
        "xAxisFormatType": "auto",
        "xmin": "",
        "xmax": "",
        "yAxisLabel": "",
        "yAxisProperty": "payload",
        "yAxisPropertyType": "msg",
        "ymin": "0",
        "ymax": "90",
        "bins": 10,
        "action": "append",
        "stackSeries": false,
        "pointShape": "circle",
        "pointRadius": 4,
        "showLegend": true,
        "removeOlder": 1,
        "removeOlderUnit": "3600",
        "removeOlderPoints": "",
        "colors": [
            "#0095ff",
            "#ff0000",
            "#ff7f0e",
            "#2ca02c",
            "#a347e1",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "textColor": [
            "#666666"
        ],
        "textColorDefault": true,
        "gridColor": [
            "#e5e5e5"
        ],
        "gridColorDefault": true,
        "width": 6,
        "height": 8,
        "className": "",
        "interpolation": "linear",
        "x": 990,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "c0481d23166b5a25",
        "type": "ui-gauge",
        "z": "9164612aca85eee6",
        "name": "Luftfeuchtigkeit",
        "group": "081ff2ce7f6f7b57",
        "order": 4,
        "value": "payload",
        "valueType": "msg",
        "width": 3,
        "height": 3,
        "gtype": "gauge-half",
        "gstyle": "needle",
        "title": "Luftfeuchtigkeit",
        "alwaysShowTitle": false,
        "floatingTitlePosition": "top-left",
        "units": "%",
        "icon": "",
        "prefix": "",
        "suffix": "",
        "segments": [
            {
                "from": "0",
                "color": "#5cd65c",
                "text": "",
                "textType": "label"
            },
            {
                "from": "40",
                "color": "#ffc800",
                "text": "",
                "textType": "label"
            },
            {
                "from": "70",
                "color": "#ea5353",
                "text": "",
                "textType": "label"
            }
        ],
        "min": "20",
        "max": "70",
        "sizeThickness": 16,
        "sizeGap": 4,
        "sizeKeyThickness": 8,
        "styleRounded": true,
        "styleGlow": false,
        "className": "",
        "x": 990,
        "y": 360,
        "wires": [
            []
        ]
    },
    {
        "id": "c6c44abf3e17e0ac",
        "type": "ui-gauge",
        "z": "9164612aca85eee6",
        "name": "temp",
        "group": "081ff2ce7f6f7b57",
        "order": 3,
        "value": "payload",
        "valueType": "msg",
        "width": 3,
        "height": 3,
        "gtype": "gauge-half",
        "gstyle": "needle",
        "title": "Temperatur",
        "alwaysShowTitle": false,
        "floatingTitlePosition": "top-left",
        "units": "°C",
        "icon": "",
        "prefix": "",
        "suffix": "",
        "segments": [
            {
                "from": "0",
                "color": "#5c85d6",
                "text": "",
                "textType": "label"
            },
            {
                "from": "11",
                "color": "#2bff00",
                "text": "",
                "textType": "label"
            },
            {
                "from": "22",
                "color": "#ea8753",
                "text": "sweet",
                "textType": "str"
            },
            {
                "from": "30",
                "color": "#ea5353",
                "text": "Danger",
                "textType": "str"
            }
        ],
        "min": 0,
        "max": "40",
        "sizeThickness": 16,
        "sizeGap": 4,
        "sizeKeyThickness": 8,
        "styleRounded": true,
        "styleGlow": false,
        "className": "",
        "x": 950,
        "y": 300,
        "wires": [
            []
        ]
    },
    {
        "id": "081ff2ce7f6f7b57",
        "type": "ui-group",
        "name": "Gruppe 1",
        "page": "e64dc42442135b89",
        "width": 6,
        "height": 1,
        "order": 1,
        "showTitle": true,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "e64dc42442135b89",
        "type": "ui-page",
        "name": "Seite 1",
        "ui": "bee89a5af4fb0c2a",
        "path": "/page1",
        "icon": "home",
        "layout": "grid",
        "theme": "36375dc30ec0377d",
        "breakpoints": [
            {
                "name": "Default",
                "px": 0,
                "cols": 3
            },
            {
                "name": "Tablet",
                "px": 576,
                "cols": 6
            },
            {
                "name": "Small Desktop",
                "px": 768,
                "cols": 9
            },
            {
                "name": "Desktop",
                "px": 1024,
                "cols": 12
            }
        ],
        "order": 1,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "bee89a5af4fb0c2a",
        "type": "ui-base",
        "name": "Mein Dashboard",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control"
        ],
        "showPathInSidebar": false,
        "headerContent": "page",
        "navigationStyle": "default",
        "titleBarStyle": "default",
        "showReconnectNotification": true,
        "notificationDisplayTime": 1,
        "showDisconnectNotification": true,
        "allowInstall": false
    },
    {
        "id": "36375dc30ec0377d",
        "type": "ui-theme",
        "name": "Standardthema",
        "colors": {
            "surface": "#ffffff",
            "primary": "#0094CE",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "density": "default",
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px"
        }
    },
    {
        "id": "3092268623f16844",
        "type": "global-config",
        "env": [],
        "modules": {
            "@flowfuse/node-red-dashboard": "1.30.2"
        }
    }
]