pyvesync
pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app.
What it is and what it does
pyvesync is an async Python library for controlling VeSync-compatible smart home devices sold under brands like Etekcity, Levoit, and Cosori. It handles authentication, device discovery, and state management for outlets, switches, fans, air purifiers, humidifiers, bulbs, air fryers, and thermostats. The library uses aiohttp for non-blocking network I/O and mashumaro for serialization, making it suitable for integration into async applications and home automation frameworks.
Version 3.0+ introduced a major refactor with breaking changes: asynchronous-only operation, strong typing, standardized device APIs across product types, and custom exception handling. Devices are organized into typed collections (outlets, switches, fans, etc.) and expose common methods like update() and turn_off(). The library requires explicit error handling for network failures and API errors, and manages its own aiohttp session unless you provide one.
Use it for:
- Build a home automation dashboard that monitors and controls multiple VeSync devices in real time using async/await.
- Integrate Levoit air purifiers or Cosori air fryers into a larger smart home system that needs device state polling and remote commands.
- Create scheduled automation rules that turn outlets on/off or adjust fan speeds based on time or sensor triggers.
- Monitor device state changes and log energy consumption or operational metrics from Etekcity outlets.
- Develop a voice assistant skill or webhook handler that accepts commands to control VeSync devices asynchronously.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Asynchronous Python library to discover, authenticate with, and control VeSync-compatible smart home devices including outlets, switches, fans, air purifiers, humidifiers, bulbs, air fryers, and thermostats.
Yes. The library is actively maintained, has no known vulnerabilities, and low install friction. It is the standard way to programmatically control VeSync devices in Python. The async-first design and strong typing make it suitable for modern applications. Breaking changes in version 3.0+ require careful migration if upgrading, but the refactored API is more consistent and maintainable. Recommended for anyone building integrations with VeSync-compatible smart home devices.
Install
pyvesync on PyPI
pip
pip install pyvesyncuv
uv add pyvesyncpoetry
poetry add pyvesyncInstalling pyvesync
Before you install
Low friction install with two runtime dependencies (aiohttp and mashumaro). Actively maintained with a recent release and no known vulnerabilities. Requires Python 3.11 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.
Quickstart
pip install pyvesync
import asyncio
from pyvesync import VeSync
async def main():
async with VeSync("username", "password", country_code="US") as manager:
await manager.login()
await manager.get_devices()
await manager.update()
for outlet in manager.devices.outlets:
await outlet.turn_off()
asyncio.run(main())
Requires Python 3.11 or later; aiohttp ClientSession lifecycle must be managed correctly to avoid unclosed session warnings.
Verify before relying
- Whether all VeSync device models listed in documentation are actually supported in version 3.4.2
- Rate limiting behavior and retry strategies when hitting VeSyncRateLimitError
- Timeout and connection resilience for long-running device management sessions
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiohttp, mashumaro |
| Maintenance | actively maintained — 120 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 79,074/month — #14,385 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyvesync-3.4.2-py3-none-any.whl
Keywords: iot, vesync, levoit, etekcity, cosori, valceno
Tags
More Home Automation packages
Represents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
homeassistantHome Assistant is an open-source home…
permissive · top 5,000 on PyPI
python-statemachineDefines finite state machines and statecharts…
permissive · top 5,000 on PyPI
btsocketA Python library for controlling BlueZ…
permissive · top 15,000 on PyPI
aiohomematicAn async Python library for controlling and…
permissive · top 15,000 on PyPI
hass-web-proxy-libProvides base classes and utilities for Home…
permissive · top 15,000 on PyPI
pyemvuePyEmVue reads energy usage data from Emporia…
permissive · top 15,000 on PyPI
pyswitchbeeA Python library for controlling SwitchBee…
permissive · top 15,000 on PyPI
bond-asyncAsynchronous Python wrapper for the Bond Local…
permissive · top 15,000 on PyPI
fjaraskupanControl Fjäråskupan kitchen fans over Bluetooth…
permissive · top 15,000 on PyPI
pyoverkizAn asynchronous Python client for the OverKiz…
permissive · top 15,000 on PyPI
pydaikinPyDaikin provides a Python library and CLI for…
copyleft · top 15,000 on PyPI
meross-iotA Python library for controlling Meross IoT…
permissive · top 15,000 on PyPI
pywemoDiscovers and controls Belkin WeMo smart home…
permissive · top 15,000 on PyPI
plugp100A Python library for controlling and…
copyleft · top 15,000 on PyPI
epson-projectorAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI