[
    {
        "id": "3495ed94.6c2a12",
        "type": "tab",
        "label": "Briefkasten",
        "disabled": false,
        "info": ""
    },
    {
        "id": "2fe60c0b.5e6504",
        "type": "server-state-changed",
        "z": "3495ed94.6c2a12",
        "name": "Briefkasten",
        "version": 1,
        "entityidfilter": "binary_sensor.mailbox_contact",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "habool",
        "haltifstate": "true",
        "halt_if_type": "bool",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "x": 90,
        "y": 140,
        "wires": [
            [
                "f4a6178a.34858"
            ],
            []
        ]
    },
    {
        "id": "5aacb38a.c1edfc",
        "type": "api-call-service",
        "z": "3495ed94.6c2a12",
        "name": "Telegram Nachricht an Lukas",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "telegram",
        "entityId": "",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 780,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "f4a6178a.34858",
        "type": "trigger",
        "z": "3495ed94.6c2a12",
        "op1": "",
        "op2": "",
        "op1type": "nul",
        "op2type": "pay",
        "duration": "30",
        "extend": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "name": "",
        "x": 290,
        "y": 140,
        "wires": [
            [
                "77cca611.5b3098"
            ]
        ]
    },
    {
        "id": "9d37924a.6aded",
        "type": "server-events",
        "z": "3495ed94.6c2a12",
        "name": "Telegram Callbacks",
        "event_type": "telegram_callback",
        "x": 110,
        "y": 280,
        "wires": [
            [
                "9b6276b7.b8403"
            ]
        ]
    },
    {
        "id": "6ac251c3.fac79",
        "type": "switch",
        "z": "3495ed94.6c2a12",
        "name": "/mailbox_empty",
        "property": "payload.event.data",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "/mailbox_empty",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 580,
        "y": 280,
        "wires": [
            [
                "d9e27770.e79a38",
                "18fa06d3.b76949"
            ]
        ]
    },
    {
        "id": "d9e27770.e79a38",
        "type": "switch",
        "z": "3495ed94.6c2a12",
        "name": "Lukas hat Briefkasten geleert",
        "property": "payload.event.chat_id",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "6832695",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 860,
        "y": 240,
        "wires": [
            [
                "829c42b2.9cb41"
            ]
        ]
    },
    {
        "id": "829c42b2.9cb41",
        "type": "api-call-service",
        "z": "3495ed94.6c2a12",
        "name": "Telegram Nachricht",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "telegram_alexandra",
        "entityId": "",
        "data": "{\"message\":\"📪 Lukas hat den Briefkasten geleert\",\"data\":{\"disable_notification\":true}}",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 1150,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "18fa06d3.b76949",
        "type": "switch",
        "z": "3495ed94.6c2a12",
        "name": "Alexandra hat Briefkasten geleert",
        "property": "payload.event.chat_id",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "3569759",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 880,
        "y": 300,
        "wires": [
            [
                "a26a9e98.000ac"
            ]
        ]
    },
    {
        "id": "a26a9e98.000ac",
        "type": "api-call-service",
        "z": "3495ed94.6c2a12",
        "name": "Telegram Nachricht",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "telegram_alexandra",
        "entityId": "",
        "data": "{\"message\":\"📪 Alexandra hat den Briefkasten geleert\",\"data\":{\"disable_notification\":true}}",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 1150,
        "y": 300,
        "wires": [
            []
        ]
    },
    {
        "id": "9b6276b7.b8403",
        "type": "delay",
        "z": "3495ed94.6c2a12",
        "name": "",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "hour",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 340,
        "y": 280,
        "wires": [
            [
                "6ac251c3.fac79"
            ]
        ]
    },
    {
        "id": "e0cbd7a4.3ff438",
        "type": "api-call-service",
        "z": "3495ed94.6c2a12",
        "name": "Telegram Nachricht an Alexandra",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "telegram_alexandra",
        "entityId": "",
        "data": "msg.payload",
        "dataType": "jsonata",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 800,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "77cca611.5b3098",
        "type": "function",
        "z": "3495ed94.6c2a12",
        "name": "Message",
        "func": "const data = {\n    \"message\": \"📫 Die Post war da.\",\n    \"data\": {\n        \"disable_notification\": true,\n        \"inline_keyboard\": [\n            \"Briefkasten geleert:/mailbox_empty\"\n        ]\n    }\n};  \n\nmsg.payload = {\n    data\n};\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 480,
        "y": 140,
        "wires": [
            [
                "5aacb38a.c1edfc",
                "e0cbd7a4.3ff438"
            ]
        ]
    }
]
