Switchbot_utility
Python Switchbot Utilities using Switchbot API.
Installing
pip install switchbot-utility
Getting start
Get token and secret,
- Download the SwitchBot app on App Store or Google Play Store
- Register a SwitchBot account and log in into your account
- Generate an Open Token within the app a) Go to Profile > Preference b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Copy token and secret
create settings.json file, and fill token and secret.
{
"token": "",
"secret": ""
}
Run example script.
import switchbot_utility.switchbot as sbu
switchbot = sbu.Switchbot()
switchbot.devicelist()
Scripts makes deviceList.txt. You can manipulate device using diviceId in this file.
Other Example
Get temperature from SwitchbotMeter
import switchbot_utility as sbu
meter = sbu.SwitchbotMeter("meterDeviceId")
print(meter.get_temperature())
Unlock SwitchbotLock
import switchbot_utility as sbu
lock = sbu.SwitchbotLock("lockDeviceId")
lock.unlock()
Commands reference
Supported device
| Term | Description | Tested |
|---|---|---|
| Hub | Generally referred to these devices, SwitchBot Hub Model No. SwitchBot Hub S1/SwitchBot Hub Mini Model No. W0202200/SwitchBot Hub Plus Model No. SwitchBot Hub S1 | No |
| Hub Mini | Short for SwitchBot Hub Mini Model No. W0202200 | Yes |
| Hub Plus | Short for SwitchBot Hub Plus Model No. SwitchBot Hub S1 | No |
| Hub 2 | Short for SwitchBot Hub 2 Model No. W3202100 | Yes |
| Hub 3 | Short for SwitchBot Hub 3 Model No. W7202100 | No |
| Bot | Short for SwitchBot Bot Model No. SwitchBot S1 | Yes |
| Curtain | Short for SwitchBot Curtain Model No. W0701600 | Yes |
| Plug | Short for SwitchBot Plug Model No. SP11. Currently only available in Japan | Yes |
| Meter | Short for SwitchBot Thermometer and Hygrometer Model No. SwitchBot MeterTH S1 | Yes |
| Meter Plus (JP) | Short for SwitchBot Thermometer and Hygrometer Plus (JP) Model No. W2201500 | Yes |
| Meter Plus (US) | Short for SwitchBot Thermometer and Hygrometer Plus (US) Model No. W2301500 | No |
| Outdoor Meter | Short for Indoor/Outdoor Thermo-Hygrometer Model No. W3400010 | Yes |
| Meter Pro | Short for SwitchBot Meter Pro Model No. W4900000 | No |
| Meter Pro (CO2 Monitor) | Short for SwitchBot Meter Pro (CO2 Monitor) Model No. W4900010 | Yes |
| Motion Sensor | Short for SwitchBot Motion Sensor Model No. W1101500 | No |
| Contact Sensor | Short for SwitchBot Contact Sensor Model No. W1201500 | Yes |
| Presence Sensor | Short for SwitchBot Presence Sensor Model No. W8200000 | No |
| Water Leak Detector | Short for SwitchBot Water Leak Detector Model No. W4402000 | Yes |
| Color Bulb | Short for SwitchBot Color Bulb Model No. W1401400 | Yes |
| Strip Light | Short for SwitchBot LED Strip Light Model No. W1701100 | No |
| Plug Mini (US) | Short for SwitchBot Plug Mini (US) Model No. W1901400 and W1901401 | No |
| Plug Mini (EU) | Short for SwitchBot Plug Mini (EU) Model No. W7732300 | No |
| Plug Mini (JP) | Short for SwitchBot Plug Mini (JP) Model No. W2001400 and W2001401 | Yes |
| Lock | Short for SwitchBot Lock Model No. W1601700 | Yes |
| Lock Pro | Short for SwitchBot Lock Pro Model No. W3500000 | No |
| Lock Lite | Short for SwitchBot Lock Lite Model No. W5110000 | No |
| Lock Ultra | Short for SwitchBot Lock Ultra Model No. W5600000 | No |
| Keypad | Short for SwitchBot Lock Model No. W2500010 | No |
| Keypad Touch | Short for SwitchBot Lock Model No. W2500020 | Yes |
| Keypad Vision | Short for SwitchBot Keypad Vision Model No. W5600003 | No |
| Keypad Vision Pro | Short for SwitchBot Keypad Vision Pro Model No. W5600009 | No |
| Robot Vacuum Cleaner S1 | Short for SwitchBot Robot Vacuum Cleaner S1 Model No. W3011000. Currently only available in Japan. | No |
| Robot Vacuum Cleaner S1 Plus | Short for SwitchBot Robot Vacuum Cleaner S1 Plus Model No. W3011010. Currently only available in Japan. | No |
| K10+ | Short for SwitchBot Mini Robot Vacuum K10+ Model No. W3011020 | Yes |
| K10+ Pro | Short for SwitchBot Mini Robot Vacuum K10+ Pro Model No. W3011026 | No |
| S10 | Short for SwitchBot Floor Cleaning Robot S10 Model No. W3211800 | No |
| S20 | Short for SwitchBot Floor Cleaning Robot S20 Model No. W6602310 | No |
| K10+ Pro Combo | Short for SwitchBot Robot Vacuum K10+ Pro Combo Model No. W3002500 | No |
| K20+ Pro | Short for SwitchBot Multitasking Household Robot K20+ Pro Model No. W3002520 | No |
| K11+ | Short for Robot Vacuum K11+ Model No. W3003100 | No |
| Ceiling Light | Short for SwitchBot Ceiling Light Model No. W2612230 and W2612240. Currently only available in Japan. | No |
| Ceiling Light Pro | Short for SwitchBot Ceiling Light Pro Model No. W2612210 and W2612220. Currently only available in Japan. | No |
| RGBICWW Strip Light | Short for SwitchBot RGBICWW Strip Light Model No. W1702109 | No |
| RGBICWW Floor Lamp | Short for SwitchBot RGBICWW Floor Lamp Model No. W1702101 | No |
| RGBIC Neon Rope Light | Short for SwitchBot RGBIC Neon Rope Light No. W1702107 | No |
| RGBIC Neon Wire Rope Light | Short for SwitchBot RGBIC Neon Wire Rope Light Model No. W1702108 | No |
| Floor Lamp | Short for SwitchBot RGBWW Floor Lamp Model No. W1702100 | No |
| Strip Light 3 | Short for SwitchBot RGBWW Strip Light 3 Model No. W1702110 | No |
| Indoor Cam | Short for SwitchBot Indoor Cam Model No. W1301200 | No |
| Pan/Tilt Cam | Short for SwitchBot Pan/Tilt Cam Model No. W1801200 | No |
| Pan/Tilt Cam 2K | Short for SwitchBot Pan/Tilt Cam 2K Model No. W3101100 | No |
| Blind Tilt | Short for SwitchBot Blind Tilt Model No. W2701600 | No |
| Roller Shade | Short for SwitchBot Roller Shade Model No. W5000000 | No |
| Air Purifier PM2.5 | Short for SwitchBot Air Purifier Model No. W5302300 | No |
| Air Purifier Table PM2.5 | Short for SwitchBot Air Purifier Table Model No. W5302310 | No |
| Air Purifier VOC | Short for SwitchBot Air Purifier Model No. W5302300 | No |
| Air Purifier Table VOC | Short for SwitchBot Air Purifier Table Model No. W5302310 | No |
| Battery Circulator Fan | Short for SwitchBot Battery Circulator Fan Model No. W3800510 | No |
| Circulator Fan | Short for SwitchBot Circulator Fan Model No. W3800511 | No |
| Evaporative Humidifier | Short for SwitchBot Evaporative Humidifier Model No.W3902300 | Yes |
| Evaporative Humidifier (Auto-refill) | Short for SwitchBot Evaporative Humidifier (Auto-refill) Model No. W3902310 | No |
Metadata
Release files for switchbot-utility 0.4.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| switchbot_utility-0.4.10.tar.gz | 119.2 kB | With provenance | Details for switchbot_utility-0.4.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| switchbot_utility-0.4.10-py3-none-any.whl | Python 3 | none | any | Details for switchbot_utility-0.4.10-py3-none-any.whl |
Total release size: 157.7 kB
Release files / switchbot_utility-0.4.10.tar.gz
| Download URL | switchbot_utility-0.4.10.tar.gz |
|---|---|
| Size | 119.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae7078ae8569c858b15381c7d90cf31ef66cff6c98baf194de4cc69ddbcdbdf9
|
|
BLAKE2b-256 checksum How to use checksums |
27b7707786c89a6473057f26b705a5f14348f97478934370783d0885b809c101
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logRelease files / switchbot_utility-0.4.10-py3-none-any.whl
| Download URL | switchbot_utility-0.4.10-py3-none-any.whl |
|---|---|
| Size | 38.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ba959acc733cdad317a344908971b4ead265af7916f07cf0af822d607409bb2
|
|
BLAKE2b-256 checksum How to use checksums |
65b84d9f359b55577ca9fcff1d0c21e219cb6e5e62238f6e5c5e418091cc350d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logSecurity for switchbot-utility 0.4.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for switchbot_utility-0.4.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.