switchbot
Control SwitchBot smart home devices (curtains, plugs, lights, locks, etc.) via SwitchBot Cloud API. Use when user asks to open/close curtains, turn on/off lights/plugs, check temperature/humidity, or control any SwitchBot device.
Best use case
switchbot is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Control SwitchBot smart home devices (curtains, plugs, lights, locks, etc.) via SwitchBot Cloud API. Use when user asks to open/close curtains, turn on/off lights/plugs, check temperature/humidity, or control any SwitchBot device.
Teams using switchbot should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/switchbot/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How switchbot Compares
| Feature / Agent | switchbot | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Control SwitchBot smart home devices (curtains, plugs, lights, locks, etc.) via SwitchBot Cloud API. Use when user asks to open/close curtains, turn on/off lights/plugs, check temperature/humidity, or control any SwitchBot device.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# SwitchBot Smart Home Control
Control SwitchBot devices through the Cloud API v1.1.
## First-Time Setup
**Guide your human through these steps:**
### 1. Get API Credentials
Ask your human to:
1. Open **SwitchBot App** on their phone
2. Go to **Profile** (bottom right)
3. Tap **Preferences** (or Settings)
4. Find **About** → **Developer Options**
5. Copy **Token** and **Secret Key**
### 2. Store Credentials Securely
```bash
mkdir -p ~/.config/switchbot
chmod 700 ~/.config/switchbot
cat > ~/.config/switchbot/credentials.json << 'EOF'
{
"token": "YOUR_TOKEN_HERE",
"secret": "YOUR_SECRET_HERE"
}
EOF
chmod 600 ~/.config/switchbot/credentials.json
```
### 3. Discover Devices
Run the discovery script to find all devices:
```bash
python3 <skill_path>/scripts/switchbot.py list
```
### 4. Update Your TOOLS.md
After discovery, note your device IDs in TOOLS.md for quick reference:
```markdown
## SwitchBot Devices
| Device | ID | Type |
|--------|-----|------|
| Living Room Curtain | ABC123 | Curtain3 |
| Bedroom Light | DEF456 | Plug Mini |
```
## Usage
### List All Devices
```bash
python3 <skill_path>/scripts/switchbot.py list
```
### Curtain Control
```bash
# Open curtain (position 0 = fully open)
python3 <skill_path>/scripts/switchbot.py curtain <device_id> open
# Close curtain (position 100 = fully closed)
python3 <skill_path>/scripts/switchbot.py curtain <device_id> close
# Set specific position (0-100)
python3 <skill_path>/scripts/switchbot.py curtain <device_id> 50
```
### Plug/Light Control
```bash
python3 <skill_path>/scripts/switchbot.py plug <device_id> on
python3 <skill_path>/scripts/switchbot.py plug <device_id> off
```
### Check Sensor Status
```bash
python3 <skill_path>/scripts/switchbot.py status <device_id>
```
### Generic Command
```bash
python3 <skill_path>/scripts/switchbot.py command <device_id> <command> [parameter]
```
## Supported Devices
| Device Type | Commands |
|-------------|----------|
| Curtain / Curtain3 | `open`, `close`, `setPosition` |
| Plug Mini / Plug | `turnOn`, `turnOff`, `toggle` |
| Bot | `press`, `turnOn`, `turnOff` |
| Light / Strip Light | `turnOn`, `turnOff`, `setBrightness`, `setColor` |
| Lock | `lock`, `unlock` |
| Humidifier | `turnOn`, `turnOff`, `setMode` |
| Meter / MeterPlus | (read-only: temperature, humidity) |
| Hub / Hub Mini / Hub 2 | (gateway only) |
## Error Handling
| Status Code | Meaning |
|-------------|---------|
| 100 | Success |
| 151 | Device offline |
| 152 | Command not supported |
| 160 | Unknown command |
| 161 | Invalid parameters |
| 190 | Internal error |
## Tips for Agents
1. **First interaction**: If no credentials exist, guide the human through setup
2. **Device aliases**: Create friendly names in TOOLS.md (e.g., "living room" → device ID)
3. **Batch operations**: Multiple devices can be controlled in sequence
4. **Status checks**: Use `status` command before reporting sensor readings
5. **Error recovery**: If device is offline (151), suggest checking Hub connection
## Security Notes
- Credentials file should be chmod 600
- Never log or display the token/secret
- API calls are made over HTTPS to api.switch-bot.comRelated Skills
paylock
Non-custodial SOL escrow for AI agent deals.
agent-reputation
summary: Cross-platform AI agent reputation checker with trust scoring and PayLock escrow recommendations.
Telecom Agent Skill
Turn your AI Agent into a Telecom Operator. Bulk calling, ChatOps, and Field Monitoring.
OpenClaw-Finnhub
OpenClaw skill for real-time stock quote, and financials via Finnhub API.
```markdown
# OpenClaw-Last.fm
security-operator
Runtime security guardrails for OpenClaw agents.
operator-humanizer
Transform AI-generated text into authentic human writing.
kit-email-operator
**AI-powered email marketing for Kit (ConvertKit)**.
agora
Trade prediction markets on Agora — the prediction market exclusively for AI agents. Register, browse markets, trade YES/NO, create markets, earn reputation via Brier scores.
surf-check
Surf forecast decision engine.
jinko-flight-search
Search flights and discover travel destinations using the Jinko MCP server. Provides two core capabilities: (1) Destination discovery — find where to travel based on criteria like budget, climate, or activities when the user has no specific destination in mind, and (2) Specific flight search — compare flights between two known cities/airports with flexible dates, cabin classes, and budget filters. Use this skill when the user wants to: search for flights, find cheap flights, discover travel destinations, compare flight prices, plan a trip, find deals from a specific city, or explore where to go. Triggers on any flight-booking, travel-planning, or destination-discovery request. Requires the Jinko MCP server connected at https://mcp.gojinko.com.
mlx-whisper
Local speech-to-text with MLX Whisper (Apple Silicon optimized, no API key).