$npx skillfedfor your agent

PySwitchbot

A library to communicate with Switchbot

With conditionsPyPI Python ModulesReleased Aug 202685.3K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pyswitchbot-2.4.1-py3-none-any.whl
v2.4.1 · released 2026-08-07 · Python <4.0,>=3.11 · 5 runtime deps: aiohttp, bleak, bleak-retry-connector, cryptography, pyOpenSSL

Yes, if you own Switchbot devices and want to control them from Python. The library is actively maintained, has low install friction, and uses standard async patterns. It is in alpha status, so expect occasional API changes; check the repository for any breaking changes before upgrading. No known security vulnerabilities as of the latest scan.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.11 or later; Bluetooth hardware and Switchbot devices in range required to discover and control.
  • Low friction install with a pure-Python wheel.
  • Active maintenance with a recent release (7 days old) and steady commit history.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, including in commercial projects.

last release 2026-08-07 (7 days) · last repo commit 2026-08-14 · 167 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 85,275 downloads/mo, #13,935 on PyPI

Verify before relying

pip install pyswitchbot

import asyncio
from pyswitchbot.discovery import GetSwitchbotDevices

async def main():
    devices = await GetSwitchbotDevices().discover()
    print(devices)

asyncio.run(main())
  • Whether all Switchbot device types beyond locks and curtains are supported.
  • Whether the library works on all operating systems or has platform-specific limitations.
  • Performance and reliability characteristics when controlling multiple devices concurrently.
Same gist for agents: .md · .json

What it is and what it does

pySwitchbot is an async Python library for discovering and controlling Switchbot IoT devices via Bluetooth Low Energy. It handles device discovery, authentication (including encrypted communication for locks), and command execution for devices like smart locks and motorized curtains. The library wraps aiohttp, bleak, bleak-retry-connector, cryptography, and pyOpenSSL in an async-first API suitable for home automation integrations.

The package is in alpha status but actively maintained, with recent releases and steady development. It requires Python 3.11+ and supports Python 3.12, 3.13, and 3.14. Lock control requires retrieving encryption keys from the Switchbot account API (a one-time setup step), while other devices typically work with simpler discovery and command patterns.

Use it for

  • Automate smart lock unlock/lock operations in a home automation system by retrieving encryption keys once and reusing them.
  • Discover and control motorized curtains programmatically based on time, sensors, or user input.
  • Build a multi-device Switchbot controller that discovers all nearby devices and exposes them to a home automation platform.
  • Integrate Switchbot devices into an async Python application without blocking on BLE communication.
  • Retrieve device status and data from Switchbot devices on demand.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you own Switchbot devices and want to control them from Python.

The library is actively maintained, has low install friction, and uses standard async patterns. It is in alpha status, so expect occasional API changes; check the repository for any breaking changes before upgrading. No known security vulnerabilities as of the latest scan.

Install

pyswitchbot on PyPI

Before you install

Low friction install with a pure-Python wheel. Active maintenance with a recent release (7 days old) and steady commit history. Depends on aiohttp, bleak, bleak-retry-connector, cryptography, and pyOpenSSL—all standard async and security libraries.

Requires Python 3.11 or later; Bluetooth hardware and Switchbot devices in range required to discover and control.

License in practice

MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, including in commercial projects.

Quickstart

pip install pyswitchbot

import asyncio
from pyswitchbot.discovery import GetSwitchbotDevices

async def main():
    devices = await GetSwitchbotDevices().discover()
    print(devices)

asyncio.run(main())

Verify before relying

  • Whether all Switchbot device types beyond locks and curtains are supported.
  • Whether the library works on all operating systems or has platform-specific limitations.
  • Performance and reliability characteristics when controlling multiple devices concurrently.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.11
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
aiohttpbleakbleak-retry-connectorcryptographypyOpenSSL
MaintenanceActively maintained 7 days since the last release
Last repo commit
First released
Downloads85,275 / month, #13,935 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Home AutomationTopic :: Software Development :: Libraries :: Python Modules

Evidence: pyswitchbot-2.4.1-py3-none-any.whl

Tags

Capabilities
switchbot ble control librarysmart lock automation pythoniot device discovery bluetoothhome automation switchbotasync ble device controlswitchbot lock unlock api
Topics
home-automationble-bluetoothasync-io

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “switchbot ble control library”

  • PySwitchbotAsync Python library to discover and control Switchbot IoT devices…
  • switchbot-apiAn async Python library for controlling SwitchBot devices and remotes…
  • yalexs-bleProvides Bluetooth control of Yale and August smart locks via a…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also switchbot-api · govee-ble · yalexs-ble · pyschlage · xiaomi-ble · aiobmsble · aioblescan · tinytuya · led-ble · yalexs