[
    {
        "id": "5d17293dd2b19696",
        "type": "tab",
        "label": "Уведомления",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "fb898eedb5884a74",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "1. Выясняем id чата.",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "7e1d6dcc92764a0e",
            "4604f6a400a39acc",
            "c7d8717055ee3bdd"
        ],
        "x": 74,
        "y": 99,
        "w": 432,
        "h": 82
    },
    {
        "id": "23935b71e7780f6e",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "2. Автозагрузка номер чата ID для глобальной переменной.",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "506b1a2c9fd69d44",
            "bbbdce894e030cd5"
        ],
        "x": 74,
        "y": 219,
        "w": 432,
        "h": 82
    },
    {
        "id": "8eca4117c5fe059d",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "3. Уведомлений сработки выключателей и реле",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "daeb130922139785",
            "50440f8a2f3f2c23",
            "83afc249ed2e8a6e",
            "e1909ce41b36f476",
            "c5045b911c8d5cf7",
            "2829f16adbf2de86"
        ],
        "x": 74,
        "y": 339,
        "w": 982,
        "h": 122
    },
    {
        "id": "57fd69c88fc48451",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "4. Уведомление о привышении температуры выше 27С с интервалом 5 минут",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "e00358c4494d8433",
            "910f17902a809f3f",
            "5afe725437afc592",
            "31886b4d9bc1c319",
            "7cd7b9f2173e6d99"
        ],
        "x": 74,
        "y": 499,
        "w": 982,
        "h": 82
    },
    {
        "id": "aff722f1b7afead6",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "5. Уведомление о понижении температуры ниже 24С  с интервалом 5 минут",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "6e6206ace03597d1",
            "e2169c4db07c0faf",
            "f4712cabd28da210",
            "834d6fc4eb39175e",
            "37dabba6c3c27a1b"
        ],
        "x": 74,
        "y": 619,
        "w": 982,
        "h": 82
    },
    {
        "id": "6648206769f60b8c",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "6. Уведомление о срабтки датчика протечки",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "1fe5b06e752833e0",
            "047f2459bde9a23f",
            "4b34338ab8dc76a2",
            "0e0cc7af21f6bb5e",
            "2f641bf1fb485876",
            "57db2b906c2604e8"
        ],
        "x": 74,
        "y": 739,
        "w": 982,
        "h": 122
    },
    {
        "id": "f3d3e93e8e9d589a",
        "type": "group",
        "z": "5d17293dd2b19696",
        "name": "Отправка сообщений в телеграм",
        "style": {
            "label": true,
            "color": "#3f3f3f"
        },
        "nodes": [
            "6b37778f54560a00",
            "c2716ea08d838099",
            "8731455aa7b05dc6"
        ],
        "x": 594,
        "y": 219,
        "w": 452,
        "h": 82
    },
    {
        "id": "7e1d6dcc92764a0e",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "fb898eedb5884a74",
        "name": "Start",
        "func": "context.global.keyboard = { pending : true};\n//flow.set(\"ID\");\n//msg.payload.chatId = flow.get(\"ID\");\nvar ID = msg.payload.chatId\n\nvar opts = {\n    reply_to_message_id: msg.payload.massageId,\n    reply_markup: JSON.stringify({\n        inline_keyboard: [\n        [{ text: 'Ваш chatId ' + ID + \".\", callback_data: 'back' } ],\n        ],\n        'one_time_keyboard' : true\n    })\n};\n\nmsg.payload.content = 'Запомни свой chatId!!!';\nmsg.payload.options = opts;\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 140,
        "wires": [
            [
                "c7d8717055ee3bdd"
            ]
        ]
    },
    {
        "id": "4604f6a400a39acc",
        "type": "telegram receiver",
        "z": "5d17293dd2b19696",
        "g": "fb898eedb5884a74",
        "name": "",
        "bot": "a788ae491901412f",
        "saveDataDir": "",
        "filterCommands": false,
        "x": 180,
        "y": 140,
        "wires": [
            [
                "7e1d6dcc92764a0e"
            ],
            []
        ]
    },
    {
        "id": "506b1a2c9fd69d44",
        "type": "change",
        "z": "5d17293dd2b19696",
        "g": "23935b71e7780f6e",
        "name": "Flow chatId",
        "rules": [
            {
                "t": "set",
                "p": "ID",
                "pt": "global",
                "to": "801224234234234",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "bbbdce894e030cd5",
        "type": "inject",
        "z": "5d17293dd2b19696",
        "g": "23935b71e7780f6e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "5",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 260,
        "wires": [
            [
                "506b1a2c9fd69d44"
            ]
        ]
    },
    {
        "id": "e00358c4494d8433",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "57fd69c88fc48451",
        "name": "Температура в доме",
        "func": "context.global.keyboard = { pending : true};\nvar temp = msg.payload[0].state.temperature.temperature\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"Температура в доме превысела \" + temp + \" C.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 840,
        "y": 540,
        "wires": [
            [
                "7cd7b9f2173e6d99"
            ]
        ]
    },
    {
        "id": "daeb130922139785",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "ВКЛ",
        "func": "context.global.keyboard = { pending : true};\n//var temp = msg.payload[0].state.temperature.temperature\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"Свет на улице включен.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 890,
        "y": 380,
        "wires": [
            [
                "2829f16adbf2de86"
            ]
        ]
    },
    {
        "id": "50440f8a2f3f2c23",
        "type": "event-state",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "Освещение на улице",
        "server": "3e6a7582d6002030",
        "list": "",
        "category": "switch",
        "device": "0x4c97a1fffed108b4",
        "state": "power",
        "x": 200,
        "y": 400,
        "wires": [
            [
                "c5045b911c8d5cf7"
            ]
        ]
    },
    {
        "id": "6b37778f54560a00",
        "type": "telegram sender",
        "z": "5d17293dd2b19696",
        "g": "f3d3e93e8e9d589a",
        "name": "",
        "bot": "a788ae491901412f",
        "haserroroutput": false,
        "outputs": 1,
        "x": 940,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "83afc249ed2e8a6e",
        "type": "switch",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "Выясняем ВКЛ/ВЫКЛ",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "on",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "off",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 670,
        "y": 400,
        "wires": [
            [
                "daeb130922139785"
            ],
            [
                "e1909ce41b36f476"
            ]
        ]
    },
    {
        "id": "e1909ce41b36f476",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "ВЫКЛ",
        "func": "context.global.keyboard = { pending : true};\n//var temp = msg.payload[0].state.temperature.temperature\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"Свет на улице выключен.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 890,
        "y": 420,
        "wires": [
            [
                "2829f16adbf2de86"
            ]
        ]
    },
    {
        "id": "910f17902a809f3f",
        "type": "switch",
        "z": "5d17293dd2b19696",
        "g": "57fd69c88fc48451",
        "name": ">= 28C",
        "property": "payload[0].state.temperature.temperature",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gte",
                "v": "28",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 620,
        "y": 540,
        "wires": [
            [
                "e00358c4494d8433"
            ]
        ]
    },
    {
        "id": "5afe725437afc592",
        "type": "get-devices",
        "z": "5d17293dd2b19696",
        "g": "57fd69c88fc48451",
        "name": "t студия",
        "server": "7154feec16c5d6cc",
        "category": "temperatureAndHumiditySensor",
        "device": "0x142d41fffe36b705",
        "x": 420,
        "y": 540,
        "wires": [
            [
                "910f17902a809f3f"
            ]
        ]
    },
    {
        "id": "31886b4d9bc1c319",
        "type": "inject",
        "z": "5d17293dd2b19696",
        "g": "57fd69c88fc48451",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "300",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 210,
        "y": 540,
        "wires": [
            [
                "5afe725437afc592"
            ]
        ]
    },
    {
        "id": "6e6206ace03597d1",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "aff722f1b7afead6",
        "name": "Температура в доме",
        "func": "context.global.keyboard = { pending : true};\nvar temp = msg.payload[0].state.temperature.temperature\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"Низкая температура в доме \" + temp + \" C.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 840,
        "y": 660,
        "wires": [
            [
                "37dabba6c3c27a1b"
            ]
        ]
    },
    {
        "id": "e2169c4db07c0faf",
        "type": "switch",
        "z": "5d17293dd2b19696",
        "g": "aff722f1b7afead6",
        "name": "<= 24C",
        "property": "payload[0].state.temperature.temperature",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lte",
                "v": "24",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 620,
        "y": 660,
        "wires": [
            [
                "6e6206ace03597d1"
            ]
        ]
    },
    {
        "id": "f4712cabd28da210",
        "type": "get-devices",
        "z": "5d17293dd2b19696",
        "g": "aff722f1b7afead6",
        "name": "t студия",
        "server": "7154feec16c5d6cc",
        "category": "temperatureAndHumiditySensor",
        "device": "0x142d41fffe36b705",
        "x": 420,
        "y": 660,
        "wires": [
            [
                "e2169c4db07c0faf"
            ]
        ]
    },
    {
        "id": "834d6fc4eb39175e",
        "type": "inject",
        "z": "5d17293dd2b19696",
        "g": "aff722f1b7afead6",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "300",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 210,
        "y": 660,
        "wires": [
            [
                "f4712cabd28da210"
            ]
        ]
    },
    {
        "id": "1fe5b06e752833e0",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "Ой-ой, протечка",
        "func": "context.global.keyboard = { pending : true};\n//var temp = msg.payload[0].state.temperature.temperature\n//var name = msg.payload[0].name\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"На кухне обнаружена протечка.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 850,
        "y": 780,
        "wires": [
            [
                "57db2b906c2604e8"
            ]
        ]
    },
    {
        "id": "047f2459bde9a23f",
        "type": "switch",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "Статус протечки",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "true",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "false",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 590,
        "y": 800,
        "wires": [
            [
                "1fe5b06e752833e0"
            ],
            [
                "0e0cc7af21f6bb5e"
            ]
        ]
    },
    {
        "id": "4b34338ab8dc76a2",
        "type": "event-state",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "Протечка на кухне",
        "server": "3e6a7582d6002030",
        "list": "",
        "category": "waterLeakDetector",
        "device": "0x842712fffe179ebc",
        "state": "water-leak",
        "x": 190,
        "y": 800,
        "wires": [
            [
                "2f641bf1fb485876"
            ]
        ]
    },
    {
        "id": "0e0cc7af21f6bb5e",
        "type": "function",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "Теперь уже сухо",
        "func": "context.global.keyboard = { pending : true};\n//var temp = msg.payload[0].state.temperature.temperature\n//var name = msg.payload[0].name\n\n//var opts = {\n//    reply_to_message_id: msg.payload.massageId,\n//    reply_markup: JSON.stringify({\n//        inline_keyboard: [\n//        [{ text: 'Назад ' + temp + \" C\", callback_data: 'back' } ],\n//        ],\n//        'one_time_keyboard' : true\n//    })\n//};\n\nvar chatid = msg.payload.chatId\n\nmsg.payload = {}\nmsg.payload.chatId = global.get(\"ID\");\nmsg.payload.type = \"message\"\nmsg.payload.content = \"На кухне теперь сухо.\"\n//msg.payload.options = opts\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 850,
        "y": 820,
        "wires": [
            [
                "57db2b906c2604e8"
            ]
        ]
    },
    {
        "id": "c5045b911c8d5cf7",
        "type": "rbe",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 430,
        "y": 400,
        "wires": [
            [
                "83afc249ed2e8a6e"
            ]
        ]
    },
    {
        "id": "c2716ea08d838099",
        "type": "delay",
        "z": "5d17293dd2b19696",
        "g": "f3d3e93e8e9d589a",
        "name": "",
        "pauseType": "delay",
        "timeout": "3",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 750,
        "y": 260,
        "wires": [
            [
                "6b37778f54560a00"
            ]
        ]
    },
    {
        "id": "8731455aa7b05dc6",
        "type": "link in",
        "z": "5d17293dd2b19696",
        "g": "f3d3e93e8e9d589a",
        "name": "link in 1",
        "links": [
            "2829f16adbf2de86",
            "7cd7b9f2173e6d99",
            "37dabba6c3c27a1b",
            "57db2b906c2604e8",
            "c7d8717055ee3bdd"
        ],
        "x": 635,
        "y": 260,
        "wires": [
            [
                "c2716ea08d838099"
            ]
        ]
    },
    {
        "id": "2829f16adbf2de86",
        "type": "link out",
        "z": "5d17293dd2b19696",
        "g": "8eca4117c5fe059d",
        "name": "link out 1",
        "mode": "link",
        "links": [
            "8731455aa7b05dc6"
        ],
        "x": 1015,
        "y": 400,
        "wires": []
    },
    {
        "id": "2f641bf1fb485876",
        "type": "rbe",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 390,
        "y": 800,
        "wires": [
            [
                "047f2459bde9a23f"
            ]
        ]
    },
    {
        "id": "7cd7b9f2173e6d99",
        "type": "link out",
        "z": "5d17293dd2b19696",
        "g": "57fd69c88fc48451",
        "name": "link out 2",
        "mode": "link",
        "links": [
            "8731455aa7b05dc6"
        ],
        "x": 1015,
        "y": 540,
        "wires": []
    },
    {
        "id": "37dabba6c3c27a1b",
        "type": "link out",
        "z": "5d17293dd2b19696",
        "g": "aff722f1b7afead6",
        "name": "link out 3",
        "mode": "link",
        "links": [
            "8731455aa7b05dc6"
        ],
        "x": 1015,
        "y": 660,
        "wires": []
    },
    {
        "id": "57db2b906c2604e8",
        "type": "link out",
        "z": "5d17293dd2b19696",
        "g": "6648206769f60b8c",
        "name": "link out 4",
        "mode": "link",
        "links": [
            "8731455aa7b05dc6"
        ],
        "x": 1015,
        "y": 800,
        "wires": []
    },
    {
        "id": "c7d8717055ee3bdd",
        "type": "link out",
        "z": "5d17293dd2b19696",
        "g": "fb898eedb5884a74",
        "name": "link out 5",
        "mode": "link",
        "links": [
            "8731455aa7b05dc6"
        ],
        "x": 465,
        "y": 140,
        "wires": []
    },
    {
        "id": "a788ae491901412f",
        "type": "telegram bot",
        "botname": "ihost_remote",
        "usernames": "MerkulovSS",
        "chatids": "",
        "baseapiurl": "",
        "testenvironment": false,
        "updatemode": "polling",
        "pollinterval": "1000",
        "usesocks": false,
        "sockshost": "",
        "socksprotocol": "socks5",
        "socksport": 6667,
        "socksusername": "anonymous",
        "sockspassword": "",
        "bothost": "",
        "botpath": "",
        "localbothost": "0.0.0.0",
        "localbotport": 8443,
        "publicbotport": 8443,
        "privatekey": "",
        "certificate": "",
        "useselfsignedcertificate": false,
        "sslterminated": false,
        "verboselogging": false
    },
    {
        "id": "3e6a7582d6002030",
        "type": "api-server",
        "name": "Token_example",
        "ip": "127.0.0.1",
        "ipaddr": "",
        "token": "4252e47f-4cf1-4391-9769-a0101325ec46"
    },
    {
        "id": "7154feec16c5d6cc",
        "type": "api-server",
        "name": "Token_example",
        "ip": "192.168.31.61",
        "ipaddr": "",
        "token": "fd82c0be-4cc3-430c-ae1a-630eea2d6cb5"
    },
    {
        "id": "763509c78018a280",
        "type": "global-config",
        "env": [],
        "modules": {
            "node-red-contrib-telegrambot": "16.3.2",
            "node-red-contrib-ewelink-cube": "1.3.5"
        }
    }
]