//Revisi Final: #include #include #include const int relay1 = 33; const int relay2 = 25; const int relay3 = 26; const int relay4 = 27; const int relay5 = 14; const int relay6 = 12; const char* ssid = "BANDARA"; const char* password = "tidaktau"; const char* mqttServer = "broker.hivemq.com"; const int mqttPort = 1883; const char* mqttUser = ""; const char* mqttPassword = ""; const char* mqttTopic1 = "esp32/ccr"; WiFiClient espClient; PubSubClient client(espClient); //--------- Setup Awal -------------------------------------- void setup() { pinMode(relay1, OUTPUT); pinMode(relay2, OUTPUT); pinMode(relay3, OUTPUT); pinMode(relay4, OUTPUT); pinMode(relay5, OUTPUT); pinMode(relay6, OUTPUT); Serial.begin(115200); wifi_connect(); mqtt_setup(); delay (2000); } void loop() { client.loop(); } //--------- WIFI ------------------------------------------- void wifi_connect() { Serial.print("Starting connecting WiFi."); delay(10); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } //------------------ MQTT ---------------------------------- void mqtt_setup() { client.setServer(mqttServer, mqttPort); client.setCallback(callback); Serial.println("Connecting to MQTT…"); while (!client.connected()) { String clientId = "ESP32Client-"; clientId += String(random(0xffff), HEX); if (client.connect(clientId.c_str(), mqttUser, mqttPassword )) { Serial.println("connected"); } else { Serial.print("failed with state "); Serial.println(client.state()); delay(2000); } } client.subscribe(mqttTopic1); } void callback(char* topic, byte* payload, unsigned int length) { Serial.print("Message arrived in topic: "); Serial.println(topic); if(strcmp(topic, "esp32/ccr") == 0) { String byteRead = ""; Serial.print("Message: "); for (int i = 0; i < length; i++) { byteRead += (char)payload[i]; } Serial.println(byteRead); if (byteRead == "OFF"){ Serial.println("off"); digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); digitalWrite(relay3, LOW); digitalWrite(relay4, LOW); digitalWrite(relay5, LOW); digitalWrite(relay6, LOW); } if (byteRead == "ON"){ Serial.println("off"); digitalWrite(relay1, HIGH); digitalWrite(relay2, LOW); digitalWrite(relay3, LOW); digitalWrite(relay4, LOW); digitalWrite(relay5, LOW); digitalWrite(relay6, LOW); } if (byteRead == "1"){ Serial.println("Step 1"); //digitalWrite(relay1, LOW); digitalWrite(relay2, HIGH); digitalWrite(relay3, LOW); digitalWrite(relay4, LOW); digitalWrite(relay5, LOW); digitalWrite(relay6, LOW); } if (byteRead == "2"){ Serial.println("Step 2"); //digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); digitalWrite(relay3, HIGH); digitalWrite(relay4, LOW); digitalWrite(relay5, LOW); digitalWrite(relay6, LOW); } if (byteRead == "3"){ Serial.println("Step 3"); //digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); digitalWrite(relay3, LOW); digitalWrite(relay4, HIGH); digitalWrite(relay5, LOW); digitalWrite(relay6, LOW); } if (byteRead == "4"){ Serial.println("Step 4"); //digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); digitalWrite(relay3, LOW); digitalWrite(relay4, LOW); digitalWrite(relay5, HIGH); digitalWrite(relay6, LOW); } if (byteRead == "5"){ Serial.println("Step 5"); //digitalWrite(relay1, LOW); digitalWrite(relay2, LOW); digitalWrite(relay3, LOW); digitalWrite(relay4, LOW); digitalWrite(relay5, LOW); digitalWrite(relay6, HIGH); } }// Akhir MQTT } // FLOW NODERED [ { "id": "1996028bafebe017", "type": "tab", "label": "ananda", "disabled": false, "info": "" }, { "id": "5a6891e9a2d8ea5d", "type": "ui_template", "z": "1996028bafebe017", "group": "9a4b08f7.ef6ae8", "name": "Latar", "order": 3, "width": 0, "height": 0, "format": "\n\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "global", "x": 650, "y": 1060, "wires": [ [] ] }, { "id": "23b184efef181976", "type": "ui_svg_graphics", "z": "1996028bafebe017", "group": "94075aa.c8d49a8", "order": 1, "width": "23", "height": "11", "svgString": "", "clickableShapes": [], "javascriptHandlers": [], "smilAnimations": [], "bindings": [], "showCoordinates": false, "autoFormatAfterEdit": false, "showBrowserErrors": false, "showBrowserEvents": false, "enableJsDebugging": false, "sendMsgWhenLoaded": false, "noClickWhenDblClick": false, "outputField": "payload", "editorUrl": "//drawsvg.org/drawsvg.html", "directory": "", "panning": "disabled", "zooming": "disabled", "panOnlyWhenZoomed": false, "doubleClickZoomEnabled": false, "mouseWheelZoomEnabled": false, "dblClickZoomPercentage": 150, "cssString": "div.ui-svg svg{\n color: var(--nr-dashboard-widgetColor);\n fill: currentColor !important;\n}\ndiv.ui-svg path {\n fill: inherit;\n}", "name": "", "x": 2100, "y": 600, "wires": [ [] ] }, { "id": "3cd95d3cc2fdf3fb", "type": "switch", "z": "1996028bafebe017", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gte", "v": "1", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1210, "y": 1160, "wires": [ [ "7a6348bbda499372" ], [ "c4502f4b3a59984c" ] ] }, { "id": "7a6348bbda499372", "type": "function", "z": "1996028bafebe017", "name": "True", "func": "\nmsg.payload =\n{\"command\":\"update_style\",\"selector\":\"#taxiway\",\"attributeName\":\"fill\",\"attributeValue\":\"blue\"}\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 1140, "wires": [ [ "23b184efef181976" ] ] }, { "id": "c4502f4b3a59984c", "type": "function", "z": "1996028bafebe017", "name": "False", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#taxiway\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 1180, "wires": [ [ "23b184efef181976" ] ] }, { "id": "11c96a70af20b4ab", "type": "switch", "z": "1996028bafebe017", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gte", "v": "1", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1210, "y": 680, "wires": [ [ "6e3447d9263012c3", "f836c6ce376b564e", "61bc331aefbed3e3" ], [ "afc0be35bfa1798b", "7aee5604350dd36f", "a867deb072c0fb12" ] ] }, { "id": "afc0be35bfa1798b", "type": "function", "z": "1996028bafebe017", "name": "Off Runway", "func": "\nmsg.payload =\n{\"command\":\"update_style\",\"selector\":\"#r1\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1530, "y": 640, "wires": [ [ "23b184efef181976" ] ] }, { "id": "6e3447d9263012c3", "type": "function", "z": "1996028bafebe017", "name": "On Runway", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#r2\",\"attributeName\":\"fill\",\"attributeValue\":\"yellow\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1530, "y": 600, "wires": [ [ "23b184efef181976" ] ] }, { "id": "f836c6ce376b564e", "type": "function", "z": "1996028bafebe017", "name": "On Runway", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#r1\",\"attributeName\":\"fill\",\"attributeValue\":\"yellow\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1530, "y": 560, "wires": [ [ "23b184efef181976" ] ] }, { "id": "7aee5604350dd36f", "type": "function", "z": "1996028bafebe017", "name": "Off Runway", "func": "\nmsg.payload =\n{\"command\":\"update_style\",\"selector\":\"#r2\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1530, "y": 680, "wires": [ [ "23b184efef181976" ] ] }, { "id": "69d4ed71f13f7c0e", "type": "switch", "z": "1996028bafebe017", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gte", "v": "1", "vt": "num" }, { "t": "eq", "v": "0", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1210, "y": 360, "wires": [ [ "d4b3e141cad106a9", "2f95a29a0f4c3f9f", "7c51bb0fac8bbe85", "59cb2c1ea918d2ef", "5820455119893ac2" ], [ "630e0362ce5ffe27", "a5b24ac190e1d963", "c4695c18b893df30", "e1aa540715c0695f", "78c8d736b1174507" ] ] }, { "id": "d4b3e141cad106a9", "type": "function", "z": "1996028bafebe017", "name": "edge2", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#edge2\",\"attributeName\":\"fill\",\"attributeValue\":\"green\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 140, "wires": [ [ "23b184efef181976" ] ] }, { "id": "2f95a29a0f4c3f9f", "type": "function", "z": "1996028bafebe017", "name": "edge1", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#edge1\",\"attributeName\":\"fill\",\"attributeValue\":\"green\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 100, "wires": [ [ "23b184efef181976" ] ] }, { "id": "59cb2c1ea918d2ef", "type": "function", "z": "1996028bafebe017", "name": "end2", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#end2\",\"attributeName\":\"fill\",\"attributeValue\":\"red\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 220, "wires": [ [ "23b184efef181976" ] ] }, { "id": "7c51bb0fac8bbe85", "type": "function", "z": "1996028bafebe017", "name": "end1", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#end1\",\"attributeName\":\"fill\",\"attributeValue\":\"red\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 180, "wires": [ [ "23b184efef181976" ] ] }, { "id": "a5b24ac190e1d963", "type": "function", "z": "1996028bafebe017", "name": "edge2", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#edge2\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 340, "wires": [ [ "23b184efef181976" ] ] }, { "id": "630e0362ce5ffe27", "type": "function", "z": "1996028bafebe017", "name": "edge1", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#edge1\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 300, "wires": [ [ "23b184efef181976" ] ] }, { "id": "e1aa540715c0695f", "type": "function", "z": "1996028bafebe017", "name": "end2", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#end2\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 420, "wires": [ [ "23b184efef181976" ] ] }, { "id": "c4695c18b893df30", "type": "function", "z": "1996028bafebe017", "name": "end1", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#end1\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 380, "wires": [ [ "23b184efef181976" ] ] }, { "id": "3347150550c2e967", "type": "function", "z": "1996028bafebe017", "name": "papi1on", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#pap1\",\"attributeName\":\"fill\",\"attributeValue\":\"red\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1520, "y": 860, "wires": [ [ "23b184efef181976" ] ] }, { "id": "84943ef661a0df20", "type": "function", "z": "1996028bafebe017", "name": "papi2on", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#papi_putih\",\"attributeName\":\"fill\",\"attributeValue\":\"white\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1520, "y": 900, "wires": [ [ "23b184efef181976" ] ] }, { "id": "09a7935c2d67bafc", "type": "switch", "z": "1996028bafebe017", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gte", "v": "1", "vt": "num" }, { "t": "eq", "v": "0", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1210, "y": 940, "wires": [ [ "3347150550c2e967", "84943ef661a0df20", "60495956d691fd7f" ], [ "b3cb0901dc8e23ac", "39635e3c31c38161", "c36b92a893352e7a" ] ] }, { "id": "b3cb0901dc8e23ac", "type": "function", "z": "1996028bafebe017", "name": "papi1off", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#pap1\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1520, "y": 960, "wires": [ [ "23b184efef181976" ] ] }, { "id": "39635e3c31c38161", "type": "function", "z": "1996028bafebe017", "name": "papi2off", "func": "\nmsg.payload ={\"command\":\"update_style\",\"selector\":\"#papi_putih\",\"attributeName\":\"fill\",\"attributeValue\":\"black\"}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1520, "y": 1000, "wires": [ [ "23b184efef181976" ] ] }, { "id": "61bc331aefbed3e3", "type": "function", "z": "1996028bafebe017", "name": "max", "func": "\nmsg.payload =1;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 720, "wires": [ [] ] }, { "id": "a867deb072c0fb12", "type": "function", "z": "1996028bafebe017", "name": "min", "func": "\nmsg.payload =0;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 760, "wires": [ [] ] }, { "id": "5820455119893ac2", "type": "function", "z": "1996028bafebe017", "name": "max", "func": "\nmsg.payload =1;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 60, "wires": [ [] ] }, { "id": "78c8d736b1174507", "type": "function", "z": "1996028bafebe017", "name": "min", "func": "\nmsg.payload =0;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 460, "wires": [ [] ] }, { "id": "c36b92a893352e7a", "type": "function", "z": "1996028bafebe017", "name": "min", "func": "\nmsg.payload =0;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 1040, "wires": [ [] ] }, { "id": "60495956d691fd7f", "type": "function", "z": "1996028bafebe017", "name": "max", "func": "\nmsg.payload =1;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1510, "y": 820, "wires": [ [] ] }, { "id": "be671f5cc66303e7", "type": "mqtt out", "z": "1996028bafebe017", "name": "", "topic": "esp32/ccr", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "26ccbff21c327e9b", "x": 560, "y": 440, "wires": [] }, { "id": "076d72c951fa3d17", "type": "ui_button", "z": "1996028bafebe017", "name": "", "group": "e05bfba2cda1b9fa", "order": 4, "width": "4", "height": "1", "passthru": false, "label": "Step 1", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "1", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 910, "y": 560, "wires": [ [ "11c96a70af20b4ab", "69d4ed71f13f7c0e", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb", "be671f5cc66303e7", "09cbc3ca6f27a4f8" ] ] }, { "id": "0f59fd5fe401ac0a", "type": "ui_button", "z": "1996028bafebe017", "name": "", "group": "e05bfba2cda1b9fa", "order": 5, "width": "4", "height": "1", "passthru": false, "label": "Step 2", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "2", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 910, "y": 600, "wires": [ [ "11c96a70af20b4ab", "69d4ed71f13f7c0e", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb", "be671f5cc66303e7", "09cbc3ca6f27a4f8" ] ] }, { "id": "d482dcd0138d8ceb", "type": "ui_button", "z": "1996028bafebe017", "name": "", "group": "e05bfba2cda1b9fa", "order": 6, "width": "4", "height": "1", "passthru": false, "label": "Step 3", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "3", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 910, "y": 640, "wires": [ [ "11c96a70af20b4ab", "69d4ed71f13f7c0e", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb", "be671f5cc66303e7", "09cbc3ca6f27a4f8" ] ] }, { "id": "c09989403b3b26b6", "type": "ui_button", "z": "1996028bafebe017", "name": "", "group": "e05bfba2cda1b9fa", "order": 7, "width": "4", "height": "1", "passthru": false, "label": "Step 4", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "4", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 910, "y": 680, "wires": [ [ "11c96a70af20b4ab", "69d4ed71f13f7c0e", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb", "be671f5cc66303e7", "09cbc3ca6f27a4f8" ] ] }, { "id": "6722300d333ce03a", "type": "ui_button", "z": "1996028bafebe017", "name": "", "group": "e05bfba2cda1b9fa", "order": 8, "width": "3", "height": "1", "passthru": false, "label": "Step 5", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "5", "payloadType": "num", "topic": "topic", "topicType": "msg", "x": 910, "y": 720, "wires": [ [ "11c96a70af20b4ab", "69d4ed71f13f7c0e", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb", "be671f5cc66303e7", "09cbc3ca6f27a4f8" ] ] }, { "id": "36454ba016ad12f6", "type": "comment", "z": "1996028bafebe017", "name": "Tombol Kontrol", "info": "Tombol Kontrol", "x": 920, "y": 460, "wires": [] }, { "id": "8691862af97123d2", "type": "comment", "z": "1996028bafebe017", "name": "Taxiway", "info": "", "x": 1210, "y": 1120, "wires": [] }, { "id": "843aab8a3cb49e69", "type": "comment", "z": "1996028bafebe017", "name": "PAPI", "info": "", "x": 1210, "y": 900, "wires": [] }, { "id": "5b2ff87b3363ec20", "type": "comment", "z": "1996028bafebe017", "name": "Runway", "info": "", "x": 1200, "y": 640, "wires": [] }, { "id": "32395ee685ab06af", "type": "comment", "z": "1996028bafebe017", "name": "Treshhold & End Light", "info": "", "x": 1160, "y": 320, "wires": [] }, { "id": "09cbc3ca6f27a4f8", "type": "ui_level", "z": "1996028bafebe017", "group": "e05bfba2cda1b9fa", "order": 1, "width": "23", "height": "1", "name": "", "label": "STEP ", "colorHi": "#e60000", "colorWarn": "#ff9900", "colorNormal": "#00b33c", "colorOff": "#595959", "min": 0, "max": "5", "segWarn": "", "segHigh": "", "unit": "", "layout": "sh", "channelA": "", "channelB": "", "decimals": 0, "animations": "soft", "shape": "1", "colorschema": "rainbow", "textoptions": "custom", "colorText": "#eeeeee", "fontLabel": "1", "fontValue": "", "fontSmall": "", "colorFromTheme": true, "textAnimations": true, "hideValue": false, "tickmode": "off", "peakmode": false, "property": "payload", "peaktime": 3000, "x": 1210, "y": 460, "wires": [] }, { "id": "4a174bece918429d", "type": "ui_switch", "z": "1996028bafebe017", "name": "", "label": "ON/OFF", "tooltip": "", "group": "e05bfba2cda1b9fa", "order": 3, "width": "4", "height": "1", "passthru": false, "decouple": "false", "topic": "topic", "topicType": "msg", "style": "", "onvalue": "ON", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "animate": false, "className": "", "x": 300, "y": 600, "wires": [ [ "840199442a2195fb", "28557890eb857c92", "be671f5cc66303e7" ] ] }, { "id": "840199442a2195fb", "type": "switch", "z": "1996028bafebe017", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "OFF", "vt": "str" }, { "t": "eq", "v": "ON", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 450, "y": 600, "wires": [ [ "c2d648b1445ca062" ], [ "dab6c5b2f80631a5" ] ] }, { "id": "c2d648b1445ca062", "type": "function", "z": "1996028bafebe017", "name": "", "func": "msg.enabled = false\nreturn msg;", "outputs": 1, "noerr": 0, "x": 600, "y": 580, "wires": [ [ "076d72c951fa3d17", "0f59fd5fe401ac0a", "d482dcd0138d8ceb", "c09989403b3b26b6", "6722300d333ce03a", "09cbc3ca6f27a4f8" ] ] }, { "id": "dab6c5b2f80631a5", "type": "function", "z": "1996028bafebe017", "name": "", "func": "msg.enabled = true\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 600, "y": 640, "wires": [ [ "076d72c951fa3d17", "0f59fd5fe401ac0a", "d482dcd0138d8ceb", "c09989403b3b26b6", "6722300d333ce03a" ] ] }, { "id": "28557890eb857c92", "type": "function", "z": "1996028bafebe017", "name": "", "func": "msg.payload =0;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 520, "y": 740, "wires": [ [ "69d4ed71f13f7c0e", "11c96a70af20b4ab", "09a7935c2d67bafc", "3cd95d3cc2fdf3fb" ] ] }, { "id": "b4f48352c70660e8", "type": "mqtt in", "z": "1996028bafebe017", "name": "", "topic": "esp32/ccr", "qos": "2", "datatype": "auto", "broker": "4feecaa4aa2ca627", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 540, "y": 320, "wires": [ [ "271849cfea67b1de" ] ] }, { "id": "271849cfea67b1de", "type": "debug", "z": "1996028bafebe017", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 710, "y": 320, "wires": [] }, { "id": "9a4b08f7.ef6ae8", "type": "ui_group", "name": "Treshold & End Light", "tab": "34092427.e760ac", "order": 5, "disp": true, "width": "6", "collapse": false }, { "id": "94075aa.c8d49a8", "type": "ui_group", "name": "Landasan", "tab": "34092427.e760ac", "order": 1, "disp": false, "width": "23", "collapse": false, "className": "" }, { "id": "26ccbff21c327e9b", "type": "mqtt-broker", "name": "MQTT", "broker": "broker.hivemq.com", "port": "1883", "clientid": "", "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" }, { "id": "e05bfba2cda1b9fa", "type": "ui_group", "name": "Keterangan", "tab": "34092427.e760ac", "order": 3, "disp": false, "width": "23", "collapse": false }, { "id": "4feecaa4aa2ca627", "type": "mqtt-broker", "name": "MQTT", "broker": "broker.hivemq.com", "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": "" }, { "id": "34092427.e760ac", "type": "ui_tab", "name": "Beranda", "icon": "dashboard", "order": 25, "disabled": false, "hidden": false } ]