2025_2 WOKWI & Node-red 4LED Control SQLite
Wokwi程式
#include <WiFi.h>
#include <PubSubClient.h>
//Relays for switching appliances
#define Relay1 15 //D15 LED-Orangs = Water-1
#define Relay2 2 //D2 LED-Blue = Water-2
#define Relay3 19 //D19 LED-Blue = Motor
#define Relay4 23 //D23 LED-RED = Fan
//Nenu For Control
int menu;
//Changs to:
#define sub1 "alex9ufo/2025/RELAY"
#define pub1 "alex9ufo/2025/RELAY_Status"
// Update these with values suitable for your network.
const char* ssid = "Wokwi-GUEST";
const char* password = "";
const char* mqtt_server = "test.mosquitto.org"; // Local IP address of Raspberry Pi
const char* username = "";
const char* pass = "";
WiFiClient espClient;
PubSubClient client(espClient);
unsigned long lastMsg = 0;
#define MSG_BUFFER_SIZE (50)
char msg[MSG_BUFFER_SIZE];
int value = 0;
bool Send= false;
String json="";
//===============================================
void setup_wifi() {
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
randomSeed(micros());
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
//==============================================================
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
String message="";
for (int i = 0; i < length; i++) {
message += (char) payload[i]; // Convert *byte to string
}
Serial.print(message);
message.trim();
if (strstr(topic, sub1)) //Button 1
{
if (message == "1on" ) {
digitalWrite(Relay1, HIGH); // Turn on the LED
Send = true;
json="Relay1on";
}
if (message == "1off" ) {
digitalWrite(Relay1, LOW); // Turn off the LED
Send = true;
json="Relay1off";
}
if (message == "2on" ) {
digitalWrite(Relay2, HIGH); // Turn on the LED
Send = true;
json="Relay2on";
}
if (message == "2off" ) {
digitalWrite(Relay2, LOW); // Turn off the LED
Send = true;
json="Relay2off";
}
if (message == "3on" ) {
digitalWrite(Relay3, HIGH); // Turn on the LED
Send = true;
json="Relay3on";
}
if (message == "3off" ) {
digitalWrite(Relay3, LOW); // Turn off the LED
Send = true;
json="Relay3off";
}
if (message == "4on" ) {
digitalWrite(Relay4, HIGH); // Turn on the LED
Send = true;
json="Relay4on";
}
if (message == "4off" ) {
digitalWrite(Relay4, LOW); // Turn off the LED
Send = true;
json="Relay4off";
}
}
else{
Serial.println("unsubscribed topic");
}
}
//==============================================================
void reconnect() {
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
String clientId = "ESP32Client-";
clientId += String(random(0xffff), HEX);
// Attempt to connect
if (client.connect(clientId.c_str(), username, pass) ) {
Serial.println("connected");
client.subscribe(sub1);
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
//==============================================================
void Publish_message() {
if (Send){
int json_len = json.length() + 1;
char char_array[json_len];
json.toCharArray(char_array,json_len);
client.publish(pub1, char_array);
Serial.println();
Serial.print("publish message to MQTT");
Serial.println(json);
Send= false;
json="";
}
}
//==============================================================
void setup() {
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
Serial.begin(115200);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
client.subscribe(pub1);
}
//==============================================================
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
Publish_message();
}
Node-Red程式
[
{
"id": "a372cea73beb3a05",
"type": "mqtt out",
"z": "33c3da553ea53bd4",
"name": "RELAY Publish",
"topic": "alex9ufo/2025/RELAY",
"qos": "1",
"retain": "true",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "21957383cfd8785a",
"x": 360,
"y": 180,
"wires": []
},
{
"id": "82d385e2eb6b122c",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 1,
"width": 3,
"height": 1,
"passthru": false,
"label": "1:ON",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "1on",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 40,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "e2fe8c489f68c8dd",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 2,
"width": 3,
"height": 1,
"passthru": false,
"label": "1:OFF",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "1off",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 80,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "b1280ff6e0481ef1",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 3,
"width": 3,
"height": 1,
"passthru": false,
"label": "2:ON",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "2on",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 140,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "708276fa2d4b9fa9",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 4,
"width": 3,
"height": 1,
"passthru": false,
"label": "2:OFF",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "2off",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 180,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "25b63d1e21e0db1f",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 5,
"width": 3,
"height": 1,
"passthru": false,
"label": "3:ON",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "3on",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 240,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "4506263f8855cde6",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 6,
"width": 3,
"height": 1,
"passthru": false,
"label": "3:OFF",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "3off",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 280,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "8f35ed3186738c6d",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 7,
"width": 3,
"height": 1,
"passthru": false,
"label": "4:ON",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "4on",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 340,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "3125de8fb95024e5",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "a4d2ace4206ad2ca",
"order": 8,
"width": 3,
"height": 1,
"passthru": false,
"label": "4:OFF",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "4off",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 90,
"y": 380,
"wires": [
[
"a372cea73beb3a05",
"5fde6bf521e22525"
]
]
},
{
"id": "5fde6bf521e22525",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug ",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 330,
"y": 260,
"wires": []
},
{
"id": "0c087106ac2c4476",
"type": "mqtt in",
"z": "33c3da553ea53bd4",
"name": "RELAY_Status Subscribe",
"topic": "alex9ufo/2025/RELAY_Status",
"qos": "1",
"datatype": "auto-detect",
"broker": "21957383cfd8785a",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 870,
"y": 80,
"wires": [
[
"411f2cc26d55f7ea",
"c4c76ca52988aeba",
"c988848f9b693e3c",
"10c48eb49e03c792"
]
]
},
{
"id": "0faa1b059c37c6af",
"type": "inject",
"z": "33c3da553ea53bd4",
"name": "CREATE建立",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id));",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 640,
"wires": [
[
"069e85183ab53ad1"
]
]
},
{
"id": "26b81b9033e5600f",
"type": "inject",
"z": "33c3da553ea53bd4",
"name": "SELECT檢視",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "SELECT * FROM LEDSTATUS",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 720,
"wires": [
[
"069e85183ab53ad1"
]
]
},
{
"id": "8f3cf6c95eca7577",
"type": "inject",
"z": "33c3da553ea53bd4",
"name": "INSERT新增",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "INSERT INTO LEDSTATUS (STATUS , Date , Time )values(\"off\", \"11/22\" , \"21:05\") ",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 680,
"wires": [
[
"069e85183ab53ad1"
]
]
},
{
"id": "c2f301de90b06934",
"type": "inject",
"z": "33c3da553ea53bd4",
"name": "DELETE刪除所有資料",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "DELETE from LEDSTATUS",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 760,
"wires": [
[
"069e85183ab53ad1"
]
]
},
{
"id": "213869a5372eb64d",
"type": "inject",
"z": "33c3da553ea53bd4",
"name": "DROP TABLE刪除資料庫",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "DROP TABLE LEDSTATUS",
"payload": "",
"payloadType": "date",
"x": 170,
"y": 800,
"wires": [
[
"069e85183ab53ad1"
]
]
},
{
"id": "069e85183ab53ad1",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 400,
"y": 720,
"wires": [
[
"8d643b1047de06c2"
]
]
},
{
"id": "8d643b1047de06c2",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 590,
"y": 720,
"wires": []
},
{
"id": "eb1cb4f05a3e5c24",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "資料表 :TABLE LEDSTATUS",
"info": "CREATE TABLE LEDSTATUS (\nid INTEGER,\nSTATUS TEXT,\nDate DATE,\nTime TIME,\nPRIMARY KEY (id)\n);\n\n",
"x": 160,
"y": 600,
"wires": []
},
{
"id": "34c6bf81e029fce9",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1380,
"y": 320,
"wires": [
[
"bd3577c05451aa6d"
]
]
},
{
"id": "812df6585f532b7c",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "CREATE DATABASE",
"func": "//CREATE TABLE LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n//CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id));\nmsg.topic = \"CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id))\";\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1120,
"y": 340,
"wires": [
[
"34c6bf81e029fce9"
]
]
},
{
"id": "4cd52de5ad9ae50f",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 3,
"width": 2,
"height": 1,
"passthru": false,
"label": "建立資料庫",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "建立資料庫",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 830,
"y": 320,
"wires": [
[
"812df6585f532b7c",
"04bb2dabfb7bfd84"
]
]
},
{
"id": "411f2cc26d55f7ea",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "INSERT",
"func": "var Today = new Date();\nvar yyyy = Today.getFullYear(); //年\nvar MM = Today.getMonth()+1; //月\nvar dd = Today.getDate(); //日\nvar h = Today.getHours(); //時\nvar m = Today.getMinutes(); //分\nvar s = Today.getSeconds(); //秒\nif(MM<10)\n{\n MM = '0'+MM;\n}\n\nif(dd<10)\n{\n dd = '0'+dd;\n}\n\nif(h<10)\n{\n h = '0'+h;\n}\n\nif(m<10)\n{\n m = '0' + m;\n}\n\nif(s<10)\n{\n s = '0' + s;\n}\nvar var_date = yyyy+'/'+MM+'/'+dd;\nvar var_time = h+':'+m+':'+s;\n\nvar myLED = msg.payload;\n\n\nmsg.topic = \"INSERT INTO LEDSTATUS ( STATUS , Date , Time ) VALUES ($myLED, $var_date , $var_time ) \" ;\nmsg.payload = [myLED, var_date , var_time ]\nreturn msg;\n\n\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 80,
"wires": [
[
"2972644a1d34a437"
]
]
},
{
"id": "c4c76ca52988aeba",
"type": "ui_audio",
"z": "33c3da553ea53bd4",
"name": "",
"group": "3a18026dc181f483",
"voice": "Microsoft Hanhan - Chinese (Traditional, Taiwan)",
"always": true,
"x": 1055,
"y": 40,
"wires": [],
"l": false
},
{
"id": "2972644a1d34a437",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1280,
"y": 80,
"wires": [
[
"f9e7f7455b9aa80b",
"9c8cc0ffd6542e88"
]
]
},
{
"id": "bd3577c05451aa6d",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug ",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1570,
"y": 320,
"wires": []
},
{
"id": "f9e7f7455b9aa80b",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug ",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1550,
"y": 80,
"wires": []
},
{
"id": "1ec8c556c723d8a3",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 4,
"width": 6,
"height": 1,
"passthru": false,
"label": "檢視資料庫資料",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "檢視資料",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 840,
"y": 380,
"wires": [
[
"9c8cc0ffd6542e88",
"04bb2dabfb7bfd84"
]
]
},
{
"id": "9c8cc0ffd6542e88",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "檢視資料",
"func": "//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//SELECT * FROM LEDSTATUS ORDER BY id DESC LIMIT 50;\n\nmsg.topic = \"SELECT * FROM LEDSTATUS ORDER BY id DESC LIMIT 50\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 380,
"wires": [
[
"4d24191a7d97b002"
]
]
},
{
"id": "6827f1c33952d058",
"type": "ui_table",
"z": "33c3da553ea53bd4",
"group": "3a18026dc181f483",
"name": "",
"order": 2,
"width": 10,
"height": 10,
"columns": [],
"outputs": 0,
"cts": false,
"x": 1670,
"y": 380,
"wires": []
},
{
"id": "4d24191a7d97b002",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1380,
"y": 380,
"wires": [
[
"6827f1c33952d058"
]
]
},
{
"id": "4783c2c1d3a7b871",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 1,
"width": 2,
"height": 1,
"passthru": false,
"label": "刪除資料庫 ",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "刪除資料庫 ",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 830,
"y": 580,
"wires": [
[
"f8032bbb3e662848",
"72ca1fc951612e11"
]
]
},
{
"id": "e6adc94336fbe2b3",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "DROP DATABASE",
"func": "//CREATE TABLE LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n//CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id));\nmsg.topic = \"DROP TABLE LEDSTATUS\";\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1500,
"y": 580,
"wires": [
[
"0f56a9aa0efa398e"
]
]
},
{
"id": "0f56a9aa0efa398e",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1700,
"y": 560,
"wires": [
[
"907850716b0f297c"
]
]
},
{
"id": "980e9e55c00a9599",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 2,
"width": 2,
"height": 1,
"passthru": false,
"label": "刪除所有資料 ",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "刪除所有資料 ",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 840,
"y": 520,
"wires": [
[
"72ca1fc951612e11",
"0e04faee3261bc7c"
]
]
},
{
"id": "242378754491f9cd",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "DELETE ALL DATA",
"func": "//CREATE TABLE LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n//CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id));\nmsg.topic = \"DELETE from LEDSTATUS\";\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1490,
"y": 520,
"wires": [
[
"0f56a9aa0efa398e"
]
]
},
{
"id": "f8032bbb3e662848",
"type": "ui_toast",
"z": "33c3da553ea53bd4",
"position": "prompt",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "Cancel",
"raw": true,
"className": "",
"topic": "",
"name": "",
"x": 1090,
"y": 580,
"wires": [
[
"0ef4339822ffc3eb"
]
]
},
{
"id": "0ef4339822ffc3eb",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "OK or Cancel",
"func": "var topic=msg.payload;\nif (topic==\"\"){\n return [msg,null];\n \n}\nif (topic==\"Cancel\"){\n return [null,msg];\n \n}\nreturn msg;",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1280,
"y": 580,
"wires": [
[
"e6adc94336fbe2b3"
],
[]
]
},
{
"id": "72ca1fc951612e11",
"type": "ui_audio",
"z": "33c3da553ea53bd4",
"name": "",
"group": "3a18026dc181f483",
"voice": "Microsoft Hanhan - Chinese (Traditional, Taiwan)",
"always": true,
"x": 975,
"y": 560,
"wires": [],
"l": false
},
{
"id": "0e04faee3261bc7c",
"type": "ui_toast",
"z": "33c3da553ea53bd4",
"position": "prompt",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "Cancel",
"raw": true,
"className": "",
"topic": "",
"name": "",
"x": 1110,
"y": 520,
"wires": [
[
"96c4c2f725a7c923"
]
]
},
{
"id": "96c4c2f725a7c923",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "OK or Cancel",
"func": "var topic=msg.payload;\nif (topic==\"\"){\n return [msg,null];\n \n}\nif (topic==\"Cancel\"){\n return [null,msg];\n \n}\nreturn msg;",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1280,
"y": 520,
"wires": [
[
"242378754491f9cd"
],
[]
]
},
{
"id": "04bb2dabfb7bfd84",
"type": "ui_audio",
"z": "33c3da553ea53bd4",
"name": "",
"group": "3a18026dc181f483",
"voice": "Microsoft Hanhan - Chinese (Traditional, Taiwan)",
"always": true,
"x": 975,
"y": 360,
"wires": [],
"l": false
},
{
"id": "907850716b0f297c",
"type": "link out",
"z": "33c3da553ea53bd4",
"name": "link out 39",
"mode": "link",
"links": [
"da9ce5f52e7568d5"
],
"x": 1835,
"y": 520,
"wires": []
},
{
"id": "da9ce5f52e7568d5",
"type": "link in",
"z": "33c3da553ea53bd4",
"name": "link in 36",
"links": [
"907850716b0f297c"
],
"x": 1085,
"y": 460,
"wires": [
[
"9c8cc0ffd6542e88"
]
]
},
{
"id": "1ad5590e82891d1b",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "資料庫位置 2025LED.db",
"info": "",
"x": 410,
"y": 680,
"wires": []
},
{
"id": "074a512ff7060501",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "CREATE建立",
"info": "CREATE TABLE LEDSTATUS (id INTEGER,STATUS TEXT,Date DATE,Time TIME,PRIMARY KEY (id));",
"x": 390,
"y": 780,
"wires": []
},
{
"id": "5d2cfe50d450a59d",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "INSERT新增",
"info": "INSERT INTO LEDSTATUS (STATUS , Date , Time )values(\"on\", \"11/01\" , \"21:05\") ",
"x": 550,
"y": 760,
"wires": []
},
{
"id": "2d3db1fb721ee9ff",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "SELECT檢視",
"info": "SELECT * FROM LEDSTATUS",
"x": 390,
"y": 820,
"wires": []
},
{
"id": "451d4ab38c9a1791",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "DELETE刪除所有資料",
"info": "DELETE from LEDSTATUS",
"x": 580,
"y": 800,
"wires": []
},
{
"id": "796631c93428be7b",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "DROP TABLE 刪除資料庫",
"info": "DROP TABLE LEDSTATUS",
"x": 590,
"y": 840,
"wires": []
},
{
"id": "c988848f9b693e3c",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug ",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1030,
"y": 200,
"wires": []
},
{
"id": "10c48eb49e03c792",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "function ",
"func": "var temp=msg.payload;\n\nif (temp==\"Relay1on\")\n{\n msg.payload=true;\n return [msg, null, null, null] ;\n}\n\nif (temp == \"Relay1off\")\n{\n msg.payload = false;\n return [msg, null, null, null];\n}\n\nif (temp == \"Relay2on\")\n{\n msg.payload = true;\n return [null, msg, null, null];\n}\n\nif (temp == \"Relay2off\")\n{\n msg.payload = false;\n return [null, msg, null, null]; \n}\n\nif (temp == \"Relay3on\") {\n msg.payload = true;\n return [null, null, msg, null];\n}\n\nif (temp == \"Relay3off\") {\n msg.payload = false;\n return [null, null, msg, null];\n}\nif (temp == \"Relay4on\") {\n msg.payload = true;\n return [null, null, null, msg];\n}\n\nif (temp == \"Relay4off\") {\n msg.payload = false;\n return [null, null, null, msg];\n}\n\n\nreturn msg;",
"outputs": 4,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1360,
"y": 200,
"wires": [
[
"028676c7a483bf72"
],
[
"866ad59cc7586efc"
],
[
"69edffcacff8799c"
],
[
"c810968222fe1bbf"
]
]
},
{
"id": "028676c7a483bf72",
"type": "ui_led",
"z": "33c3da553ea53bd4",
"order": 9,
"group": "a4d2ace4206ad2ca",
"width": 2,
"height": 1,
"label": "LED1",
"labelPlacement": "left",
"labelAlignment": "left",
"colorForValue": [
{
"color": "#ff0000",
"value": "false",
"valueType": "bool"
},
{
"color": "#008000",
"value": "true",
"valueType": "bool"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showGlow": true,
"name": "",
"x": 1550,
"y": 140,
"wires": []
},
{
"id": "866ad59cc7586efc",
"type": "ui_led",
"z": "33c3da553ea53bd4",
"order": 12,
"group": "a4d2ace4206ad2ca",
"width": 2,
"height": 1,
"label": "LED2",
"labelPlacement": "left",
"labelAlignment": "left",
"colorForValue": [
{
"color": "#ff0000",
"value": "false",
"valueType": "bool"
},
{
"color": "#008000",
"value": "true",
"valueType": "bool"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showGlow": true,
"name": "",
"x": 1550,
"y": 180,
"wires": []
},
{
"id": "69edffcacff8799c",
"type": "ui_led",
"z": "33c3da553ea53bd4",
"order": 11,
"group": "a4d2ace4206ad2ca",
"width": 2,
"height": 1,
"label": "LED3",
"labelPlacement": "left",
"labelAlignment": "left",
"colorForValue": [
{
"color": "#ff0000",
"value": "false",
"valueType": "bool"
},
{
"color": "#008000",
"value": "true",
"valueType": "bool"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showGlow": true,
"name": "",
"x": 1550,
"y": 220,
"wires": []
},
{
"id": "c810968222fe1bbf",
"type": "ui_led",
"z": "33c3da553ea53bd4",
"order": 14,
"group": "a4d2ace4206ad2ca",
"width": 2,
"height": 1,
"label": "LED4",
"labelPlacement": "left",
"labelAlignment": "left",
"colorForValue": [
{
"color": "#ff0000",
"value": "false",
"valueType": "bool"
},
{
"color": "#008000",
"value": "true",
"valueType": "bool"
}
],
"allowColorForValueInMessage": false,
"shape": "circle",
"showGlow": true,
"name": "",
"x": 1550,
"y": 260,
"wires": []
},
{
"id": "43a757dd121aabad",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 3,
"width": 2,
"height": 1,
"passthru": false,
"label": "查詢一筆資料",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "查詢一筆資料",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 840,
"y": 660,
"wires": [
[
"532d1a653c2013ae",
"1de80a220b7c27fb"
]
]
},
{
"id": "331abc3ff99f9bc7",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "查詢一筆資料",
"func": "//\nvar id = msg.payload.id;\nvar s=global.get(\"SEL1\")\nmsg.topic=\"\";\nvar temp=\"\";\n\nif (s==1)\n{\n temp =\"SELECT * FROM LEDSTATUS\";\n temp=temp+\" WHERE id LIKE '\"+ id +\"'\";\n}\nmsg.topic=temp;\nglobal.set(\"SEL1\",0);\n\nreturn msg;\n\n//SELECT * FROM COMPANY WHERE AGE LIKE 'XXX%';\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//SELECT * FROM LEDSTATUS ORDER BY id DESC LIMIT 50;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1380,
"y": 660,
"wires": [
[
"3822c87e74fb44c4"
]
]
},
{
"id": "785cb5f132c0214a",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 4,
"width": 2,
"height": 1,
"passthru": false,
"label": "刪除一筆資料",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "刪除一筆資料",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 840,
"y": 720,
"wires": [
[
"1de80a220b7c27fb",
"99a750452bf7e6a0"
]
]
},
{
"id": "1de80a220b7c27fb",
"type": "ui_audio",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"voice": "Microsoft Hanhan - Chinese (Traditional, Taiwan)",
"always": true,
"x": 975,
"y": 760,
"wires": [],
"l": false
},
{
"id": "f1e5318f9a7d8fba",
"type": "ui_form",
"z": "33c3da553ea53bd4",
"name": "",
"label": "輸入id",
"group": "92ed45c1ead25706",
"order": 1,
"width": 0,
"height": 0,
"options": [
{
"label": "ID",
"value": "id",
"type": "number",
"required": true,
"rows": null
}
],
"formValue": {
"id": ""
},
"payload": "",
"submit": "Submit",
"cancel": "Cancle",
"topic": "Form",
"topicType": "str",
"splitLayout": false,
"className": "",
"x": 1230,
"y": 720,
"wires": [
[
"331abc3ff99f9bc7",
"5b0d647fab4fb5e4",
"c054b8a8a247adb8"
]
]
},
{
"id": "5b0d647fab4fb5e4",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "刪除一筆資料",
"func": "//\nvar id = msg.payload.id;\nvar s=global.get(\"SEL2\")\nmsg.topic=\"\";\nvar temp=\"\";\n\nif (s==2)\n{\n temp =\"DELETE FROM LEDSTATUS\";\n temp=temp+\" WHERE id LIKE '\"+ id +\"'\";\n}\n\nmsg.topic=temp;\nglobal.set(\"SEL2\",0)\nreturn msg;\n\n//SELECT * FROM COMPANY WHERE AGE LIKE 'XXX%';\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//DELETE FROM COMPANY WHERE ID = 7;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1400,
"y": 720,
"wires": [
[
"065bf4a3100f1761",
"69eabd1751e23894"
]
]
},
{
"id": "065bf4a3100f1761",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1740,
"y": 720,
"wires": [
[
"907850716b0f297c"
]
]
},
{
"id": "5e95f3828eb22020",
"type": "ui_button",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"order": 5,
"width": 2,
"height": 1,
"passthru": false,
"label": "更正一筆資料",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "更正一筆資料",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 840,
"y": 800,
"wires": [
[
"1de80a220b7c27fb",
"fbb3de6e36d4d17c"
]
]
},
{
"id": "8467e0130ecdb97f",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "UPDATE查詢的WHERE",
"info": "UPDATE查詢的WHERE子句的基本語法如下:\n\nUPDATE table_name\nSET column1 = value1, column2 = value2...., columnN = valueN\nWHERE [condition];",
"x": 860,
"y": 840,
"wires": []
},
{
"id": "bbf6213ae0ade3df",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "更正一筆資料",
"func": "//\nvar id = global.get(\"ID\");\nvar status = msg.payload.Status;\nvar date = msg.payload.date;\nvar time = msg.payload.time;\n\nvar s=global.get(\"SEL3\")\nmsg.topic=\"\";\nvar temp=\"\";\n\nif (s==3)\n{\n temp =\"update LEDSTATUS set \";\n temp=temp+\" STATUS= '\" + status +\"'\";\n temp=temp+\" , Date= '\" + date +\"'\";\n temp=temp+\" , Time= '\" + time +\"'\";\n temp=temp+\" WHERE id=\" + id;\n \n //msg.topic = \"update LEDSTATUS set ( id , STATUS , Date , Time ) VALUES ($id, $status , $date , $time ) \" ;\n //msg.payload = [id,status,date,time]\n}\nmsg.topic=temp;\n\nreturn msg;\n\n//msg.topic = \"INSERT INTO LEDSTATUS ( STATUS , Date , Time ) VALUES ($myLED, $var_date , $var_time ) \" ;\n//msg.payload = [myLED, var_date , var_time ]\n\n\n//SELECT * FROM COMPANY WHERE AGE LIKE 'XXX%';\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//DELETE FROM COMPANY WHERE ID = 7;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1500,
"y": 840,
"wires": [
[
"065bf4a3100f1761",
"f47a0d94165b368a"
]
]
},
{
"id": "532d1a653c2013ae",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "function flow set1",
"func": "var s1=1;\nglobal.set(\"SEL1\",s1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1050,
"y": 660,
"wires": [
[
"f1e5318f9a7d8fba"
]
]
},
{
"id": "99a750452bf7e6a0",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "function flow set2",
"func": "var s1=2;\nglobal.set(\"SEL2\",s1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1050,
"y": 720,
"wires": [
[
"f1e5318f9a7d8fba"
]
]
},
{
"id": "fbb3de6e36d4d17c",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "function flow set3",
"func": "var s1=3;\nglobal.set(\"SEL3\",s1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1050,
"y": 800,
"wires": [
[
"f1e5318f9a7d8fba"
]
]
},
{
"id": "bbca30af046ffbe2",
"type": "ui_form",
"z": "33c3da553ea53bd4",
"name": "",
"label": "更正欄位",
"group": "92ed45c1ead25706",
"order": 2,
"width": 0,
"height": 0,
"options": [
{
"label": "STATUS",
"value": "Status",
"type": "text",
"required": true,
"rows": null
},
{
"label": "DATE",
"value": "date",
"type": "text",
"required": true,
"rows": null
},
{
"label": "TIME",
"value": "time",
"type": "text",
"required": true,
"rows": null
}
],
"formValue": {
"Status": "",
"date": "",
"time": ""
},
"payload": "",
"submit": "Submit",
"cancel": "Cancle",
"topic": "Form",
"topicType": "str",
"splitLayout": false,
"className": "",
"x": 1320,
"y": 840,
"wires": [
[
"bbf6213ae0ade3df"
]
]
},
{
"id": "69eabd1751e23894",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug 213",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "topic",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1590,
"y": 700,
"wires": []
},
{
"id": "c054b8a8a247adb8",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "Store ID資料",
"func": "//\nvar id = msg.payload.id;\nglobal.set(\"ID\",id)\nreturn msg;\n\n//SELECT * FROM COMPANY WHERE AGE LIKE 'XXX%';\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//DELETE FROM COMPANY WHERE ID = 7;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1330,
"y": 780,
"wires": [
[
"bbca30af046ffbe2",
"59824498f6a1e878"
]
]
},
{
"id": "59824498f6a1e878",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "查詢一筆資料",
"func": "//\nvar id = global.get(\"ID\");\nmsg.topic=\"\";\nvar temp=\"\";\ntemp =\"SELECT * FROM LEDSTATUS\";\ntemp=temp+\" WHERE id LIKE '\"+ id +\"'\";\n\nmsg.topic=temp;\n\nreturn msg;\n\n//SELECT * FROM COMPANY WHERE AGE LIKE 'XXX%';\n//INSERT INTO LEDSTATUS (\n//id INTEGER,\n//STATUS TEXT,\n//Date DATE,\n//Time TIME,\n//PRIMARY KEY (id)\n//);\n\n//SELECT * FROM LEDSTATUS ORDER BY id DESC LIMIT 50;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1520,
"y": 780,
"wires": [
[
"3822c87e74fb44c4"
]
]
},
{
"id": "f47a0d94165b368a",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug 214",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "topic",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1690,
"y": 840,
"wires": []
},
{
"id": "37a92a352cb4e323",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "function ",
"func": "msg.payload=\" ---ESP32回來資料---\" +msg.payload;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1000,
"y": 960,
"wires": [
[
"dcb22585c17b1e18",
"22d68d38143464db",
"118227d24b4372c3"
]
]
},
{
"id": "dcb22585c17b1e18",
"type": "function",
"z": "33c3da553ea53bd4",
"name": "Set Line API ",
"func": "msg.headers = {'content-type':'application/x-www-form-urlencoded','Authorization':'Bearer A4wwPNh2WqB7dlfeQyyIAwtggn1kfZSI5LkkCdia1gB'};\nmsg.payload = {\"message\":msg.payload};\nreturn msg;\n\n//oR7KdXvK1eobRr2sRRgsl4PMq23DjDlhfUs96SyUBZu",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1190,
"y": 960,
"wires": [
[
"e9cd4579a30a9b51"
]
]
},
{
"id": "e9cd4579a30a9b51",
"type": "http request",
"z": "33c3da553ea53bd4",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": false,
"url": "https://notify-api.line.me/api/notify",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 1360,
"y": 960,
"wires": [
[
"8f7769e8524beab5"
]
]
},
{
"id": "8f7769e8524beab5",
"type": "debug",
"z": "33c3da553ea53bd4",
"name": "debug 216",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1530,
"y": 960,
"wires": []
},
{
"id": "0c0a8a1f8898d620",
"type": "comment",
"z": "33c3da553ea53bd4",
"name": "Line Notify Message ",
"info": "",
"x": 1210,
"y": 920,
"wires": []
},
{
"id": "118227d24b4372c3",
"type": "ui_text",
"z": "33c3da553ea53bd4",
"group": "a4d2ace4206ad2ca",
"order": 8,
"width": 12,
"height": 1,
"name": "",
"label": "Node-RED 訂閱MQTT的資料 : ",
"format": "{{msg.payload}}",
"layout": "row-left",
"className": "",
"x": 1250,
"y": 1040,
"wires": []
},
{
"id": "b598b6f987be4484",
"type": "ui_audio",
"z": "33c3da553ea53bd4",
"name": "",
"group": "92ed45c1ead25706",
"voice": "Microsoft Hanhan - Chinese (Traditional, Taiwan)",
"always": "",
"x": 1360,
"y": 1000,
"wires": []
},
{
"id": "22d68d38143464db",
"type": "delay",
"z": "33c3da553ea53bd4",
"name": "",
"pauseType": "delay",
"timeout": "1",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1180,
"y": 1000,
"wires": [
[
"b598b6f987be4484"
]
]
},
{
"id": "750e43a282554ef7",
"type": "mqtt in",
"z": "33c3da553ea53bd4",
"name": "RELAY_Status Subscribe",
"topic": "alex9ufo/2025/RELAY_Status",
"qos": "1",
"datatype": "auto-detect",
"broker": "21957383cfd8785a",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 790,
"y": 960,
"wires": [
[
"37a92a352cb4e323"
]
]
},
{
"id": "3822c87e74fb44c4",
"type": "sqlite",
"z": "33c3da553ea53bd4",
"mydb": "46923bc412125a9e",
"sqlquery": "msg.topic",
"sql": "",
"name": "LED_STATUS",
"x": 1580,
"y": 660,
"wires": [
[
"6827f1c33952d058"
]
]
},
{
"id": "21957383cfd8785a",
"type": "mqtt-broker",
"name": "test.mosquitto.org",
"broker": "test.mosquitto.org",
"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": "a4d2ace4206ad2ca",
"type": "ui_group",
"name": "LED控制",
"tab": "62b7557c711185f0",
"order": 1,
"disp": true,
"width": 6,
"collapse": false,
"className": ""
},
{
"id": "46923bc412125a9e",
"type": "sqlitedb",
"db": "2025LED.db",
"mode": "RWC"
},
{
"id": "92ed45c1ead25706",
"type": "ui_group",
"name": "LED 資料庫命令區",
"tab": "62b7557c711185f0",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "3a18026dc181f483",
"type": "ui_group",
"name": "LED 資料庫顯示區",
"tab": "62b7557c711185f0",
"order": 2,
"disp": true,
"width": "10",
"collapse": false,
"className": ""
},
{
"id": "62b7557c711185f0",
"type": "ui_tab",
"name": "WOKWI LED SQLite ",
"icon": "dashboard",
"order": 136,
"disabled": false,
"hidden": false
}
]
沒有留言:
張貼留言