aioshelly
Asynchronous library to control Shelly devices.
What it is and what it does
Aioshelly is an async Python client for Shelly smart home devices, supporting both legacy Gen1 devices (CoAP/Block protocol) and modern Gen2+ devices (RPC/WebSocket). It abstracts the underlying protocol differences so you can query device status, receive state change notifications, and issue commands through a unified interface. The library depends on aiohttp for HTTP communication, orjson for fast JSON parsing, zeroconf for device discovery, and Bluetooth-related packages for wireless connectivity.
You instantiate either a BlockDevice (Gen1) or RpcDevice (Gen2+) with connection credentials, then interact with device blocks or status objects to read values and trigger actions. The library is under active development and designed to track the official Shelly API specification.
Use it for:
- Build a home automation dashboard that polls and displays real-time status from multiple Shelly devices.
- Create event-driven automations that react to Shelly device state changes via WebSocket subscriptions.
- Integrate Shelly devices into a larger Home Assistant or custom IoT platform.
- Control Shelly relays, dimmers, and switches programmatically from a Python application.
- Monitor Shelly power meters and environmental sensors for logging or alerting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Asynchronous Python library for controlling Shelly smart home devices over CoAP (Gen1) and WebSocket/RPC (Gen2+) protocols.
Yes, if you need to control Shelly devices from Python. The library is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. The requirement for Python 3.11+ and the 'under development' status mean you should expect occasional API changes and test thoroughly in production environments.
Install
aioshelly on PyPI
pip
pip install aioshellyuv
uv add aioshellypoetry
poetry add aioshellyInstalling aioshelly
Before you install
Low install friction with a pure-Python wheel and seven runtime dependencies. Actively maintained with a recent release (18 days old) and steady commit history. Requires Python 3.11 or later.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
import asyncio
import aiohttp
from aioshelly.rpc_device import RpcDevice, WsServer
from aioshelly.common import ConnectionOptions
async def main():
options = ConnectionOptions("192.168.1.188", "user", "pass")
ws_context = WsServer()
await ws_context.initialize(8123)
async with aiohttp.ClientSession() as session:
device = await RpcDevice.create(session, ws_context, options)
print(device.status)
asyncio.run(main())
Requires Python 3.11 or later. For Gen2+ devices, you must initialize a WsServer and provide a port for WebSocket callbacks.
Verify before relying
- Whether the library handles reconnection and error recovery automatically or requires application-level retry logic.
- Performance characteristics when controlling multiple devices concurrently.
- Whether Bluetooth connectivity (via bleak-retry-connector and habluetooth dependencies) is required or optional.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — aiohttp, bleak-retry-connector, bluetooth-data-tools, habluetooth, orjson, yarl, zeroconf |
| Maintenance | actively maintained — 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,184/month — #13,285 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aioshelly-13.29.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
aiocoapaiocoap is a Python library for writing CoAP…
permissive · top 15,000 on PyPI
aiohueAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
pymielepymiele is a Python library that enables Home…
permissive · top 15,000 on PyPI
aioesphomeapiAsync Python client library for communicating…
permissive · top 5,000 on PyPI
aioautomowerAsynchronous Python client library for…
permissive · top 15,000 on PyPI
epson-projectorAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
aioqswAsync Python library for controlling QNAP QSW…
permissive · top 15,000 on PyPI
rokuecpAn asynchronous Python client for controlling…
permissive · top 15,000 on PyPI
devolo-home-control-apiPython client library for the devolo Home…
copyleft · top 15,000 on PyPI
aiohttp-fast-zlibReplaces aiohttp's default zlib compression…
permissive · top 5,000 on PyPI