@linchengyu-org/switchbot-channel 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +346 -344
- package/openclaw.plugin.json +2 -2
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,345 +1,347 @@
|
|
|
1
|
-
# SwitchBot Channel for OpenClaw
|
|
2
|
-
|
|
3
|
-
> Connect your SwitchBot smart home devices to OpenClaw platform for real-time device status monitoring | 将您的 SwitchBot 智能家居设备连接到 OpenClaw 平台,实时监控设备状态变化
|
|
4
|
-
|
|
5
|
-
[](https://badge.fury.io/js/%40openclaw%2Fswitchbot-channel)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
## 🌐 Language | 语言
|
|
9
|
-
|
|
10
|
-
- [🇺🇸 English](#english)
|
|
11
|
-
- [🇨🇳 中文](#中文)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# English
|
|
16
|
-
|
|
17
|
-
## 📖 Project Overview
|
|
18
|
-
|
|
19
|
-
SwitchBot Channel is an official channel plugin for the OpenClaw platform that receives real-time SwitchBot device status changes via MQTT protocol. Whether it's contact sensors, temperature/humidity meters, or smart plugs, you can monitor device status in real-time through OpenClaw and set up intelligent notifications.
|
|
20
|
-
|
|
21
|
-
## ✨ Features
|
|
22
|
-
|
|
23
|
-
- 🔄 **Real-time Sync**: Receive device status via MQTT in real-time
|
|
24
|
-
- 🏠 **Device Compatibility**: Support for all mainstream SwitchBot devices
|
|
25
|
-
- 🔑 **Auto Authentication**: Intelligent credential management with auto-renewal
|
|
26
|
-
- 🚨 **Smart Notifications**: Send notifications only for important events to avoid interruptions
|
|
27
|
-
- 🔧 **Zero Configuration**: Out-of-the-box functionality with just SwitchBot Token and Secret
|
|
28
|
-
- 📊 **History Records**: Local storage of device status history
|
|
29
|
-
- 🛡️ **High Availability**: Auto-reconnection with automatic recovery after network interruptions
|
|
30
|
-
|
|
31
|
-
## 🚀 Quick Start
|
|
32
|
-
|
|
33
|
-
### System Requirements
|
|
34
|
-
|
|
35
|
-
- **OpenClaw**: >= 2026.1.0
|
|
36
|
-
- **Node.js**: >= 18.0.0
|
|
37
|
-
- **SwitchBot App**: Latest version
|
|
38
|
-
|
|
39
|
-
### Step 1: Install Plugin
|
|
40
|
-
|
|
41
|
-
#### NPM Installation
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
# Install plugin
|
|
45
|
-
openclaw plugins install @linchengyu-org/switchbot-channel
|
|
46
|
-
|
|
47
|
-
# Verify installation
|
|
48
|
-
openclaw plugins list
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Step 2: Get SwitchBot Credentials
|
|
52
|
-
|
|
53
|
-
1. **Open SwitchBot App**
|
|
54
|
-
2. **Enter Developer Options**:
|
|
55
|
-
- Tap "Settings" in bottom right
|
|
56
|
-
- Find and tap "Developer Options"
|
|
57
|
-
- If this option doesn't exist, ensure the App is updated to the latest version
|
|
58
|
-
|
|
59
|
-
3. **Get Credentials**:
|
|
60
|
-
- Record the **Token** (64-character string)
|
|
61
|
-
- Record the **Secret** (32-character string)
|
|
62
|
-
|
|
63
|
-
> ⚠️ **Important**: Keep your Token and Secret secure and don't share them with others
|
|
64
|
-
|
|
65
|
-
### Step 3: Configure OpenClaw
|
|
66
|
-
|
|
67
|
-
Edit OpenClaw configuration file `~/.openclaw/openclaw.json`:
|
|
68
|
-
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"plugins": {
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
- **
|
|
203
|
-
- **
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
- 记录 **
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
"
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
1
|
+
# SwitchBot Channel for OpenClaw
|
|
2
|
+
|
|
3
|
+
> Connect your SwitchBot smart home devices to OpenClaw platform for real-time device status monitoring | 将您的 SwitchBot 智能家居设备连接到 OpenClaw 平台,实时监控设备状态变化
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/%40openclaw%2Fswitchbot-channel)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## 🌐 Language | 语言
|
|
9
|
+
|
|
10
|
+
- [🇺🇸 English](#english)
|
|
11
|
+
- [🇨🇳 中文](#中文)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# English
|
|
16
|
+
|
|
17
|
+
## 📖 Project Overview
|
|
18
|
+
|
|
19
|
+
SwitchBot Channel is an official channel plugin for the OpenClaw platform that receives real-time SwitchBot device status changes via MQTT protocol. Whether it's contact sensors, temperature/humidity meters, or smart plugs, you can monitor device status in real-time through OpenClaw and set up intelligent notifications.
|
|
20
|
+
|
|
21
|
+
## ✨ Features
|
|
22
|
+
|
|
23
|
+
- 🔄 **Real-time Sync**: Receive device status via MQTT in real-time
|
|
24
|
+
- 🏠 **Device Compatibility**: Support for all mainstream SwitchBot devices
|
|
25
|
+
- 🔑 **Auto Authentication**: Intelligent credential management with auto-renewal
|
|
26
|
+
- 🚨 **Smart Notifications**: Send notifications only for important events to avoid interruptions
|
|
27
|
+
- 🔧 **Zero Configuration**: Out-of-the-box functionality with just SwitchBot Token and Secret
|
|
28
|
+
- 📊 **History Records**: Local storage of device status history
|
|
29
|
+
- 🛡️ **High Availability**: Auto-reconnection with automatic recovery after network interruptions
|
|
30
|
+
|
|
31
|
+
## 🚀 Quick Start
|
|
32
|
+
|
|
33
|
+
### System Requirements
|
|
34
|
+
|
|
35
|
+
- **OpenClaw**: >= 2026.1.0
|
|
36
|
+
- **Node.js**: >= 18.0.0
|
|
37
|
+
- **SwitchBot App**: Latest version
|
|
38
|
+
|
|
39
|
+
### Step 1: Install Plugin
|
|
40
|
+
|
|
41
|
+
#### NPM Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Install plugin
|
|
45
|
+
openclaw plugins install @linchengyu-org/switchbot-channel
|
|
46
|
+
|
|
47
|
+
# Verify installation
|
|
48
|
+
openclaw plugins list
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 2: Get SwitchBot Credentials
|
|
52
|
+
|
|
53
|
+
1. **Open SwitchBot App**
|
|
54
|
+
2. **Enter Developer Options**:
|
|
55
|
+
- Tap "Settings" in bottom right
|
|
56
|
+
- Find and tap "Developer Options"
|
|
57
|
+
- If this option doesn't exist, ensure the App is updated to the latest version
|
|
58
|
+
|
|
59
|
+
3. **Get Credentials**:
|
|
60
|
+
- Record the **Token** (64-character string)
|
|
61
|
+
- Record the **Secret** (32-character string)
|
|
62
|
+
|
|
63
|
+
> ⚠️ **Important**: Keep your Token and Secret secure and don't share them with others
|
|
64
|
+
|
|
65
|
+
### Step 3: Configure OpenClaw
|
|
66
|
+
|
|
67
|
+
Edit OpenClaw configuration file `~/.openclaw/openclaw.json`:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"plugins": {
|
|
72
|
+
"switchbot": {
|
|
73
|
+
"enabled": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"channels": {
|
|
77
|
+
"switchbot": {
|
|
78
|
+
"enabled": true,
|
|
79
|
+
"token": "your_switchbot_token_here",
|
|
80
|
+
"secret": "your_switchbot_secret_here"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 4: Start Service
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Restart OpenClaw Gateway
|
|
90
|
+
openclaw gateway restart
|
|
91
|
+
|
|
92
|
+
# Check plugin status
|
|
93
|
+
openclaw status
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## ⚙️ Configuration Details
|
|
97
|
+
|
|
98
|
+
### Basic Configuration
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"channels": {
|
|
103
|
+
"switchbot": {
|
|
104
|
+
"enabled": true,
|
|
105
|
+
"token": "xxxx",
|
|
106
|
+
"secret": "xxxx"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 📱 Usage Guide
|
|
113
|
+
|
|
114
|
+
### Device Status Monitoring
|
|
115
|
+
|
|
116
|
+
After the plugin starts, it will automatically receive status changes from all devices. You can view them using:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# View device status
|
|
120
|
+
openclaw devices list switchbot
|
|
121
|
+
|
|
122
|
+
# View specific device
|
|
123
|
+
openclaw devices show <device_id>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 🔍 Troubleshooting
|
|
127
|
+
|
|
128
|
+
### Common Issues
|
|
129
|
+
|
|
130
|
+
#### Q: Plugin fails to start
|
|
131
|
+
**A**: Check configuration
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Check configuration syntax
|
|
135
|
+
openclaw config validate
|
|
136
|
+
|
|
137
|
+
# View detailed errors
|
|
138
|
+
openclaw gateway logs --follow
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Debug Mode
|
|
142
|
+
|
|
143
|
+
Enable detailed logging for troubleshooting:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"logging": {
|
|
148
|
+
"level": "debug",
|
|
149
|
+
"channels": {
|
|
150
|
+
"switchbot": "debug"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
View logs:
|
|
157
|
+
```bash
|
|
158
|
+
# View real-time logs
|
|
159
|
+
tail -f ~/.openclaw/logs/gateway.log | grep "SwitchBot"
|
|
160
|
+
|
|
161
|
+
# View error logs
|
|
162
|
+
openclaw gateway logs --level error
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Reset Plugin
|
|
166
|
+
|
|
167
|
+
If you encounter serious issues, you can reset the plugin:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Stop service
|
|
171
|
+
openclaw gateway stop
|
|
172
|
+
|
|
173
|
+
# Clear plugin cache
|
|
174
|
+
rm -rf ~/.openclaw/cache/plugins/switchbot
|
|
175
|
+
|
|
176
|
+
# Restart
|
|
177
|
+
openclaw gateway start
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
# 中文
|
|
183
|
+
|
|
184
|
+
## 📖 项目简介
|
|
185
|
+
|
|
186
|
+
SwitchBot Channel 是 OpenClaw 平台的官方渠道插件,通过 MQTT 协议实时接收 SwitchBot 设备状态变化。无论是门窗传感器、温湿度计还是智能插座,您都可以在 OpenClaw 中实时了解设备状态,并设置智能通知。
|
|
187
|
+
|
|
188
|
+
## ✨ 功能特性
|
|
189
|
+
|
|
190
|
+
- 🔄 **实时同步**:通过 MQTT 实时接收设备状态
|
|
191
|
+
- 🏠 **设备兼容**:支持所有主流 SwitchBot 设备
|
|
192
|
+
- 🔑 **自动认证**:智能管理凭证,自动续期
|
|
193
|
+
- 🚨 **智能通知**:仅在重要事件时发送通知,避免打扰
|
|
194
|
+
- 🔧 **零配置**:开箱即用,只需 SwitchBot Token 和 Secret
|
|
195
|
+
- 📊 **历史记录**:本地存储设备状态历史
|
|
196
|
+
- 🛡️ **高可用**:自动重连,网络中断后自动恢复
|
|
197
|
+
|
|
198
|
+
## 🚀 快速开始
|
|
199
|
+
|
|
200
|
+
### 系统要求
|
|
201
|
+
|
|
202
|
+
- **OpenClaw**: >= 2026.1.0
|
|
203
|
+
- **Node.js**: >= 18.0.0
|
|
204
|
+
- **SwitchBot App**: 最新版本
|
|
205
|
+
|
|
206
|
+
### 第一步:安装插件
|
|
207
|
+
|
|
208
|
+
#### NPM 安装
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# 安装插件
|
|
212
|
+
openclaw plugins install @linchengyu-org/switchbot-channel
|
|
213
|
+
|
|
214
|
+
# 验证安装
|
|
215
|
+
openclaw plugins list
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 第二步:获取 SwitchBot 凭证
|
|
219
|
+
|
|
220
|
+
1. **打开 SwitchBot App**
|
|
221
|
+
2. **进入开发者选项**:
|
|
222
|
+
- 点击右下角 "设置"
|
|
223
|
+
- 找到并点击 "开发者选项"
|
|
224
|
+
- 如果没有此选项,请确保 App 为最新版本
|
|
225
|
+
|
|
226
|
+
3. **获取凭证**:
|
|
227
|
+
- 记录 **Token** (64位字符串)
|
|
228
|
+
- 记录 **Secret** (32位字符串)
|
|
229
|
+
|
|
230
|
+
> ⚠️ **重要提示**:请妥善保管您的 Token 和 Secret,不要泄露给他人
|
|
231
|
+
|
|
232
|
+
### 第三步:配置 OpenClaw
|
|
233
|
+
|
|
234
|
+
编辑 OpenClaw 配置文件 `~/.openclaw/openclaw.json`:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"plugins": {
|
|
239
|
+
"switchbot": {
|
|
240
|
+
"enabled": true
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"channels": {
|
|
244
|
+
"switchbot": {
|
|
245
|
+
"enabled": true,
|
|
246
|
+
"token": "your_switchbot_token_here",
|
|
247
|
+
"secret": "your_switchbot_secret_here"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 第四步:启动服务
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# 重启 OpenClaw Gateway
|
|
257
|
+
openclaw gateway restart
|
|
258
|
+
|
|
259
|
+
# 检查插件状态
|
|
260
|
+
openclaw status
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## ⚙️ 配置详解
|
|
264
|
+
|
|
265
|
+
### 基本配置
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"channels": {
|
|
270
|
+
"switchbot": {
|
|
271
|
+
"enabled": true,
|
|
272
|
+
"token": "xxxx",
|
|
273
|
+
"secret": "xxxx"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## 📱 使用指南
|
|
280
|
+
|
|
281
|
+
### 设备状态监控
|
|
282
|
+
|
|
283
|
+
插件启动后会自动接收所有设备的状态变化,您可以通过以下方式查看:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# 查看设备状态
|
|
287
|
+
openclaw devices list switchbot
|
|
288
|
+
|
|
289
|
+
# 查看具体设备
|
|
290
|
+
openclaw devices show <device_id>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## 🔍 故障排除
|
|
294
|
+
|
|
295
|
+
### 常见问题
|
|
296
|
+
|
|
297
|
+
#### Q: 插件无法启动
|
|
298
|
+
**A**: 检查配置
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# 检查配置语法
|
|
302
|
+
openclaw config validate
|
|
303
|
+
|
|
304
|
+
# 查看详细错误
|
|
305
|
+
openclaw gateway logs --follow
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### 调试模式
|
|
309
|
+
|
|
310
|
+
启用详细日志进行问题诊断:
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"logging": {
|
|
315
|
+
"level": "debug",
|
|
316
|
+
"channels": {
|
|
317
|
+
"switchbot": "debug"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
查看日志:
|
|
324
|
+
```bash
|
|
325
|
+
# 实时查看日志
|
|
326
|
+
tail -f ~/.openclaw/logs/gateway.log | grep "SwitchBot"
|
|
327
|
+
|
|
328
|
+
# 查看错误日志
|
|
329
|
+
openclaw gateway logs --level error
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### 重置插件
|
|
333
|
+
|
|
334
|
+
如果遇到严重问题,可以重置插件:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
# 停止服务
|
|
338
|
+
openclaw gateway stop
|
|
339
|
+
|
|
340
|
+
# 清理插件缓存
|
|
341
|
+
rm -rf ~/.openclaw/cache/plugins/switchbot
|
|
342
|
+
|
|
343
|
+
# 重新启动
|
|
344
|
+
openclaw gateway start
|
|
345
|
+
```
|
|
346
|
+
|
|
345
347
|
**Made with ❤️ by the SwitchBot Team**
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "switchbot-channel",
|
|
3
3
|
"channels": ["switchbot"],
|
|
4
4
|
"name": "SwitchBot",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"description": "SwitchBot channel plugin for OpenClaw — real-time device status",
|
|
7
7
|
"author": "SwitchBot Team",
|
|
8
8
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/SwitchBot/openclaw-channel"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=20.0.0",
|
|
18
18
|
"openclaw": ">=2026.1.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linchengyu-org/switchbot-channel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "SwitchBot channel plugin for OpenClaw — real-time device status via AWS IoT Core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/jest": "^29.0.0",
|
|
49
|
-
"@types/node": "^
|
|
49
|
+
"@types/node": "^20.0.0",
|
|
50
50
|
"jest": "^29.0.0",
|
|
51
51
|
"ts-jest": "^29.0.0",
|
|
52
52
|
"typescript": "^5.0.0"
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
],
|
|
62
62
|
"author": "SwitchBot Team",
|
|
63
63
|
"license": "MIT",
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=20.x"
|
|
66
|
+
},
|
|
64
67
|
"files": [
|
|
65
68
|
"dist/",
|
|
66
69
|
"README.md",
|