SwitchBot device control and status nodes for Node-RED
npm install node-red-contrib-switchbot-openapi

SwitchBot device control and status nodes for Node-RED.
- 📊 SwitchBot Status - Get device status (temperature, humidity, CO2, motion detection, etc.)
- 🎮 SwitchBot Command - Send commands to devices (turn on/off, set temperature, etc.)
- 🔐 Shared Credentials - Configure API credentials once, use across all nodes
- 📋 Device Picker - Select devices from a dropdown list (no manual ID entry needed)
- 🔄 Dynamic Commands - Command options change based on selected device type
1. Open Node-RED
2. Go to Menu → Manage palette → Install
3. Search for node-red-contrib-switchbot-openapi
4. Click Install
``bash`
cd ~/.node-red
npm install node-red-contrib-switchbot-openapi
Then restart Node-RED.
1. Open SwitchBot app on your phone
2. Go to Profile → Preferences
3. Tap App Version 10 times to enable Developer Options
4. Go to Developer Options
5. Copy your Token and Secret Key
1. Drag any SwitchBot node to your flow
2. Double-click to open settings
3. Click the pencil icon next to "認証" (Authentication)
4. Enter your Token and Secret
5. Click Add then Deploy
1. Click the 🔄 button to fetch your device list
2. Select a device from the dropdown
3. For SwitchBot Command: available commands will appear based on device type
``
[Inject (5min interval)] → [SwitchBot Status] → [Debug]
``
[Inject] → [SwitchBot Command (setAll)] → [Debug]
```
[Inject (30s interval)] → [SwitchBot Status] → [Switch (msg.payload.detected)] → [Your Action]
SwitchBot API has a limit of 10,000 requests per day. Plan your polling intervals accordingly:
| Interval | Requests/Day (1 device) |
|----------|------------------------|
| 1 min | 1,440 |
| 5 min | 288 |
| 15 min | 96 |
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.