aioharmony
asyncio Python library for connecting to and controlling the Logitech Harmony
What it is and what it does
aioharmony is an asyncio-native Python library for remote control of Logitech Harmony hubs. It evolved from earlier synchronous harmony libraries to provide async/await support, custom event callbacks, and automatic reconnection. The library communicates with Harmony devices over WebSockets (modern firmware) or XMPP (legacy), allowing you to query device and activity configuration, start or stop activities, send device commands, and monitor hub state changes through callbacks.
The package is built on aiohttp for HTTP/WebSocket communication and includes a command-line interface for discovery and control. It handles the Harmony protocol details internally, exposing a straightforward API: connect to a hub by IP, look up activity or device IDs by name, then call methods like start_activity() or send_commands() with those IDs. Event callbacks let you react to activity changes, connection state, and configuration updates without polling.
Use it for:
- Automate home theater activities (e.g., start 'Watch TV' activity when motion is detected)
- Send device commands programmatically (volume, channel changes) from a home automation system
- Monitor current activity and trigger downstream actions when the hub switches activities
- Build a custom control interface or dashboard that queries hub configuration and sends commands
- Integrate Harmony hub control into a larger asyncio-based home automation application
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
aioharmony is an asyncio library for programmatically controlling Logitech Harmony Link and Ultimate Hub devices over the network, supporting activity management, device commands, and event callbacks.
Yes. aioharmony is actively maintained, has low install friction, carries a permissive license, and fills a clear niche for Python developers needing programmatic Harmony hub control. The asyncio design integrates well with modern Python automation frameworks. No known security vulnerabilities. Install it if you own a Harmony device and need to automate or integrate it into a Python application.
Install
aioharmony on PyPI
pip
pip install aioharmonyuv
uv add aioharmonypoetry
poetry add aioharmonyInstalling aioharmony
Before you install
Low install friction; pure Python wheel with three runtime dependencies (aiohttp, async-timeout, slixmpp). Actively maintained with recent commits and support for modern Python versions (3.10–3.14).
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install aioharmony
import asyncio
from aioharmony.harmonyapi import HarmonyAPI
async def main():
client = HarmonyAPI(ip_address="192.168.1.203", protocol="WEBSOCKETS")
await client.connect()
try:
print(f"Connected to {client.name}")
finally:
await client.close()
asyncio.run(main())
Requires a Logitech Harmony device on the network accessible via IP address; WEBSOCKETS protocol requires modern firmware, XMPP is for legacy hubs.
Verify before relying
- Whether XMPP support requires slixmpp to be explicitly configured or if it is automatically available
- Specific firmware versions supported by WEBSOCKETS vs XMPP protocols
- Whether automatic reconnect works across network interruptions or only transient disconnects
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiohttp, async-timeout, slixmpp |
| Maintenance | actively maintained — 81 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,025/month — #14,559 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aioharmony-1.0.8-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
aiopulseAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI
aioslimprotoAsync Python implementation of the SLIMProto…
permissive · top 15,000 on PyPI
factorio-rcon-pyA Python client library for connecting to and…
copyleft · top 15,000 on PyPI
ha-garminPython client for the Garmin Connect API with…
permissive · top 15,000 on PyPI
tuya-device-sharing-sdkA Python SDK for Tuya's Open API that handles…
permissive · top 15,000 on PyPI
gehomesdkSDK for controlling and monitoring GE…
permissive · top 15,000 on PyPI
aioqswAsync Python library for controlling QNAP QSW…
permissive · top 15,000 on PyPI
aiowebostvAsync Python library for controlling LG…
permissive · top 15,000 on PyPI
fjaraskupanControl Fjäråskupan kitchen fans over Bluetooth…
permissive · top 15,000 on PyPI
aioairzone-cloudAsync Python library for controlling Airzone…
permissive · top 15,000 on PyPI