Token导航 LogoToken导航

Agent Skill · 开发

switchbot-cloudapi(交换机云 API)

switchbot-cloudapi 用于辅助部署、云资源、容器和基础设施运维,适合在 OpenClaw 中需要检查配置、整理部署步骤或排查环境问题时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

switchbot-cloudapi 是开发类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 812。

总安装 56,337周安装 2,279GitHub Stars 1下载 17,685核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.4

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:switchbot-cloudapi(交换机云 API)
来源仓库:https://github.com/switchbot-dev/switchbot-cloudapi
安装命令:
openclaw skills install switchbot-cloudapi
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install switchbot-cloudapi

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

switchbot-cloudapi 调用官方 OpenAPI 控制智能家居设备状态。适合在 OpenClaw 中执行 IoT 设备批量操作与状态巡检。通过 clawhub 安装,需配置账户凭证与设备绑定信息。使用前应检查网络延迟与 OAuth 令牌刷新策略。推荐给智能家居系统集成与维护工程师。

switchbot-cloudapi 属于开发类 Skill,可作为该场景下的辅助能力补充。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install switchbot-cloudapi;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

switchbot-cloudapi 怎么安装?

在终端执行 openclaw skills install switchbot-cloudapi。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

switchbot-cloudapi 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

switchbot-cloudapi 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

switchbot-cloudapi 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

switchbot-cloudapi 用的人多吗?

公开数据是累计安装 56,337 次,近一周安装 2,279 次,下载 17,685 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

switchbot-cloudapi 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
switchbot-cloudapi

交换机云 API · 本页

56,3371接触敏感数据MIT-0通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
switchbot-openapi
description
Control and query SwitchBot devices using the official OpenAPI (v1.1). Use when the user asks to list SwitchBot devices, get device status, send commands, or query families/rooms/homes. Requires SWITCHBOT_TOKEN and SWITCHBOT_SECRET.
metadata
openclaw
requires
env
bins

SwitchBot OpenAPI Skill

This 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.

Quick Start (Operator)

1) Set environment variables:

  • SWITCHBOT_TOKEN: your OpenAPI token
  • SWITCHBOT_SECRET: your OpenAPI secret

2) Test (list devices):

  • Bash: scripts/list_devices.sh
  • Node: node scripts/switchbot_cli.js list

3) Common tasks:

Basic controls:

  • List devices: node scripts/switchbot_cli.js list
  • Get status: node scripts/switchbot_cli.js status <deviceId>
  • Turn on/off: node scripts/switchbot_cli.js cmd <deviceId> turnOn / turnOff
  • Toggle: node scripts/switchbot_cli.js cmd <deviceId> toggle
  • Press (Bot): node scripts/switchbot_cli.js cmd <deviceId> press

Curtain / Curtain 3:

  • Set position: node scripts/switchbot_cli.js cmd <deviceId> setPosition --pos=50

(0=open, 100=closed; CLI auto-formats to 0,ff,50)

  • Pause: node scripts/switchbot_cli.js cmd <deviceId> pause

Lock / Lock Pro / Lock Ultra / Lock Lite:

  • Lock/Unlock: node scripts/switchbot_cli.js cmd <deviceId> lock / unlock
  • Deadbolt: node scripts/switchbot_cli.js cmd <deviceId> deadbolt

Lights (Color Bulb / Strip Light / Floor Lamp / Strip Light 3 / RGBICWW etc.):

  • Set color: node scripts/switchbot_cli.js cmd <deviceId> setColor --param="255:100:0"
  • Set brightness: node scripts/switchbot_cli.js cmd <deviceId> setBrightness --param=80
  • Set color temp: node scripts/switchbot_cli.js cmd <deviceId> setColorTemperature --param=4000

Fans (Battery Circulator Fan / Circulator Fan / Standing Circulator Fan):

  • Wind mode: node scripts/switchbot_cli.js cmd <deviceId> setWindMode --param=natural
  • Wind speed: node scripts/switchbot_cli.js cmd <deviceId> setWindSpeed --param=50
  • Night light: node scripts/switchbot_cli.js cmd <deviceId> setNightLightMode --param=1
  • Auto-off timer: node scripts/switchbot_cli.js cmd <deviceId> closeDelay --param=3600

Robot Vacuum S1/S1 Plus/K10+/K10+ Pro:

  • Start: node scripts/switchbot_cli.js cmd <deviceId> start
  • Stop: node scripts/switchbot_cli.js cmd <deviceId> stop
  • Dock: node scripts/switchbot_cli.js cmd <deviceId> dock
  • Suction: node scripts/switchbot_cli.js cmd <deviceId> PowLevel --param=2

Robot Vacuum K10+ Pro Combo / K20+ Pro / S10 / S20 / K11+:

  • Start clean: node scripts/switchbot_cli.js cmd <deviceId> startClean --param='{"action":"sweep_mop","param":{"fanLevel":2,"waterLevel":1,"times":1}}'
  • Pause/Dock: node scripts/switchbot_cli.js cmd <deviceId> pause / dock
  • Volume: node scripts/switchbot_cli.js cmd <deviceId> setVolume --param=50
  • Self clean (S10/S20): node scripts/switchbot_cli.js cmd <deviceId> selfClean --param=1

Weather Station:

  • Set custom quote: node scripts/switchbot_cli.js cmd <deviceId> customQuote --param="大海啊,你好多的水啊!"

(Max 100 characters; displayed on the AI Recommendations page)

  • Remove custom quote: node scripts/switchbot_cli.js cmd <deviceId> cancelCustom --param=default

Blind Tilt:

  • Set position: node scripts/switchbot_cli.js cmd <deviceId> setPosition --param="up;60"
  • Fully open: node scripts/switchbot_cli.js cmd <deviceId> fullyOpen
  • Close: node scripts/switchbot_cli.js cmd <deviceId> closeUp / closeDown

Roller Shade:

  • Set position: node scripts/switchbot_cli.js cmd <deviceId> setPosition --param=50

Humidifier (original):

  • Set mode: node scripts/switchbot_cli.js cmd <deviceId> setMode --param=auto

Evaporative Humidifier / Auto-refill:

  • Set mode: node scripts/switchbot_cli.js cmd <deviceId> setMode --param='{"mode":7,"targetHumidify":60}'
  • Child lock: node scripts/switchbot_cli.js cmd <deviceId> setChildLock --param=true

Air Purifier (VOC/PM2.5/Table):

  • Set mode: node scripts/switchbot_cli.js cmd <deviceId> setMode --param='{"mode":2,"fanGear":2}'
  • Child lock: node scripts/switchbot_cli.js cmd <deviceId> setChildLock --param=1

Smart Radiator Thermostat:

  • Set mode: node scripts/switchbot_cli.js cmd <deviceId> setMode --param=1
  • Set temp: node scripts/switchbot_cli.js cmd <deviceId> setManualModeTemperature --param=22

Relay Switch 1PM / 1 / 2PM:

  • Toggle: node scripts/switchbot_cli.js cmd <deviceId> toggle
  • Set mode: node scripts/switchbot_cli.js cmd <deviceId> setMode --param=0
  • 2PM channel: node scripts/switchbot_cli.js cmd <deviceId> turnOn --param="1" (channel 1 or 2)

Garage Door Opener:

  • Open/Close: node scripts/switchbot_cli.js cmd <deviceId> turnOn / turnOff

Video Doorbell:

  • Motion detection: node scripts/switchbot_cli.js cmd <deviceId> enableMotionDetection / disableMotionDetection

Candle Warmer Lamp:

  • Brightness: node scripts/switchbot_cli.js cmd <deviceId> setBrightness --param=50

AI Art Frame:

  • Next/Previous: node scripts/switchbot_cli.js cmd <deviceId> next / previous
  • Upload image (URL): node scripts/switchbot_cli.js cmd <deviceId> uploadImage --param='{"imageUrl":"https://example.com/photo.jpg"}'
  • Upload image (Base64): 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:

  • Create passcode: node scripts/switchbot_cli.js cmd <deviceId> createKey --param='{"name":"Guest","type":"permanent","password":"12345678"}'
  • Delete passcode: node scripts/switchbot_cli.js cmd <deviceId> deleteKey --param='{"id":"11"}'
  • ⚠️ Keypad commands are async — results come via webhook.

IR Remote - Air Conditioner:

  • Set all: node scripts/switchbot_cli.js cmd <deviceId> setAll --param="26,2,1,on"

(format: temperature, mode, fan speed, power state) - mode: 0/1=auto, 2=cool, 3=dry, 4=fan, 5=heat - fan: 1=auto, 2=low, 3=medium, 4=high - power: on/off

IR Remote - TV:

  • Channel: node scripts/switchbot_cli.js cmd <deviceId> SetChannel --param=5
  • Volume: node scripts/switchbot_cli.js cmd <deviceId> volumeAdd / volumeSub

IR Remote - Others (DIY):

  • Custom button: node scripts/switchbot_cli.js cmd <deviceId> <buttonName> --commandType=customize

Scenes (fallback):

  • List scenes: node scripts/switchbot_cli.js scenes
  • Execute scene: node scripts/switchbot_cli.js scene <sceneId>

API Reference

Base URL: https://api.switch-bot.com Path prefix: /v1.1 Daily limit: 10,000 API calls

Headers (all required):

  • Authorization: <SWITCHBOT_TOKEN>
  • sign: HMAC-SHA256(token + t + nonce, secret), Base64-encoded
  • t: 13-digit millisecond timestamp
  • nonce: random UUID

Key endpoints:

  • GET /v1.1/devices — list all devices
  • GET /v1.1/devices/{deviceId}/status — device status
  • POST /v1.1/devices/{deviceId}/commands — send command
  • GET /v1.1/scenes — list scenes
  • POST /v1.1/scenes/{sceneId}/execute — execute scene

Command body format:

{
  "command": "<commandName>",
  "parameter": "<string|object>",
  "commandType": "command"
}

For IR "Others" (DIY) devices, use "commandType": "customize".

Querying Families & Rooms

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 to
  • roomID — 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:

  1. Call node scripts/switchbot_cli.js list to get the full device list
  2. Group devices by familyName to get all families
  3. Within each family, group by roomName (treat null/"defaultRoom" as "未分配房间")
  4. Present the family → room → device hierarchy

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.

Agent Guidelines

  • Always use the provided CLI scripts — they handle HMAC signatures automatically.
  • The CLI runs preflight checks for BLE devices (Bot, Lock, Curtain, Blind Tilt) — requires Hub + Cloud Services enabled.
  • For IR Air Conditioner, only setAll is supported (not separate setMode/setTemp).
  • For Keypad commands (createKey/deleteKey), results are async via webhook.
  • If a command returns statusCode 160, the device may not support that command — use Scenes as fallback.
  • Never log tokens/secrets. Ask user to set them as environment variables.

Files

  • scripts/switchbot_cli.js — Node CLI (list/status/cmd/scenes)
  • scripts/list_devices.sh — curl: list devices
  • scripts/get_status.sh — curl: get status
  • scripts/send_command.sh — curl: send command
  • scripts/list_scenes.sh — curl: list scenes
  • scripts/execute_scene.sh — curl: execute scene
  • references/commands.md — complete command reference per device type
  • references/examples.md — usage examples

平台分布

OpenClaw

79%
按下载量换算13,971

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills