--- id: py-unifi-access version: "1.6.1" license: MIT license_treatment: permissive maintenance: active --- # py-unifi-access — Async Python client for the UniFi Access local API with WebSocket event support License: permissive · Maintenance: active · Downloads: 77.0K/mo ## What it is and what it does py-unifi-access is an async Python client library for controlling UniFi Access hardware via its local API. It uses aiohttp for REST calls and provides WebSocket support for real-time device events, with automatic reconnection and exponential backoff. All API responses and WebSocket events are typed using Pydantic v2 models, making it suitable for Home Assistant integrations and other async applications that need structured, type-safe access to UniFi hardware. The package is designed for stateless operation, fitting Home Assistant's DataUpdateCoordinator pattern. It includes a CLI tool (via the `cli` extra) for debugging WebSocket events by capturing raw and parsed message streams to JSON files, useful when troubleshooting integration issues or reporting bugs. Use it for: - Build Home Assistant integrations that monitor and control UniFi Access doors and locks in real time. - Create automation scripts that unlock doors or check access status based on external triggers. - Debug WebSocket event parsing by capturing raw event streams to identify schema mismatches. - Monitor emergency status and device updates across multiple UniFi Access units asynchronously. - Integrate UniFi Access control into custom smart-home or building-management applications. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Async Python client for UniFi Access local API with WebSocket event support, providing typed access to doors, lock rules, and real-time device updates. Yes, if you need to control UniFi Access hardware from Python. The package is actively maintained, has low install friction, uses permissive MIT licensing, and provides well-typed async APIs. It is beta-status software with no known vulnerabilities. Install it if you are building Home Assistant integrations or custom automation around UniFi Access; skip it if you do not have UniFi Access hardware or need synchronous APIs. ## Install pip install py-unifi-access uv add py-unifi-access poetry add py-unifi-access ## Installing py-unifi-access Before you install: Low friction installation with a pure-Python wheel. Actively maintained with a release 27 days ago and recent commits. Requires Python 3.12 or later. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice. Quickstart: pip install py-unifi-access import aiohttp from py_unifi_access import UnifiAccessApiClient async with aiohttp.ClientSession() as session: client = UnifiAccessApiClient("192.168.1.1", "api-token", session) await client.authenticate() doors = await client.get_doors() Requires Python 3.12 or later; UniFi Access hardware and local API credentials required. Verify before relying: - Whether WebSocket event parsing covers all UniFi Access event types beyond the 13 documented types. - Performance characteristics under high-frequency event streams or with many concurrent door operations. - Compatibility with UniFi Access hardware versions and firmware releases. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 77.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unifi access api client, async unifi door control, unifi websocket events, home assistant unifi integration, unifi lock management python, real-time unifi device updates, home-assistant, unifi-hardware, async-client [View on SkillFed](https://skillfed.io/packages/py-unifi-access) · [View on PyPI](https://pypi.org/project/py-unifi-access/)