Install
openclaw skills install @switchbot-dev/switchbot-cloudapiControl and query SwitchBot devices using the official OpenAPI (v1.1). Use when the user asks to list SwitchBot devices, get device status, send commands, qu...
openclaw skills install @switchbot-dev/switchbot-cloudapiThis skill equips the agent to operate SwitchBot devices via HTTPS requests to the official OpenAPI v1.1. It includes ready-to-run scripts and a Node CLI; use these instead of re-deriving the HMAC signature each time.
scripts/list_devices.shnode scripts/switchbot_cli.js listBasic controls:
node scripts/switchbot_cli.js listnode scripts/switchbot_cli.js status <deviceId>node scripts/switchbot_cli.js cmd <deviceId> turnOn / turnOffnode scripts/switchbot_cli.js cmd <deviceId> togglenode scripts/switchbot_cli.js cmd <deviceId> pressCurtain / Curtain 3:
node scripts/switchbot_cli.js cmd <deviceId> setPosition --pos=50
(0=open, 100=closed; CLI auto-formats to 0,ff,50)node scripts/switchbot_cli.js cmd <deviceId> pauseLock / Lock Pro / Lock Ultra / Lock Lite:
node scripts/switchbot_cli.js cmd <deviceId> lock / unlocknode scripts/switchbot_cli.js cmd <deviceId> deadboltLights (Color Bulb / Strip Light / Floor Lamp / Strip Light 3 / RGBICWW etc.):
node scripts/switchbot_cli.js cmd <deviceId> setColor --param="255:100:0"node scripts/switchbot_cli.js cmd <deviceId> setBrightness --param=80node scripts/switchbot_cli.js cmd <deviceId> setColorTemperature --param=4000Fans (Battery Circulator Fan / Circulator Fan / Standing Circulator Fan):
node scripts/switchbot_cli.js cmd <deviceId> setWindMode --param=naturalnode scripts/switchbot_cli.js cmd <deviceId> setWindSpeed --param=50node scripts/switchbot_cli.js cmd <deviceId> setNightLightMode --param=1node scripts/switchbot_cli.js cmd <deviceId> closeDelay --param=3600Robot Vacuum S1/S1 Plus/K10+/K10+ Pro:
node scripts/switchbot_cli.js cmd <deviceId> startnode scripts/switchbot_cli.js cmd <deviceId> stopnode scripts/switchbot_cli.js cmd <deviceId> docknode scripts/switchbot_cli.js cmd <deviceId> PowLevel --param=2Robot Vacuum K10+ Pro Combo / K20+ Pro / S10 / S20 / K11+:
node scripts/switchbot_cli.js cmd <deviceId> startClean --param='{"action":"sweep_mop","param":{"fanLevel":2,"waterLevel":1,"times":1}}'node scripts/switchbot_cli.js cmd <deviceId> pause / docknode scripts/switchbot_cli.js cmd <deviceId> setVolume --param=50node scripts/switchbot_cli.js cmd <deviceId> selfClean --param=1Weather Station:
node scripts/switchbot_cli.js cmd <deviceId> customQuote --param="大海啊,你好多的水啊!"
(Max 100 characters; displayed on the AI Recommendations page)node scripts/switchbot_cli.js cmd <deviceId> cancelCustom --param=defaultnode scripts/switchbot_cli.js cmd <deviceId> customPage --param="自定义页面文本"
(Max 100 characters)Blind Tilt:
node scripts/switchbot_cli.js cmd <deviceId> setPosition --param="up;60"node scripts/switchbot_cli.js cmd <deviceId> fullyOpennode scripts/switchbot_cli.js cmd <deviceId> closeUp / closeDownRoller Shade:
node scripts/switchbot_cli.js cmd <deviceId> setPosition --param=50Humidifier (original):
node scripts/switchbot_cli.js cmd <deviceId> setMode --param=autoEvaporative Humidifier / Auto-refill:
node scripts/switchbot_cli.js cmd <deviceId> setMode --param='{"mode":7,"targetHumidify":60}'node scripts/switchbot_cli.js cmd <deviceId> setChildLock --param=trueAir Purifier (VOC/PM2.5/Table):
node scripts/switchbot_cli.js cmd <deviceId> setMode --param='{"mode":2,"fanGear":2}'node scripts/switchbot_cli.js cmd <deviceId> setChildLock --param=1Smart Radiator Thermostat:
node scripts/switchbot_cli.js cmd <deviceId> setMode --param=1node scripts/switchbot_cli.js cmd <deviceId> setManualModeTemperature --param=22Relay Switch 1PM / 1 / 2PM:
node scripts/switchbot_cli.js cmd <deviceId> togglenode scripts/switchbot_cli.js cmd <deviceId> setMode --param=0node scripts/switchbot_cli.js cmd <deviceId> turnOn --param="1" (channel 1 or 2)Garage Door Opener:
node scripts/switchbot_cli.js cmd <deviceId> turnOn / turnOffVideo Doorbell:
node scripts/switchbot_cli.js cmd <deviceId> enableMotionDetection / disableMotionDetectionCandle Warmer Lamp:
node scripts/switchbot_cli.js cmd <deviceId> setBrightness --param=50AI Art Frame:
node scripts/switchbot_cli.js cmd <deviceId> next / previousnode scripts/switchbot_cli.js cmd <deviceId> uploadImage --param='{"imageUrl":"https://example.com/photo.jpg"}'node scripts/switchbot_cli.js cmd <deviceId> uploadImage --param='{"imageBase64":"<base64_string>"}'imageUrl and imageBase64 are mutually exclusive. Max 10 images; statusCode 402 = limit reached.AI MindClip (录音笔):
node scripts/switchbot_cli.js status <deviceId>node scripts/switchbot_cli.js mindclip recordings <deviceId>node scripts/switchbot_cli.js mindclip recording <recordingId>node scripts/switchbot_cli.js mindclip summary <recordingId>node scripts/switchbot_cli.js mindclip todosnode scripts/switchbot_cli.js mindclip daily <date> (e.g. 2026-06-05)node scripts/switchbot_cli.js mindclip weekly <week> (e.g. 2026-W23)node scripts/switchbot_cli.js mindclip urgent <date>Keypad / Keypad Touch / Keypad Vision / Keypad Vision Pro:
node scripts/switchbot_cli.js cmd <deviceId> createKey --param='{"name":"Guest","type":"permanent","password":"12345678"}'node scripts/switchbot_cli.js cmd <deviceId> deleteKey --param='{"id":"11"}'IR Remote - Air Conditioner:
node scripts/switchbot_cli.js cmd <deviceId> setAll --param="26,2,1,on"
(format: temperature, mode, fan speed, power state)
IR Remote - TV:
node scripts/switchbot_cli.js cmd <deviceId> SetChannel --param=5node scripts/switchbot_cli.js cmd <deviceId> volumeAdd / volumeSubIR Remote - Others (DIY):
node scripts/switchbot_cli.js cmd <deviceId> <buttonName> --commandType=customizeScenes (fallback):
node scripts/switchbot_cli.js scenesnode scripts/switchbot_cli.js scene <sceneId>Base URL: https://api.switch-bot.com
Path prefix: /v1.1
Daily limit: 10,000 API calls
Headers (all required):
<SWITCHBOT_TOKEN>token + t + nonce, secret), Base64-encodedKey endpoints:
GET /v1.1/devices — list all devicesGET /v1.1/devices/{deviceId}/status — device statusPOST /v1.1/devices/{deviceId}/commands — send commandGET /v1.1/scenes — list scenesPOST /v1.1/scenes/{sceneId}/execute — execute sceneGET /v1.1/mindclip/recordings?deviceID=xxx&pageNum=1&pageSize=20 — list recordingsGET /v1.1/mindclip/recordings/{recordingId} — single recording detailGET /v1.1/mindclip/summaries/{recordingId} — transcription + AI summaryGET /v1.1/mindclip/todos?completedNum=1&pageNum=1&pageSize=20 — todo listGET /v1.1/mindclip/assistant/daily?date=YYYY-MM-DD — daily memoryGET /v1.1/mindclip/assistant/weekly?week=YYYY-Wxx — weekly summaryGET /v1.1/mindclip/assistant/urgent-todos?date=YYYY-MM-DD — urgent todosCommand body format:
{
"command": "<commandName>",
"parameter": "<string|object>",
"commandType": "command"
}
For IR "Others" (DIY) devices, use "commandType": "customize".
The OpenAPI does not have a dedicated families/rooms endpoint. Instead, extract this info from the device list response (GET /v1.1/devices).
Each device in deviceList includes:
familyName — the family/home it belongs toroomID — room identifier ("defaultRoom" means no specific room assigned)roomName — room display name (null if default room)When the user asks about families, homes, or rooms:
node scripts/switchbot_cli.js list to get the full device listfamilyName to get all familiesroomName (treat null/"defaultRoom" as "未分配房间")Example output format:
🏠 Home
└─ 未分配房间: 设备A, 设备B, ...
└─ 客厅: 设备C, ...
🏠 测试
└─ 未分配房间: 设备D, ...
Note: IR remote devices (infraredRemoteList) only have hubDeviceId, no familyName/roomName. To determine their family, match their hubDeviceId to a device in deviceList and use that device's family.
setAll is supported (not separate setMode/setTemp).deviceType: AI MindClip
GET /v1.1/devices/{deviceId}/status returns:
{
"statusCode": 100,
"message": "success",
"body": {
"deviceId": "AABBCCDDEEFF",
"deviceType": "AI MindClip",
"battery": 87,
"chargingStatus": 1,
"recordingStatus": 0,
"uploadStatus": 1,
"hasUntransferredFiles": true
}
}
Fields:
battery — 0-100chargingStatus — 0=未充电, 1=充电中recordingStatus — 0=未录音, 1=录音中uploadStatus — 0=未上传, 1=上传中hasUntransferredFiles — 是否有未传输文件不支持(no OpenAPI commands)
GET /v1.1/mindclip/recordings?deviceID={deviceId}&pageNum=1&pageSize=20
Response:
{
"statusCode": 100,
"message": "success",
"body": {
"total": 1,
"pageNum": 1,
"pageSize": 20,
"pages": 1,
"list": [
{
"id": "5f3a1c2e9b7d",
"displayName": "Team sync",
"recordingLen": 1820,
"fileSize": 2931456,
"deviceID": "AABBCCDDEEFF",
"transcribeStatus": 2,
"createdTime": 1716000000000,
"folderID": 3,
"emoji": "📁",
"isSystem": false
}
]
}
}
Fields:
id — recording unique IDdisplayName — user-facing namerecordingLen — duration in secondsfileSize — bytestranscribeStatus — 0=未转写, 1=转写中, 2=转写成功, 3=转写失败, 4=超时, 5=语音转写失败createdTime — 13-digit timestampfolderID — folder groupingemoji — folder iconisSystem — system folder flagGET /v1.1/mindclip/recordings/{recordingId}
Response: same structure as list item (single object in body).
GET /v1.1/mindclip/summaries/{recordingId}
Response:
{
"statusCode": 100,
"message": "success",
"body": {
"fileID": "5f3a1c2e9b7d",
"transcribeStatus": 2,
"transcribeResult": "Alice: Let's review the release plan...\nBob: ...",
"aiSummaryResult": "Key decisions: ship v2 next week; assign QA to Alice.",
"aiTemplateResult": "## Meeting Notes\n- ...",
"aiAtmoResult": "Focused and collaborative",
"aiTodoList": [
{
"title": "Send meeting notes to team",
"reminderTime": 1716100000000,
"isCompleted": false,
"createdTime": 1716000000000,
"fileID": "5f3a1c2e9b7d",
"deviceID": "AABBCCDDEEFF",
"category": 1
}
],
"speakers": [
{
"speaker": "spk_1",
"speakerName": "Alice",
"lightColor": "#FFB300",
"darkColor": "#FFD54F",
"speakerConfidence": 0.92
}
]
}
}
GET /v1.1/mindclip/todos?completedNum=1&pageNum=1&pageSize=20
Query params:
completedNum — number of completed items to includepageNum / pageSize — paginationResponse:
{
"statusCode": 100,
"message": "success",
"body": {
"total": 1,
"pageNum": 1,
"pageSize": 20,
"pages": 1,
"list": [
{
"title": "Send meeting notes to team",
"reminderTime": 1716100000000,
"isCompleted": false,
"createdTime": 1716000000000,
"fileID": "5f3a1c2e9b7d",
"deviceID": "AABBCCDDEEFF",
"category": 1
}
]
}
}
GET /v1.1/mindclip/assistant/daily?date=2026-06-05
Response:
{
"statusCode": 100,
"message": "success",
"body": {
"list": [
{
"summaryDate": "2026-06-05",
"summaryContent": "Today you had 3 meetings and created 2 todos...",
"status": 1,
"timezone": "Asia/Shanghai",
"locations": [
{
"timestamp": 1717540000,
"latitude": 31.23,
"longitude": 121.47,
"placeName": "Shanghai Office",
"fileID": "5f3a1c2e9b7d"
}
]
}
]
}
}
GET /v1.1/mindclip/assistant/weekly?week=2026-W23
Response:
{
"statusCode": 100,
"message": "success",
"body": {
"summaryWeek": "2026-W23",
"summaryContent": "This week you recorded 12 sessions across 5 days...",
"status": 1,
"timezone": "Asia/Shanghai"
}
}
GET /v1.1/mindclip/assistant/urgent-todos?date=2026-06-04
Response:
{
"statusCode": 100,
"message": "success",
"body": {
"summaryDate": "2026-06-04",
"todos": [
{
"title": "Send meeting notes to team",
"reminderTime": 1717100000000,
"rank": 1,
"fileID": "5f3a1c2e9b7d",
"isCompleted": false,
"category": 1
}
]
}
}
AI MindClip 支持的 webhook 事件:
{
"eventType": "changeReport",
"eventVersion": "1",
"context": {
"deviceType": "AI MindClip",
"deviceMac": "AIPINNOTE-DEVICE-001",
"timeOfSample": 1749542100000,
"chargeUploadCompleted": {
"fileID": "20260610143022001",
"fileName": "2026-06-10 14:30",
"status": 1,
"timestamp": 1749542100000
}
}
}
{
"eventType": "changeReport",
"eventVersion": "1",
"context": {
"deviceType": "AI MindClip",
"deviceMac": "AIPINNOTE-DEVICE-001",
"timeOfSample": 1749542400000,
"transcription": {
"fileID": "20260610143022001",
"status": 1,
"timestamp": 1749542400000
}
}
}
transcription.status: 0=未转写, 1=转写中, 2=转写成功, 3=转写失败, 4=超时, 5=语音转写失败
{
"eventType": "changeReport",
"eventVersion": "1",
"context": {
"deviceType": "AI MindClip",
"deviceMac": "AIPINNOTE-DEVICE-001",
"timeOfSample": 1749556800000,
"dailySummary": 1749556800
}
}
{
"eventType": "changeReport",
"eventVersion": "1",
"context": {
"deviceType": "AI MindClip",
"deviceMac": "AIPINNOTE-DEVICE-001",
"timeOfSample": 1749816000000,
"weeklySummary": 1749816000
}
}
scripts/switchbot_cli.js — Node CLI (list/status/cmd/scenes)scripts/list_devices.sh — curl: list devicesscripts/get_status.sh — curl: get statusscripts/send_command.sh — curl: send commandscripts/list_scenes.sh — curl: list scenesscripts/execute_scene.sh — curl: execute scenereferences/commands.md — complete command reference per device typereferences/examples.md — usage examples