switchbot
Skill2 starsChanged 9 months agoMITView on GitHub
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.
- Reads credentials
In this repository14 other files it gives its agents.
- BaseMailSkill
- basename-agentSkill
- base-walletSkill
- daily-voice-quoteSkill
- ethermailSkill
- heygenSkill
- ia-presenterSkill
- moltbookSkill
- NadMailSkill
- NadName AgentSkill
- nad-walletSkill
- podcast-summarizerSkill
- virtuals-protocol-acpSkill
- walletconnect-agentSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Ask your human to:
- Distinctive: line 40
Run the discovery script to find all devices:
- Distinctive: line 48
After discovery, note your device IDs in TOOLS.md for quick reference:
- Distinctive: line 124
First interaction: If no credentials exist, guide the human through setup
- Distinctive: line 125
Device aliases: Create friendly names in TOOLS.md (e.g., "living room" → device ID)
- Very specific: line 127
Status checks: Use status command before reporting sensor readings
- Distinctive: line 128
Error recovery: If device is offline (151), suggest checking Hub connection
- Distinctive: line 133
Never log or display the token/secret
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- Open SwitchBot App on their phone
- Go to Profile (bottom right)
- Tap Preferences (or Settings)
- Find About → Developer Options
- Copy Token and Secret Key
2. Store Credentials Securely
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.json3. Discover Devices
Run the discovery script to find all devices:
python3 <skill_path>/scripts/switchbot.py list4. Update Your TOOLS.md
After discovery, note your device IDs in TOOLS.md for quick reference:
## SwitchBot Devices
| Device | ID | Type |
|--------|-----|------|
| Living Room Curtain | ABC123 | Curtain3 |
| Bedroom Light | DEF456 | Plug Mini |Usage
List All Devices
python3 <skill_path>/scripts/switchbot.py listCurtain Control
# 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> 50Plug/Light Control
python3 <skill_path>/scripts/switchbot.py plug <device_id> on
python3 <skill_path>/scripts/switchbot.py plug <device_id> offCheck Sensor Status
python3 <skill_path>/scripts/switchbot.py status <device_id>Generic Command
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
- First interaction: If no credentials exist, guide the human through setup
- Device aliases: Create friendly names in TOOLS.md (e.g., "living room" → device ID)
- Batch operations: Multiple devices can be controlled in sequence
- Status checks: Use
statuscommand before reporting sensor readings - 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.com
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

