[
    {
        "id": "850b994fc3e4e7aa",
        "type": "group",
        "z": "c2f6e299563e7593",
        "name": "Maxxfan: Update Button+",
        "style": {
            "fill": "#ffbfbf",
            "label": true,
            "color": "#000000"
        },
        "nodes": [
            "100c6d7824921c3a",
            "170c9811d31a914f",
            "f784ece8cd14bcc1",
            "c18c5fa555a9e881",
            "ae5a59b4e2ff3574",
            "451e3426e5de53ae",
            "b3afc46ddbfafba1",
            "836f313ed47fcd04",
            "c9b9acf06a14dc20",
            "3a5984035c65a7c6",
            "9e4e878550102776",
            "5da7d0ed6f7962a1",
            "cf1a545ef6a993f6",
            "1fc515fb76eca996",
            "c77cef86590916e5",
            "cddb9d5ba076f3a4",
            "953f196e7fe4f3ec",
            "e06860014c8da23e"
        ],
        "x": 114,
        "y": 1039,
        "w": 1572,
        "h": 462
    },
    {
        "id": "100c6d7824921c3a",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1140,
        "wires": [
            [
                "c18c5fa555a9e881"
            ]
        ]
    },
    {
        "id": "170c9811d31a914f",
        "type": "context-monitor",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Observe MaxxFan Global Variables for mode",
        "monitoring": [
            {
                "scope": "global",
                "key": "maxxfan_auto"
            },
            {
                "scope": "global",
                "key": "maxxfan_power"
            },
            {
                "scope": "global",
                "key": "maxxfanAuto_temp"
            },
            {
                "scope": "global",
                "key": "maxxfan_direction"
            },
            {
                "scope": "global",
                "key": "maxxfan_speed"
            },
            {
                "scope": "global",
                "key": "maxxfan_vent"
            }
        ],
        "tostatus": false,
        "x": 310,
        "y": 1160,
        "wires": [
            [],
            [
                "f784ece8cd14bcc1",
                "1fc515fb76eca996"
            ]
        ]
    },
    {
        "id": "f784ece8cd14bcc1",
        "type": "switch",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "maxxfan_auto",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "maxxfan_power",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "maxxfanAuto_temp",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "maxxfan_direction",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "maxxfan_speed",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "maxxfan_vent",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 6,
        "x": 690,
        "y": 1180,
        "wires": [
            [
                "100c6d7824921c3a"
            ],
            [
                "100c6d7824921c3a"
            ],
            [
                "b3afc46ddbfafba1"
            ],
            [
                "836f313ed47fcd04"
            ],
            [
                "c9b9acf06a14dc20"
            ],
            [
                "3a5984035c65a7c6"
            ]
        ]
    },
    {
        "id": "c18c5fa555a9e881",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Determine Maxxfan Mode",
        "func": "let currentPower = global.get(\"maxxfan_power\") \nlet currentAuto = global.get(\"maxxfan_auto\") \n\nlet maxxfanMode\n\nvar msgs = [];\n\nif (currentAuto) {\n    maxxfanMode = \"Auto\"\n} else if (!currentPower) {\n    maxxfanMode = \"Aus\"\n} else if (currentPower) {\n    maxxfanMode = \"Manuell\"\n} else {\n    maxxfanMode = \"Unbekannt\"\n}\n\nglobal.set(\"maxxfan_mode\", maxxfanMode)\n\nmsgs.push({ topic: \"maxxfan/stat/mode\", payload: maxxfanMode });\n  \nreturn [msgs];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1170,
        "y": 1140,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "id": "ae5a59b4e2ff3574",
        "type": "mqtt out",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "",
        "topic": "",
        "qos": "0",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ddb07c65cbb68bc",
        "x": 1530,
        "y": 1260,
        "wires": []
    },
    {
        "id": "451e3426e5de53ae",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Auto_Temp setzen",
        "func": "let currentTemp = global.get(\"maxxfanAuto_temp\")\nlet currentMode = global.get(\"maxxfan_mode\")\n\nvar msgs = [];\n  \n\nif (currentMode == \"Auto\") {\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/label/set\", payload: \"Zieltemperatur\" });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/value/set\", payload: currentTemp });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/unit/set\", payload: \"°C\" });\n}\n\nreturn [msgs];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1150,
        "y": 1180,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "id": "b3afc46ddbfafba1",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1180,
        "wires": [
            [
                "451e3426e5de53ae"
            ]
        ]
    },
    {
        "id": "836f313ed47fcd04",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1220,
        "wires": [
            [
                "9e4e878550102776"
            ]
        ]
    },
    {
        "id": "c9b9acf06a14dc20",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1260,
        "wires": [
            [
                "5da7d0ed6f7962a1"
            ]
        ]
    },
    {
        "id": "3a5984035c65a7c6",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1300,
        "wires": [
            [
                "cf1a545ef6a993f6"
            ]
        ]
    },
    {
        "id": "9e4e878550102776",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Richtung setzen",
        "func": "let currentDirection = global.get(\"maxxfan_direction\")\nlet currentMode = global.get(\"maxxfan_mode\")\n\nconst svgAirOut = '<svg viewBox=\"0 0 24 24\"><path d=\"M4 4h2v16H4zM9 11h8v2H9zM16 8l5 4-5 4z\" fill=\"white\"/></svg>';\nconst svgAirIn = '<svg viewBox=\"0 0 24 24\"><path d=\"M18 4h2v16h-2zM3 11h8v2H3zM10 8l5 4-5 4z\" fill=\"white\"/></svg>';\n\nvar msgs = [];\n  \n\nif (currentMode == \"Manuell\" || currentMode == \"Auto\") {\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/toplabel/set\", payload: \"Luftrichtung\" });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/label/set\", payload: \"\" });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/svg/set\", payload: currentDirection === \"out\" ? svgAirOut : svgAirIn });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/led/front/on/set\", payload: \"false\" });\n}\n\n\nreturn [msgs];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1140,
        "y": 1220,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "id": "5da7d0ed6f7962a1",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Lüfterstufe setzen",
        "func": "let currentSpeed = global.get(\"maxxfan_speed\") \nlet currentMode = global.get(\"maxxfan_mode\")\n\nvar msgs = [];\n  \n\nif (currentMode == \"Manuell\") {\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/label/set\", payload: \"Lüfterstufe\" });\n    msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/value/set\", payload: currentSpeed });\n}\n\n\nreturn [msgs];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1150,
        "y": 1260,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "id": "cf1a545ef6a993f6",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Dachluke setzen",
        "func": "let currentVent = global.get(\"maxxfan_vent\")\nlet currentMode = global.get(\"maxxfan_mode\")\n\nconst svgFanClosed = '<svg viewBox=\"0 0 24 24\"><path d=\"M3 17h18v3H3zM6 14h12v3H6z\" fill=\"white\"/></svg>'\nconst svgFanOpen = '<svg viewBox=\"0 0 24 24\"><path d=\"M3 17h18v3H3zM5 16l12-8 1 2-12 8z\" fill=\"white\"/></svg>'\n\nvar msgs = [];\n  \n\nswitch (currentMode) {\n    case \"Aus\":\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"Dachluke\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: currentVent === \"open\" ? svgFanOpen : svgFanClosed });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: currentVent === \"open\" ? \"true\" : \"false\" });\n        return [msgs];\n    case \"Manuell\":\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"Dachluke\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: currentVent === \"open\" ? svgFanOpen : svgFanClosed });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: currentVent === \"open\" ? \"false\" : \"true\" });\n        return [msgs];\n    case \"Auto\":\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: \"false\" });\n        return [msgs];\n    default:\n    // code block\n}\n\nreturn [msgs];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1140,
        "y": 1300,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "id": "1fc515fb76eca996",
        "type": "trigger",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Debounce 500ms",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "str",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 910,
        "y": 1340,
        "wires": [
            [
                "c77cef86590916e5"
            ]
        ]
    },
    {
        "id": "c77cef86590916e5",
        "type": "mqtt out",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "",
        "topic": "pkw/stat/maxxfan",
        "qos": "0",
        "retain": "false",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ddb07c65cbb68bc",
        "x": 1570,
        "y": 1340,
        "wires": []
    },
    {
        "id": "cddb9d5ba076f3a4",
        "type": "inject",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "240",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1090,
        "y": 1460,
        "wires": [
            [
                "c77cef86590916e5"
            ]
        ]
    },
    {
        "id": "953f196e7fe4f3ec",
        "type": "mqtt in",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "",
        "topic": "maxxfan/stat/mode",
        "qos": "0",
        "datatype": "auto-detect",
        "broker": "0ddb07c65cbb68bc",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 230,
        "y": 1080,
        "wires": [
            [
                "e06860014c8da23e"
            ]
        ]
    },
    {
        "id": "e06860014c8da23e",
        "type": "function",
        "z": "c2f6e299563e7593",
        "g": "850b994fc3e4e7aa",
        "name": "Set Button+ by mode change",
        "func": "let currentSpeed = global.get(\"maxxfan_speed\")\nlet currentTemp = global.get(\"maxxfanAuto_temp\")\nlet currentPower = global.get(\"maxxfan_power\")\nlet currentAuto = global.get(\"maxxfan_auto\")\nlet currentVent = global.get(\"maxxfan_vent\")\nlet currentDirection = global.get(\"maxxfan_direction\")\n\nconst svgPrevPage = '<svg viewBox=\"0 0 24 24\" fill=\"none\"><g stroke-width=\"0\"></g><g stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke=\"#CCCCCC\" stroke-width=\"0.24000000000000005\"></g><g> <g> <path d=\"M14 7L9 12\" stroke=\"#ffffff\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path> <path d=\"M9 12L14 17\" stroke=\"#ffffff\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path> </g> <defs> </defs> </g></svg>';\nconst svgNextPage = '<svg viewBox=\"0 0 24 24\" fill=\"none\"><g stroke-width=\"0\"></g><g stroke-linecap=\"round\" stroke-linejoin=\"round\"></g><g> <g> <path d=\"M10 17L15 12\" stroke=\"#ffffff\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path> <path d=\"M15 12L10 7\" stroke=\"#ffffff\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path> </g> <defs> </defs> </g></svg>';\nconst svgTempDown = '<svg viewBox = \"0 0 24 24\" > <path d=\"M17.41 12.17L14.24 9L12.83 10.41L17.41 15L22 10.41L20.58 9M10 13V5C10 3.34 8.66 2 7 2S4 3.34 4 5V13C1.79 14.66 1.34 17.79 3 20S7.79 22.66 10 21 12.66 16.21 11 14C10.72 13.62 10.38 13.28 10 13M7 4C7.55 4 8 4.45 8 5V8H6V5C6 4.45 6.45 4 7 4Z\" fill=\"white\"></path></svg>';\nconst svgTempUp = '<svg viewBox=\"0 0 24 24\"><path d=\"M17.41 11.83L20.58 15L22 13.59L17.41 9L12.82 13.59L14.24 15L17.41 11.83M10 13V5C10 3.34 8.66 2 7 2S4 3.34 4 5V13C1.79 14.66 1.34 17.79 3 20S7.79 22.66 10 21 12.66 16.21 11 14C10.72 13.62 10.38 13.28 10 13M7 4C7.55 4 8 4.45 8 5V8H6V5C6 4.45 6.45 4 7 4Z\" fill=\"white\"></path></svg>';\nconst svgSpeedDown = '<svg viewBox=\"0 0 24 24\"><path d=\"M6.8,11.42A0.58,0.58 0 0,0 6.22,12A0.58,0.58 0 0,0 6.8,12.58A0.58,0.58 0 0,0 7.38,12A0.58,0.58 0 0,0 6.8,11.42M7.09,6.2C9.7,6.2 9.764,8.271 8.395,8.955C7.821,9.239 7.566,9.848 7.455,10.388C7.734,10.504 7.977,10.683 8.163,10.915C10.309,9.755 12.617,10.214 12.617,12.29C12.617,14.9 10.547,14.958 9.862,13.583C9.572,13.009 8.958,12.754 8.418,12.644C8.302,12.922 8.122,13.16 7.89,13.357C9.045,15.497 8.586,17.8 6.51,17.8C3.9,17.8 3.848,15.724 5.217,15.039C5.785,14.755 6.04,14.152 6.156,13.618C5.872,13.502 5.623,13.317 5.437,13.085C3.297,14.233 1,13.781 1,11.71C1,9.1 3.065,9.036 3.749,10.411C4.039,10.985 4.648,11.234 5.188,11.345C5.298,11.066 5.483,10.823 5.721,10.637C4.567,8.497 5.025,6.2 7.09,6.2M17.41 12.17L14.24 9L12.83 10.41L17.41 15L22 10.41L20.58 9\" fill=\"white\"></path></svg>';\nconst svgSpeedUp = '<svg viewBox=\"0 0 24 24\"><path d=\"M6.8,11.42A0.58,0.58 0 0,0 6.22,12A0.58,0.58 0 0,0 6.8,12.58A0.58,0.58 0 0,0 7.38,12A0.58,0.58 0 0,0 6.8,11.42M7.09,6.2C9.7,6.2 9.764,8.271 8.395,8.955C7.821,9.239 7.566,9.848 7.455,10.388C7.734,10.504 7.977,10.683 8.163,10.915C10.309,9.755 12.617,10.214 12.617,12.29C12.617,14.9 10.547,14.958 9.862,13.583C9.572,13.009 8.958,12.754 8.418,12.644C8.302,12.922 8.122,13.16 7.89,13.357C9.045,15.497 8.586,17.8 6.51,17.8C3.9,17.8 3.848,15.724 5.217,15.039C5.785,14.755 6.04,14.152 6.156,13.618C5.872,13.502 5.623,13.317 5.437,13.085C3.297,14.233 1,13.781 1,11.71C1,9.1 3.065,9.036 3.749,10.411C4.039,10.985 4.648,11.234 5.188,11.345C5.298,11.066 5.483,10.823 5.721,10.637C4.567,8.497 5.025,6.2 7.09,6.2M17.41 11.83L20.58 15L22 13.59L17.41 9L12.82 13.59L14.24 15L17.41 11.83\" fill=\"white\"></path></svg>';\n\n\nconst svgPower = '<svg viewBox=\"0 0 24 24\"><path d=\"M11 3h2v10h-2z\" fill=\"white\"></path><path d=\"M16.95 6.05a7 7 0 1 1-9.9 0\" fill=\"none\" stroke=\"white\" stroke-width=\"2\" stroke-linecap=\"round\"></path></svg>';\nconst svgAirOut = '<svg viewBox=\"0 0 24 24\"><path d=\"M4 4h2v16H4zM9 11h8v2H9zM16 8l5 4-5 4z\" fill=\"white\"/></svg>';\nconst svgAirIn = '<svg viewBox=\"0 0 24 24\"><path d=\"M18 4h2v16h-2zM3 11h8v2H3zM10 8l5 4-5 4z\" fill=\"white\"/></svg>';\n\nconst svgFanClosed = '<svg viewBox=\"0 0 24 24\"><path d=\"M3 17h18v3H3zM6 14h12v3H6z\" fill=\"white\"/></svg>'\nconst svgFanOpen = '<svg viewBox=\"0 0 24 24\"><path d=\"M3 17h18v3H3zM5 16l12-8 1 2-12 8z\" fill=\"white\"/></svg>'\n\n\n\nvar currentMode = msg.payload;\n\nvar prefix = \"buttonplus/kasten-on-tour/\";\nvar msgs = [];\n\n\n\n\nswitch (currentMode) {\n    case \"Aus\":\n        // code block\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/1/value/set\", payload: \"Maxxfan\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/2/value/set\", payload: currentMode });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/value/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/unit/set\", payload: \"\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/4/svg/set\", payload: svgPrevPage });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/5/svg/set\", payload: svgNextPage });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/svg/set\", payload: svgPower });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/led/front/on/set\", payload: \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/label/set\", payload: \"Auto\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/led/front/on/set\", payload: \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/svg/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/svg/set\", payload: \"\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"Dachluke\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: currentVent === \"open\" ? svgFanOpen : svgFanClosed });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: currentVent === \"open\" ? \"true\" : \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/svg/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/led/front/on/set\", payload: \"false\" });\n\n        return [msgs];\n    case \"Manuell\":\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/1/value/set\", payload: \"Maxxfan\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/2/value/set\", payload: currentMode });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/label/set\", payload: \"Lüfterstufe\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/value/set\", payload: currentSpeed });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/unit/set\", payload: \"\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/4/svg/set\", payload: svgPrevPage });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/5/svg/set\", payload: svgNextPage });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/svg/set\", payload: svgPower });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/led/front/on/set\", payload: \"true\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/label/set\", payload: \"Auto\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/led/front/on/set\", payload: \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/svg/set\", payload: svgSpeedDown });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/svg/set\", payload: svgSpeedUp });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"Dachluke\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: currentVent === \"open\" ? svgFanOpen : svgFanClosed });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: currentVent === \"open\" ? \"false\" : \"true\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/toplabel/set\", payload: \"Luftrichtung\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/svg/set\", payload: currentDirection === \"out\" ? svgAirOut : svgAirIn });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/led/front/on/set\", payload: \"false\" });\n\n        return [msgs];\n\n    case \"Auto\":\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/1/value/set\", payload: \"Maxxfan\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/2/value/set\", payload: currentMode });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/label/set\", payload: \"Zieltemperatur\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/value/set\", payload: currentTemp });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/3/unit/set\", payload: \"°C\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/4/svg/set\", payload: svgPrevPage });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/displayitem/5/svg/set\", payload: svgNextPage });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/svg/set\", payload: svgPower });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/3-1/led/front/on/set\", payload: \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/label/set\", payload: \"Auto\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/4-1/led/front/on/set\", payload: \"true\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/5-1/svg/set\", payload: svgTempDown });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/6-1/svg/set\", payload: svgTempUp });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/toplabel/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/svg/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/7-1/led/front/on/set\", payload: \"false\" });\n\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/toplabel/set\", payload: \"Luftrichtung\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/label/set\", payload: \"\" });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/svg/set\", payload: currentDirection === \"out\" ? svgAirOut : svgAirIn });\n        msgs.push({ topic: \"buttonplus/kasten-on-tour/button/8-1/led/front/on/set\", payload: \"false\" });\n\n        return [msgs];\n\n    default:\n    // code block\n}\n\n\n\n\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1170,
        "y": 1080,
        "wires": [
            [
                "ae5a59b4e2ff3574"
            ]
        ]
    },
    {
        "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": ""
    }
]