[
    {
        "id": "5cd2cab4.efd0d4",
        "type": "tab",
        "label": "dashboard",
        "disabled": false,
        "info": ""
    },
    {
        "id": "f4903aa3.0c5198",
        "type": "ui_button",
        "z": "5cd2cab4.efd0d4",
        "name": "button_aktualisieren",
        "group": "bcdb7e6d.374db",
        "order": 5,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Aktualisieren",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "",
        "payloadType": "date",
        "topic": "topic",
        "topicType": "msg",
        "x": 180,
        "y": 180,
        "wires": [
            [
                "2b7664c6.087dfc"
            ]
        ]
    },
    {
        "id": "2b7664c6.087dfc",
        "type": "function",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL alles abrufen",
        "func": "msg.topic = \"SELECT * FROM data\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 450,
        "y": 180,
        "wires": [
            [
                "6a3c8183.4eab1"
            ]
        ]
    },
    {
        "id": "6a3c8183.4eab1",
        "type": "mysql",
        "z": "5cd2cab4.efd0d4",
        "mydb": "92414223.53143",
        "name": "",
        "x": 1320,
        "y": 180,
        "wires": [
            [
                "d003881a.d7b778"
            ]
        ]
    },
    {
        "id": "d003881a.d7b778",
        "type": "ui_table",
        "z": "5cd2cab4.efd0d4",
        "group": "bcdb7e6d.374db",
        "name": "daten_tabelle",
        "order": 1,
        "width": 17,
        "height": 10,
        "columns": [],
        "outputs": 0,
        "cts": false,
        "x": 1540,
        "y": 120,
        "wires": []
    },
    {
        "id": "a78bcd39.e2e8f",
        "type": "ui_button",
        "z": "5cd2cab4.efd0d4",
        "name": "button_leeren",
        "group": "bcdb7e6d.374db",
        "order": 7,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "Leeren",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "[]",
        "payloadType": "json",
        "topic": "topic",
        "topicType": "msg",
        "x": 160,
        "y": 120,
        "wires": [
            [
                "d003881a.d7b778"
            ]
        ]
    },
    {
        "id": "b46b350e.023bb8",
        "type": "debug",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 290,
        "y": 1140,
        "wires": []
    },
    {
        "id": "576597a5.932e68",
        "type": "ui_text_input",
        "z": "5cd2cab4.efd0d4",
        "name": "text_sucheingabe",
        "label": "Eingabe",
        "tooltip": "",
        "group": "64dba6a2.57e538",
        "order": 3,
        "width": 6,
        "height": 1,
        "passthru": true,
        "mode": "text",
        "delay": "100",
        "topic": "",
        "topicType": "str",
        "x": 170,
        "y": 420,
        "wires": [
            [
                "76f0dbb8.a93344"
            ]
        ]
    },
    {
        "id": "76f0dbb8.a93344",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "textInput",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 420,
        "wires": [
            [
                "bd27186c.e7f348"
            ]
        ]
    },
    {
        "id": "bd27186c.e7f348",
        "type": "switch",
        "z": "5cd2cab4.efd0d4",
        "name": "textfeld_leer?",
        "property": "textInput",
        "propertyType": "flow",
        "rules": [
            {
                "t": "empty"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 550,
        "y": 420,
        "wires": [
            [
                "2fe48549.983eca"
            ],
            [
                "fcd42f2e.05e51"
            ]
        ]
    },
    {
        "id": "d6f25e3a.74fdf",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "suche_deaktivieren",
        "rules": [
            {
                "t": "set",
                "p": "enabled",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 360,
        "wires": [
            [
                "8bf40b44.18eae8"
            ]
        ]
    },
    {
        "id": "fcd42f2e.05e51",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "suche_aktivieren",
        "rules": [
            {
                "t": "set",
                "p": "enabled",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 440,
        "wires": [
            [
                "8bf40b44.18eae8"
            ]
        ]
    },
    {
        "id": "8bf40b44.18eae8",
        "type": "link out",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "links": [
            "28209abe.d8ea26"
        ],
        "x": 1095,
        "y": 420,
        "wires": []
    },
    {
        "id": "28209abe.d8ea26",
        "type": "link in",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "links": [
            "8bf40b44.18eae8"
        ],
        "x": 95,
        "y": 720,
        "wires": [
            [
                "b2323e24.1bca3"
            ]
        ]
    },
    {
        "id": "b2323e24.1bca3",
        "type": "ui_button",
        "z": "5cd2cab4.efd0d4",
        "name": "button_suche",
        "group": "64dba6a2.57e538",
        "order": 8,
        "width": 6,
        "height": 1,
        "passthru": false,
        "label": "Suche",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "textInput",
        "payloadType": "flow",
        "topic": "",
        "topicType": "str",
        "x": 220,
        "y": 720,
        "wires": [
            [
                "9332d0a2.b0b25"
            ]
        ]
    },
    {
        "id": "46c5954a.8d872c",
        "type": "ui_dropdown",
        "z": "5cd2cab4.efd0d4",
        "name": "dropdown_auswahl",
        "label": "Suchkriterium:",
        "tooltip": "",
        "place": "Select option",
        "group": "64dba6a2.57e538",
        "order": 1,
        "width": 6,
        "height": 1,
        "passthru": true,
        "multiple": false,
        "options": [
            {
                "label": "ID",
                "value": "id",
                "type": "str"
            },
            {
                "label": "Zustand",
                "value": "status",
                "type": "str"
            },
            {
                "label": "Datum",
                "value": "date",
                "type": "str"
            }
        ],
        "payload": "",
        "topic": "abc",
        "topicType": "msg",
        "x": 170,
        "y": 600,
        "wires": [
            [
                "b03368b1.3abeb8",
                "bd27186c.e7f348"
            ]
        ]
    },
    {
        "id": "23af91f0.e54c1e",
        "type": "ui_date_picker",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "label": "datum_auswahl",
        "group": "64dba6a2.57e538",
        "order": 5,
        "width": 0,
        "height": 0,
        "passthru": true,
        "topic": "topic",
        "topicType": "msg",
        "x": 160,
        "y": 880,
        "wires": [
            [
                "ed000b04.28b5e8"
            ]
        ]
    },
    {
        "id": "d4007487.a5b768",
        "type": "function",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL suche nach ID",
        "func": "msg.topic = \"SELECT * FROM data WHERE id=\" +msg.payload+ \"\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1070,
        "y": 680,
        "wires": [
            [
                "6a3c8183.4eab1"
            ]
        ]
    },
    {
        "id": "b03368b1.3abeb8",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "selected",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 430,
        "y": 600,
        "wires": [
            []
        ]
    },
    {
        "id": "9332d0a2.b0b25",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "selected",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 430,
        "y": 720,
        "wires": [
            [
                "4f63dfea.abda4"
            ]
        ]
    },
    {
        "id": "4f63dfea.abda4",
        "type": "switch",
        "z": "5cd2cab4.efd0d4",
        "name": "if",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "id",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "status",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "date",
                "vt": "str"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 4,
        "x": 640,
        "y": 720,
        "wires": [
            [
                "77637f82.0569e"
            ],
            [
                "58ef4bf4.698224"
            ],
            [
                "c1f13e88.0239a"
            ],
            []
        ]
    },
    {
        "id": "77637f82.0569e",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "textInput",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 680,
        "wires": [
            [
                "d4007487.a5b768"
            ]
        ]
    },
    {
        "id": "d8add5e3.ef3088",
        "type": "function",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL suche nach status",
        "func": "msg.topic = \"SELECT * FROM data WHERE status='\" +msg.payload+ \"'\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1090,
        "y": 720,
        "wires": [
            [
                "6a3c8183.4eab1"
            ]
        ]
    },
    {
        "id": "58ef4bf4.698224",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "textInput",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 720,
        "wires": [
            [
                "d8add5e3.ef3088"
            ]
        ]
    },
    {
        "id": "8cbb1b5a.efdcc8",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Datenbankseite mit Suche",
        "info": "",
        "x": 190,
        "y": 20,
        "wires": []
    },
    {
        "id": "6319b02b.fac72",
        "type": "debug",
        "z": "5cd2cab4.efd0d4",
        "name": "datum",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 810,
        "y": 880,
        "wires": []
    },
    {
        "id": "25915234.553ace",
        "type": "moment",
        "z": "5cd2cab4.efd0d4",
        "name": "datum_formatieren",
        "topic": "",
        "input": "date",
        "inputType": "flow",
        "inTz": "Europe/Berlin",
        "adjAmount": 0,
        "adjType": "days",
        "adjDir": "add",
        "format": "",
        "locale": "de-DE",
        "output": "date",
        "outputType": "flow",
        "outTz": "Europe/Berlin",
        "x": 590,
        "y": 880,
        "wires": [
            [
                "6319b02b.fac72"
            ]
        ]
    },
    {
        "id": "ed000b04.28b5e8",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "date",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 880,
        "wires": [
            [
                "25915234.553ace"
            ]
        ]
    },
    {
        "id": "8c3f8f4a.0dd39",
        "type": "function",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL suche nach datum",
        "func": "msg.payload = msg.payload.substring(0,10);\nmsg.topic = \"SELECT * FROM data WHERE date LIKE '%\" +msg.payload+ \"%'\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1090,
        "y": 760,
        "wires": [
            [
                "6a3c8183.4eab1"
            ]
        ]
    },
    {
        "id": "c1f13e88.0239a",
        "type": "change",
        "z": "5cd2cab4.efd0d4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "date",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 760,
        "wires": [
            [
                "8c3f8f4a.0dd39"
            ]
        ]
    },
    {
        "id": "bfe9ebfc.db9678",
        "type": "inject",
        "z": "5cd2cab4.efd0d4",
        "name": "initialisierung mit leeren string",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 210,
        "y": 360,
        "wires": [
            [
                "576597a5.932e68"
            ]
        ]
    },
    {
        "id": "2fe48549.983eca",
        "type": "switch",
        "z": "5cd2cab4.efd0d4",
        "name": "if",
        "property": "selected",
        "propertyType": "flow",
        "rules": [
            {
                "t": "else"
            },
            {
                "t": "eq",
                "v": "date",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 710,
        "y": 360,
        "wires": [
            [
                "d6f25e3a.74fdf"
            ],
            [
                "fcd42f2e.05e51"
            ]
        ]
    },
    {
        "id": "19f62319.5a257d",
        "type": "status",
        "z": "5cd2cab4.efd0d4",
        "name": "datenbank_status",
        "scope": [
            "6a3c8183.4eab1"
        ],
        "x": 170,
        "y": 1040,
        "wires": [
            [
                "b46b350e.023bb8",
                "b7808dab.a8325"
            ]
        ]
    },
    {
        "id": "b7808dab.a8325",
        "type": "function",
        "z": "5cd2cab4.efd0d4",
        "name": "status_funktion",
        "func": "if(msg.status.fill == \"green\")\n{\n    msg.payload=\"Online\";\n}\nelse\n{\n    msg.payload=\"Offline\";\n}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 460,
        "y": 1040,
        "wires": [
            [
                "569a4e46.d6617",
                "bb76dcbf.65346"
            ]
        ]
    },
    {
        "id": "569a4e46.d6617",
        "type": "ui_led",
        "z": "5cd2cab4.efd0d4",
        "order": 15,
        "group": "64dba6a2.57e538",
        "width": 3,
        "height": 1,
        "label": "Datenbank: ",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ff0000",
                "value": "Offline",
                "valueType": "str"
            },
            {
                "color": "#008000",
                "value": "Online",
                "valueType": "str"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "led_status",
        "x": 670,
        "y": 1040,
        "wires": []
    },
    {
        "id": "bb76dcbf.65346",
        "type": "ui_text",
        "z": "5cd2cab4.efd0d4",
        "group": "64dba6a2.57e538",
        "order": 16,
        "width": 1,
        "height": 1,
        "name": "text_status",
        "label": "",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 670,
        "y": 1100,
        "wires": []
    },
    {
        "id": "4f824c52.4c8ae4",
        "type": "inject",
        "z": "5cd2cab4.efd0d4",
        "name": "test",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "2b7664c6.087dfc"
            ]
        ]
    },
    {
        "id": "a5e62a7d.71f5c8",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Buttonelemente zur Interaktion",
        "info": "",
        "x": 210,
        "y": 80,
        "wires": []
    },
    {
        "id": "afc97fec.f9501",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL Abfragebefehl",
        "info": "",
        "x": 450,
        "y": 220,
        "wires": []
    },
    {
        "id": "4300ff81.15b6d",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Verbindung zur MySQL Datenbank",
        "info": "",
        "x": 1400,
        "y": 240,
        "wires": []
    },
    {
        "id": "bd992878.29aa28",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Einfügen der ausgelesenen Daten in Tabelle",
        "info": "",
        "x": 1450,
        "y": 80,
        "wires": []
    },
    {
        "id": "d54ba6b7.68cf28",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Eingabebereich für Suchfunktion",
        "info": "",
        "x": 190,
        "y": 460,
        "wires": []
    },
    {
        "id": "9c8db8ff.207a88",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Abfrage ob das Textfeld leer ist und Deaktivierung des Suchbuttons",
        "info": "",
        "x": 820,
        "y": 480,
        "wires": []
    },
    {
        "id": "1f4723d9.f6c83c",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Auswahl des Suchkriteriums",
        "info": "",
        "x": 200,
        "y": 640,
        "wires": []
    },
    {
        "id": "2639c12c.8daabe",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Suchbutton",
        "info": "",
        "x": 210,
        "y": 760,
        "wires": []
    },
    {
        "id": "a4a061b6.6c49d",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Verzweigung je nach Vorwahl des Suchkriteriums",
        "info": "",
        "x": 520,
        "y": 780,
        "wires": []
    },
    {
        "id": "be86bcb6.95385",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "SQL Suchbefehl je nach Vorwahl",
        "info": "",
        "x": 1110,
        "y": 800,
        "wires": []
    },
    {
        "id": "42b02ae0.565724",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Pop-Up-Kalender",
        "info": "",
        "x": 160,
        "y": 920,
        "wires": []
    },
    {
        "id": "d40e85e5.8782a8",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Datumsformatierung für Suche",
        "info": "",
        "x": 530,
        "y": 920,
        "wires": []
    },
    {
        "id": "c7027336.f555d",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Statusabfrage der Datenbank",
        "info": "",
        "x": 200,
        "y": 1000,
        "wires": []
    },
    {
        "id": "a6de5e3b.bfe62",
        "type": "comment",
        "z": "5cd2cab4.efd0d4",
        "name": "Anzeige des Datenbankstatus",
        "info": "",
        "x": 720,
        "y": 1000,
        "wires": []
    },
    {
        "id": "bcdb7e6d.374db",
        "type": "ui_group",
        "name": "Datenbank",
        "tab": "4af2ffba.9d14c",
        "order": 1,
        "disp": true,
        "width": 17,
        "collapse": false
    },
    {
        "id": "92414223.53143",
        "type": "MySQLdatabase",
        "name": "apt2_db",
        "host": "127.0.0.1",
        "port": "3306",
        "db": "apt2",
        "tz": "Europe/Berlin",
        "charset": "UTF8"
    },
    {
        "id": "64dba6a2.57e538",
        "type": "ui_group",
        "name": "Suche",
        "tab": "4af2ffba.9d14c",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "4af2ffba.9d14c",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]