skillfed

pyvesync

pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app.

pyvesync v3.4.2 79.1K downloads/30d#14,385 on PyPI240
Permissive license MIT Active released

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 pyvesync

uv

uv add pyvesync

poetry

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 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishTopic :: Home Automation

Tags

vesync smart home controletekcity levoit cosori apiasync iot device managementsmart outlet switch automationhome automation library pythonvesync device integrationair purifier humidifier control
home-automationiot-devicesasync-api

More Home Automation packages