[ { "id": "b54441ff0e1e1d78", "type": "tab", "label": "Умная клетка для птиц", "disabled": false, "info": "", "env": [] }, { "id": "3329b02ba68d5122", "type": "mqtt in", "z": "b54441ff0e1e1d78", "name": "", "topic": "Bird", "qos": "2", "datatype": "auto-detect", "broker": "77647757300a0f3b", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 250, "y": 260, "wires": [ [ "69ab35d16ddcd908" ] ] }, { "id": "69ab35d16ddcd908", "type": "ui_template", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "name": "Video", "order": 1, "width": 6, "height": 5, "format": "
\n \n
\n\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", "x": 430, "y": 260, "wires": [ [] ] }, { "id": "7d8023c9457af7b3", "type": "mqtt in", "z": "b54441ff0e1e1d78", "name": "light", "topic": "esp32/sensors/light", "qos": "0", "datatype": "auto-detect", "broker": "77647757300a0f3b", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 250, "y": 340, "wires": [ [ "d343a20cb8cc4c3f", "953e9b0817d7888a" ] ] }, { "id": "98a116d0b230fd5e", "type": "mqtt in", "z": "b54441ff0e1e1d78", "name": "temp", "topic": "esp32/sensors/temp", "qos": "0", "datatype": "auto-detect", "broker": "77647757300a0f3b", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 250, "y": 420, "wires": [ [ "967917ac6800fba7" ] ] }, { "id": "9f71a077937ffa10", "type": "mqtt in", "z": "b54441ff0e1e1d78", "name": "humidity", "topic": "esp32/sensors/humidity", "qos": "0", "datatype": "auto-detect", "broker": "77647757300a0f3b", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 240, "y": 500, "wires": [ [ "a62bb5aa0c518728" ] ] }, { "id": "d343a20cb8cc4c3f", "type": "ui_text", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "order": 20, "width": 4, "height": 1, "name": "Light", "label": "Освещённость", "format": "{{msg.payload}} lux", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 430, "y": 340, "wires": [] }, { "id": "967917ac6800fba7", "type": "ui_text", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "order": 23, "width": 4, "height": 1, "name": "Temperature", "label": "Температура", "format": "{{msg.payload}} °C", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 450, "y": 420, "wires": [] }, { "id": "a62bb5aa0c518728", "type": "ui_text", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "order": 26, "width": 4, "height": 1, "name": "Humidity", "label": "Влажность", "format": "{{msg.payload}} %", "layout": "row-spread", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 440, "y": 500, "wires": [] }, { "id": "326e3d7cd0711c1a", "type": "mqtt out", "z": "b54441ff0e1e1d78", "name": "", "topic": "esp32/led", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "77647757300a0f3b", "x": 660, "y": 860, "wires": [] }, { "id": "688951172c116781", "type": "ui_colour_picker", "z": "b54441ff0e1e1d78", "name": "color_led", "label": "Цвет свечения", "group": "546b157844234b18", "format": "hex", "outformat": "string", "showSwatch": true, "showPicker": false, "showValue": false, "showHue": false, "showAlpha": false, "showLightness": true, "square": "false", "dynOutput": "false", "order": 10, "width": 3, "height": 1, "passthru": true, "topic": "topic", "topicType": "msg", "className": "", "x": 240, "y": 860, "wires": [ [ "debe9d9adfca0645" ] ] }, { "id": "debe9d9adfca0645", "type": "function", "z": "b54441ff0e1e1d78", "name": "function 1", "func": "let hex = msg.payload;\n\nhex = hex.replace(\"#\", \"\");\n\nlet r = parseInt(hex.substring(0, 2), 16);\nlet g = parseInt(hex.substring(2, 4), 16);\nlet b = parseInt(hex.substring(4, 6), 16);\n\nmsg.payload = `${r},${g},${b}`;\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 860, "wires": [ [ "326e3d7cd0711c1a" ] ] }, { "id": "95c5b2f761fe6d30", "type": "ui_switch", "z": "b54441ff0e1e1d78", "name": "led", "label": "Выкл./Вкл. освещение", "tooltip": "", "group": "546b157844234b18", "order": 5, "width": 3, "height": 1, "passthru": true, "decouple": "false", "topic": "esp32/led", "topicType": "msg", "style": "", "onvalue": "255,255,255", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "animate": false, "className": "", "x": 430, "y": 800, "wires": [ [ "326e3d7cd0711c1a", "a7a8bbbba6048822" ] ] }, { "id": "9dd1c7f2d5e42901", "type": "ui_button", "z": "b54441ff0e1e1d78", "name": "day", "group": "546b157844234b18", "order": 7, "width": 2, "height": 1, "passthru": false, "label": "День", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "DAY", "payloadType": "str", "topic": "esp32/servo", "topicType": "msg", "x": 430, "y": 640, "wires": [ [ "aa0c521baa5be283", "018bce1ef78ece19" ] ] }, { "id": "3f8af190256a6358", "type": "ui_button", "z": "b54441ff0e1e1d78", "name": "night", "group": "546b157844234b18", "order": 15, "width": 2, "height": 1, "passthru": false, "label": "Ночь", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "NIGHT", "payloadType": "str", "topic": "esp32/servo", "topicType": "msg", "x": 430, "y": 720, "wires": [ [ "aa0c521baa5be283", "018bce1ef78ece19" ] ] }, { "id": "e1b2f26f37b43975", "type": "ui_button", "z": "b54441ff0e1e1d78", "name": "mid", "group": "546b157844234b18", "order": 12, "width": 2, "height": 1, "passthru": false, "label": "Полдень", "tooltip": "", "color": "", "bgcolor": "", "className": "", "icon": "", "payload": "MID", "payloadType": "str", "topic": "esp32/servo", "topicType": "msg", "x": 430, "y": 680, "wires": [ [ "aa0c521baa5be283", "018bce1ef78ece19" ] ] }, { "id": "018bce1ef78ece19", "type": "mqtt out", "z": "b54441ff0e1e1d78", "name": "", "topic": "esp32/servo", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "77647757300a0f3b", "x": 670, "y": 640, "wires": [] }, { "id": "c238963e4e433c07", "type": "ui_text", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "order": 3, "width": 4, "height": 2, "name": "", "label": "Состояние жалюзи", "format": "{{msg.payload}}", "layout": "col-center", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 860, "y": 720, "wires": [] }, { "id": "aa0c521baa5be283", "type": "function", "z": "b54441ff0e1e1d78", "name": "function 2", "func": "let command = msg.payload;\n\nlet status_text = \"\";\nlet status_color = \"\";\n\nswitch(command) {\n case \"DAY\":\n status_text = \"День\";\n status_color = \"green\";\n break;\n case \"MID\":\n status_text = \"Полдень\";\n status_color = \"orange\";\n break;\n case \"NIGHT\":\n status_text = \"Ночь\";\n status_color = \"blue\";\n break;\n default:\n status_text = \"Неизвестное состояние\";\n status_color = \"gray\";\n}\n\nmsg.payload = command;\n\nlet status_msg = {\n payload: status_text,\n topic: \"esp32/servo\"\n};\n\nnode.send([\n [status_msg],\n [msg]\n]);", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 660, "y": 720, "wires": [ [ "c238963e4e433c07" ] ] }, { "id": "a7a8bbbba6048822", "type": "function", "z": "b54441ff0e1e1d78", "name": "function 3", "func": "let led_value = msg.payload;\n\nlet status_text = \"Освещение выключено\";\nlet status_color = \"\";\n\nif (led_value === \"255,255,255\" || led_value === \"ON\") {\n status_text = \"Освещение включено\";\n status_color = \"green\";\n} else if (led_value === \"OFF\") {\n status_text = \"Освещение выключено\";\n status_color = \"red\";\n} \n\nlet status_msg = {\n payload: status_text,\n color: status_color\n};\n\nnode.send([status_msg]);\n\nlet mqtt_msg = {\n payload: led_value,\n topic: \"esp32/led\"\n};\nnode.send([null, mqtt_msg]);", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 660, "y": 800, "wires": [ [ "935423913e479104" ] ] }, { "id": "935423913e479104", "type": "ui_text", "z": "b54441ff0e1e1d78", "group": "546b157844234b18", "order": 2, "width": 5, "height": 2, "name": "", "label": "Состояние освещения", "format": "{{msg.payload}}", "layout": "col-center", "className": "", "style": false, "font": "", "fontSize": 16, "color": "#000000", "x": 870, "y": 800, "wires": [] }, { "id": "953e9b0817d7888a", "type": "ui_chart", "z": "b54441ff0e1e1d78", "name": "", "group": "546b157844234b18", "order": 17, "width": 9, "height": 5, "label": "Изменение освещённости", "chartType": "line", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "0", "ymax": "500", "removeOlder": "24", "removeOlderPoints": "", "removeOlderUnit": "3600", "cutout": 0, "useOneColor": false, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "outputs": 1, "useDifferentColor": false, "className": "", "x": 640, "y": 340, "wires": [ [] ] }, { "id": "f7c54e9ed468ad03", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 4, "width": 1, "height": 1 }, { "id": "06f9e525bae03d4f", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 6, "width": 2, "height": 1 }, { "id": "7e39ac586ef75670", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 8, "width": 1, "height": 1 }, { "id": "eebc2ead2bdc4713", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 9, "width": 1, "height": 1 }, { "id": "60c5659493f5b1e3", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 11, "width": 2, "height": 1 }, { "id": "8e200c90a6fe2612", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 13, "width": 1, "height": 1 }, { "id": "13a88f7bf1f6b955", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 14, "width": 6, "height": 1 }, { "id": "d8806707892c2923", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 16, "width": 1, "height": 1 }, { "id": "9a9ebc45643a2504", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 18, "width": 6, "height": 1 }, { "id": "5e37295a74a08a72", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 19, "width": 1, "height": 1 }, { "id": "8d65bde5f5fe894d", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 21, "width": 1, "height": 1 }, { "id": "089a1385b0933a72", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 22, "width": 1, "height": 1 }, { "id": "8dad06acd8afbd47", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 24, "width": 1, "height": 1 }, { "id": "f1d14ae70273a27f", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 25, "width": 1, "height": 1 }, { "id": "2da5e779df30a880", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 27, "width": 1, "height": 1 }, { "id": "98a43a6570fb548d", "type": "ui_spacer", "z": "b54441ff0e1e1d78", "name": "spacer", "group": "546b157844234b18", "order": 28, "width": 6, "height": 1 }, { "id": "77647757300a0f3b", "type": "mqtt-broker", "name": "Mosquitto", "broker": "192.168.31.78", "port": 1883, "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": 4, "keepalive": 60, "cleansession": true, "autoUnsubscribe": true, "birthTopic": "", "birthQos": "0", "birthRetain": "false", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closeRetain": "false", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willRetain": "false", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" }, { "id": "546b157844234b18", "type": "ui_group", "z": "b54441ff0e1e1d78", "name": "Мониторинг и управление", "tab": "8e35d7697e7af77c", "order": 1, "disp": true, "width": 15, "collapse": false, "className": "" }, { "id": "8e35d7697e7af77c", "type": "ui_tab", "name": "Home", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "d21957267aecd6fc", "type": "global-config", "env": [], "modules": { "node-red-dashboard": "3.6.6" } } ]