--- id: pyvesync version: "3.4.2" license: MIT license_treatment: permissive maintenance: active --- # pyvesync — pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app. License: permissive · Maintenance: active · Downloads: 79.1K/mo ## 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 above — 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 pip install pyvesync uv add pyvesync poetry add pyvesync ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 79.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags vesync smart home control, etekcity levoit cosori api, async iot device management, smart outlet switch automation, home automation library python, vesync device integration, air purifier humidifier control, home-automation, iot-devices, async-api [View on SkillFed](https://skillfed.io/packages/pyvesync) · [View on PyPI](https://pypi.org/project/pyvesync/)