skillfed

aiohomekit

An asyncio HomeKit client

aiohomekit v4.0.1 131.8K downloads/30d#11,575 on PyPI71
Permissive license Apache-2.0 Active released

What it is and what it does

aiohomekit is an asyncio-based client library that implements the HomeKit Accessory Protocol (HAP) to communicate with and control HomeKit-compatible devices over IP networks. It handles the low-level protocol details including HAP session security, event subscriptions, and the quirks of real-world HomeKit device implementations—such as strict JSON formatting requirements, boolean encoding rules, and HTTP header sensitivity. The library is designed primarily for integration with Home Assistant's homekit_controller component and does not provide API stability guarantees outside that context.

The library uses hand-rolled HTTP code rather than high-level HTTP libraries to maintain byte-for-byte accuracy on the write path and support HomeKit's event model (responses without corresponding requests). It includes 11 runtime dependencies covering CoAP, Bluetooth Low Energy scanning, cryptography, async utilities, and JSON serialization. It does not support creating HomeKit accessories (server-side), only controlling them (client-side).

Use it for:

  • Integrate HomeKit device control into Home Assistant or other home automation platforms via asyncio
  • Build custom Python applications that discover and communicate with HomeKit accessories on local networks
  • Subscribe to and handle real-time events from HomeKit devices like motion sensors or door locks
  • Develop cross-platform (Linux, macOS, Windows) HomeKit clients that require async event handling

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

An asyncio-based HomeKit client library for controlling HomeKit accessories over IP networks, implementing the HAP protocol with event support.

Yes, if you are building a Home Assistant integration or custom home automation application that needs to control HomeKit accessories. The library is actively maintained, has low install friction, and carries no known vulnerabilities. Be aware that API stability is not guaranteed outside Home Assistant's use case, and device compatibility depends on real-world HAP implementations rather than spec compliance alone.

Install

aiohomekit on PyPI

pip

pip install aiohomekit

uv

uv add aiohomekit

poetry

poetry add aiohomekit

Installing aiohomekit

Before you install

Low friction install with 11 runtime dependencies available as wheels. Actively maintained with a release on 2026-08-14 and recent commits. Targets current Python versions (3.10+).

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions.

Quickstart

pip install aiohomekit

import asyncio
from aiohomekit.controller import Controller

async def main():
    controller = Controller()
    # Discover and control HomeKit accessories

asyncio.run(main())

Requires Python 3.10 or later. HomeKit accessories must be on the same local network and already paired with an Apple device or configured for HomeKit.

Verify before relying

  • Whether the library's API stability guarantees have been established since the description notes they were pending at time of writing
  • Current device compatibility matrix beyond the Phillips Hue and Eve Extend bridges mentioned as primary test targets

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 11 — aiocoap, aiohappyeyeballs, async-interrupt, async-timeout, bleak, bleak-retry-connector, chacha20poly1305, chacha20poly1305-reuseable, cryptography, orjson, zeroconf
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 131,770/month — #11,575 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiohomekit-4.0.1-py3-none-any.whl

Keywords: HomeKit, home, automation

Intended Audience :: DevelopersIntended Audience :: End Users/DesktopProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Home Automation

Tags

homekit client asynciohomekit protocol pythonhome automation homekitasyncio homekit controlhap client libraryhomekit accessory controlhome assistant homekit
homekithome-automationasyncio

More Home Automation packages