skillfed

aioharmony

asyncio Python library for connecting to and controlling the Logitech Harmony

aioharmony v1.0.8 77.0K downloads/30d#14,559 on PyPI27
Permissive license Apache-2.0 Active released

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 aioharmony

uv

uv add aioharmony

poetry

poetry add aioharmony

Installing 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

Framework :: AsyncIOIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Home AutomationTopic :: Software Development :: Libraries :: Python Modules

Tags

logitech harmony control libraryasyncio harmony hub automationharmony device remote controlhome automation harmony integrationharmony activity managementharmony hub python apilogitech harmony websockets
home-automationasyncioiot-control

More Python Modules packages