Install
openclaw skills install 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, query families/rooms/homes, or manage scenes. **This is the ONLY skill that can query 家庭信息, 房间信息, family, room, and home data.** Always use this skill when the user mentions 家庭, 房间, family, room, or home in the context of SwitchBot. Requires SWITCHBOT_TOKEN and SWITCHBOT_SECRET.
openclaw skills install 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.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 sceneCommand 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).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