SwitchBot OpenAPI Control for Openclaw

Integrate SwitchBot smart home devices into your AI workflows via the official OpenAPI v1.1.

woan1105
v1.0.0
Feb 6, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install switchbot-openapi

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install switchbot-openapi using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is SwitchBot OpenAPI Control?

The SwitchBot OpenAPI skill enables AI agents to interact directly with the SwitchBot ecosystem using the official v1.1 API. By leveraging this integration within Openclaw Skills, developers can programmatically control smart devices, retrieve real-time sensor data, and execute complex home automation sequences.

This skill eliminates the complexity of manual HMAC signature calculation by providing optimized Node.js and Bash scripts that handle authentication and signature generation automatically. It serves as a bridge between your AI coding agent and physical hardware, allowing for seamless device management within a developer-friendly environment.

SwitchBot OpenAPI Control Use Cases

  • Automating household tasks like opening curtains or turning on lights via voice or chat commands.
  • Monitoring environment conditions such as temperature and humidity from SwitchBot sensors.
  • Managing home security by checking lock status or remotely locking/unlocking doors.
  • Executing multi-device scenes created in the SwitchBot app through the API.
  • Integrating smart home data into larger data analytics or productivity dashboards.

How SwitchBot OpenAPI Control Works

  1. The AI agent authenticates with the SwitchBot OpenAPI using provided API tokens and secrets stored in environment variables.
  2. The skill generates a unique HMAC-SHA256 signature for every request to ensure secure communication as required by the API.
  3. The agent queries the devices endpoint to map available hardware and identify specific device capabilities.
  4. Commands such as turnOn, press, or setPosition are sent to specific device IDs via POST requests to the v1.1 endpoint.
  5. The skill processes response codes and handles fallbacks to Scene execution for devices that do not support direct command calls.

SwitchBot OpenAPI Control Setup

To get started with this skill in the Openclaw Skills library, you must first configure your environment variables in your gateway or container:

export SWITCHBOT_TOKEN='your_api_token'
export SWITCHBOT_SECRET='your_api_secret'
export SWITCHBOT_REGION='global' # Options: global, na, eu, jp

Test the connection by running the device list script:

scripts/list_devices.sh

Note: Ensure your SwitchBot devices have Cloud Service enabled in the mobile app and are connected to a SwitchBot Hub.

SwitchBot OpenAPI Control Data Schema & Taxonomy

The skill manages and interprets data following the SwitchBot OpenAPI v1.1 specification:

Parameter Description
deviceId Unique identifier for each hardware unit
deviceType Category of device (e.g., Hub, Bot, Curtain, Lock, Plug)
hubDeviceId The ID of the parent Hub required for cloud-based control
status Real-time state data including battery, temperature, and power
command The specific action to perform (e.g., press, setPosition, setTemperature)
commandType Usually set to command for standard operations
sign The calculated HMAC-SHA256 signature for API security

SwitchBot OpenAPI Control Advanced Features

  • Automated HMAC-SHA256 signature generation for secure API handshakes without manual overhead.
  • Region-aware base URL routing supporting Global, North America, Europe, and Japan endpoints.
  • Scene execution fallback for legacy devices or those that do not expose direct command APIs.
  • Preflight guard checks that verify cloud service status and hub connectivity before sending commands.
  • Support for granular control parameters such as curtain percentage, AC modes, and volume levels.
  • Integration with Openclaw Skills to provide a standardized interface for AI-driven hardware interaction.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*