[
    {
        "id": "c743a0a130bcd72b",
        "type": "tab",
        "label": "userflow_dimmy",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "cc534a3c5520ac90",
        "type": "mqtt in",
        "z": "c743a0a130bcd72b",
        "name": "",
        "topic": "pkw/STATUS10",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "0ddb07c65cbb68bc",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 320,
        "y": 200,
        "wires": [
            [
                "cb4a2fb83753b8a4",
                "2b4bcfec6b76dc24"
            ]
        ]
    },
    {
        "id": "22e556334b002d43",
        "type": "mqtt out",
        "z": "c743a0a130bcd72b",
        "name": "mqtt_output",
        "topic": "",
        "qos": "0",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ddb07c65cbb68bc",
        "x": 970,
        "y": 340,
        "wires": []
    },
    {
        "id": "d43327e0484fd216",
        "type": "mqtt in",
        "z": "c743a0a130bcd72b",
        "name": "",
        "topic": "pkw/STATE",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "0ddb07c65cbb68bc",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 310,
        "y": 260,
        "wires": [
            [
                "cb4a2fb83753b8a4",
                "2b4bcfec6b76dc24"
            ]
        ]
    },
    {
        "id": "b79e4472262f102f",
        "type": "mqtt in",
        "z": "c743a0a130bcd72b",
        "name": "",
        "topic": "pkw/SENSOR",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "0ddb07c65cbb68bc",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 310,
        "y": 320,
        "wires": [
            [
                "cb4a2fb83753b8a4",
                "2b4bcfec6b76dc24"
            ]
        ]
    },
    {
        "id": "cb4a2fb83753b8a4",
        "type": "function",
        "z": "c743a0a130bcd72b",
        "name": "Tasmota-Dimmy-Umschreiben",
        "func": "const dev  = \"PekawayMOTA\";\n\nif (msg.topic === \"pkw/STATUS10\") {\n  msg.topic = `pkw/stat/${dev}/STATUS10`;\n} else if (msg.topic === \"pkw/STATE\") {\n  msg.topic = `pkw/tele/${dev}/STATE`;\n} else if (msg.topic === \"pkw/SENSOR\") {\n  msg.topic = `pkw/tele/${dev}/SENSOR`;\n} else {\n  return null;\n}\n\n// payload als String weiterreichen (wie Tasmota)\nif (typeof msg.payload !== \"string\") msg.payload = JSON.stringify(msg.payload);\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 670,
        "y": 260,
        "wires": [
            [
                "edb890feb7e6266a",
                "6f94905e5bdbd507"
            ]
        ]
    },
    {
        "id": "2b4bcfec6b76dc24",
        "type": "debug",
        "z": "c743a0a130bcd72b",
        "name": "debug 7",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 140,
        "wires": []
    },
    {
        "id": "edb890feb7e6266a",
        "type": "debug",
        "z": "c743a0a130bcd72b",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 940,
        "y": 140,
        "wires": []
    },
    {
        "id": "6f94905e5bdbd507",
        "type": "function",
        "z": "c743a0a130bcd72b",
        "name": "wrap payload",
        "func": "// Ziel: Payload so schicken, dass mqtt-in \"Auto\" im Herstellerflow\n// am Ende einen STRING liefert, den der JSON-Node dann wieder zum OBJEKT parsen kann.\n\nlet p = msg.payload;\n\n// falls schon Objekt -> erst zu JSON-Text machen\nif (typeof p === \"object\") {\n    p = JSON.stringify(p);\n}\n\n// jetzt nochmal stringify -> ergibt eine JSON-String-Value mit Escapes\nmsg.payload = JSON.stringify(p);\n\nreturn msg;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 890,
        "y": 260,
        "wires": [
            [
                "22e556334b002d43",
                "a76d1e06dd225254"
            ]
        ]
    },
    {
        "id": "a76d1e06dd225254",
        "type": "debug",
        "z": "c743a0a130bcd72b",
        "name": "debug 9",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 980,
        "y": 200,
        "wires": []
    },
    {
        "id": "0ddb07c65cbb68bc",
        "type": "mqtt-broker",
        "name": "",
        "broker": "http://localhost",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    }
]