Skip to main content

Homematic interface for Home Assistant running on Python 3.

Project description

Release License Python GitHub Sponsors

aiohomematic

A modern, async Python library for controlling and monitoring Homematic and HomematicIP devices. Powers the Home Assistant integration "Homematic(IP) Local".

This project is the modern successor to pyhomematic, focusing on automatic entity creation, fewer manual device definitions, and faster startups.

Key Features

  • Automatic entity discovery from device/channel parameters
  • Broad backend support: CCU3, OpenCCU, Homegear, CUxD, CCU-Jack, and pydevccu for testing
  • Multiple transport protocols: XML-RPC (standard interfaces) and JSON-RPC (CUxD / CCU-Jack), with MQTT event forwarding via Homematic(IP) Local
  • Extensible via custom entity classes for complex devices (climate, cover, light, lock, siren, valve, …)
  • Hub entities for CCU programs, system variables, inbox messages, install mode, and service messages
  • Event-driven architecture with a unified EventBus for lifecycle, state, and diagnostic events
  • Fast startups through paramset and description caching
  • Robust operation with circuit breaker, command retry/throttling, and automatic reconnection after CCU restarts
  • Fully typed (mypy strict mode) and async/await based on asyncio

Documentation

Full documentation: sukramj.github.io/aiohomematic

Section Description
Getting Started Installation and first steps
User Guide Home Assistant integration and device topics
Developer Guide API reference for library consumers
Contributor Guide Dev environment, coding standards, release process
Architecture & ADRs System design and decision records

Additional entry points in this repository: CLAUDE.md (AI assistant / contributor quick-reference) and changelog.md.

How It Works

┌─────────────────────────────────────────────────────────┐
│                    Home Assistant                       │
│                                                         │
│  ┌────────────────────────────────────────────────────┐ │
│  │           Homematic(IP) Local Integration          │ │
│  │                                                    │ │
│  │  • Home Assistant entities (climate, light, etc.)  │ │
│  │  • UI configuration flows                          │ │
│  │  • Services and automations                        │ │
│  │  • MQTT bridge for CUxD / CCU-Jack events          │ │
│  └────────────────────────┬───────────────────────────┘ │
└───────────────────────────┼─────────────────────────────┘
                            │
                            │ uses
                            ▼
┌───────────────────────────────────────────────────────────┐
│                      aiohomematic                         │
│                                                           │
│  • Protocol adapters (XML-RPC, JSON-RPC)                  │
│  • Device model and data point abstraction                │
│  • Connection management and reconnection                 │
│  • EventBus for lifecycle / state / diagnostic events     │
│  • Caching (paramset, device descriptions, sessions)      │
└───────────────────────────────────────────────────────────┘
                            │
                            │ communicates with
                            ▼
┌────────────────────────────────────────────────────────────┐
│     CCU3 / OpenCCU / Homegear / CUxD / CCU-Jack            │
└────────────────────────────────────────────────────────────┘

CUxD and CCU-Jack use JSON-RPC and receive events via MQTT forwarded by the Home Assistant integration — see CUxD and CCU-Jack for details.

Why Two Projects?

Aspect aiohomematic Homematic(IP) Local
Purpose Python library for Homematic protocol Home Assistant integration
Scope Protocol, devices, data points HA entities, UI, services
Dependencies Standalone (aiohttp, orjson) Requires Home Assistant
Reusability Any Python project Home Assistant only
Repository aiohomematic homematicip_local

Benefits of this separation:

  • Reusability: aiohomematic can be used in any Python project, not just Home Assistant
  • Testability: The library can be tested independently without Home Assistant
  • Maintainability: Protocol changes don't affect HA-specific code and vice versa
  • Clear boundaries: Each project has a focused responsibility

How They Work Together

  1. Homematic(IP) Local creates a CentralUnit via aiohomematic's API
  2. aiohomematic connects to the CCU/Homegear and discovers devices
  3. aiohomematic creates Device, Channel, and DataPoint objects
  4. Homematic(IP) Local wraps these in Home Assistant entities
  5. aiohomematic receives events from the CCU (XML-RPC callbacks or MQTT bridge for CUxD/CCU-Jack) and notifies subscribers via the EventBus
  6. Homematic(IP) Local translates events into Home Assistant state updates

For Home Assistant Users

Use the Home Assistant custom integration Homematic(IP) Local:

  1. Install HACS in your Home Assistant instance (see HACS documentation).
  2. In HACS, add https://github.com/SukramJ/homematicip_local as a custom repository (category: Integration).
  3. Install Homematic(IP) Local via HACS and restart Home Assistant.
  4. Configure the integration under SettingsDevices & ServicesAdd Integration.

See the Integration Guide for detailed instructions.

For Developers

pip install aiohomematic

Quick Start

import asyncio

from aiohomematic.central import CentralConfig
from aiohomematic.client import InterfaceConfig
from aiohomematic.const import Interface


async def main() -> None:
    config = CentralConfig(
        central_id="ccu-main",
        name="ccu-main",
        host="ccu.local",
        username="admin",
        password="secret",
        interface_configs={
            InterfaceConfig(central_name="ccu-main", interface=Interface.HMIP_RF, port=2010),
        },
    )

    central = await config.create_central()
    await central.start()

    for device in central.devices:
        print(f"{device.name}: {device.address}")

    await central.stop()


asyncio.run(main())

For a more complete example (multiple interfaces, event subscriptions, .env loading) see example.py. For API usage patterns see the Consumer API guide.

Contributing

Requirements

  • Python: 3.14+
  • CCU firmware: CCU3 ≥ 3.61.x recommended; CCU2 ≥ 2.61.x is best-effort (see backend support below)
  • No active testing is performed to identify the minimum required firmware versions — stay on a current release.

Backend Support

  • Primary test targets (continuously tested in CI):
    • OpenCCU with current firmware
    • pydevccu (virtual CCU used in the automated test suite)
  • Supported, best-effort (expected to work, not continuously tested):
    • CCU3 with current firmware
    • CUxD (via JSON-RPC)
    • CCU-Jack (via JSON-RPC)
  • Legacy / unsupported:
    • CCU2 — works with recent firmware but is not actively tested
    • Homegear — not actively tested

Running outdated firmware or untested backends (CCU2, Homegear) is at your own risk.

Recommendation: keep your CCU firmware up to date. Outdated versions may lack bug fixes, security patches, and compatibility improvements that this library relies on.

Related Projects

Project Description
Homematic(IP) Local Home Assistant integration built on aiohomematic
pydevccu Virtual CCU used as a test target
pyhomematic Predecessor project (no longer actively developed)

Contributing

Contributions are welcome! See the Contributing Guide and the in-repo CLAUDE.md for coding standards and the refactoring checklist.

License

MIT License - see LICENSE for details.

Support

GitHub Sponsors

If you find this project useful, consider sponsoring the development.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohomematic-2026.5.1.tar.gz (591.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiohomematic-2026.5.1-py3-none-any.whl (711.3 kB view details)

Uploaded Python 3

File details

Details for the file aiohomematic-2026.5.1.tar.gz.

File metadata

  • Download URL: aiohomematic-2026.5.1.tar.gz
  • Upload date:
  • Size: 591.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiohomematic-2026.5.1.tar.gz
Algorithm Hash digest
SHA256 08ad73f77b20e883b7d924ca0b675dc36f6eee97e9c72ce6687d90ff3b3b310e
MD5 0c8a0c1e53fcc7af188d9062bf729890
BLAKE2b-256 16e17d5f402a2d6d3d3d65be951feff6a4a2da722ca8ba6a54d79c005f1e8b46

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohomematic-2026.5.1.tar.gz:

Publisher: python-publish.yml on SukramJ/aiohomematic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiohomematic-2026.5.1-py3-none-any.whl.

File metadata

  • Download URL: aiohomematic-2026.5.1-py3-none-any.whl
  • Upload date:
  • Size: 711.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiohomematic-2026.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd572c4c989a5535f1a3840a7708665ed24417aa1c232dad8784008016ad33a3
MD5 fe2c487469aa0a2b2ddd6f90c79c7f12
BLAKE2b-256 042a6dbc8614ec31040f2ae48e99766af07eb29b3871aca574188317a80174ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohomematic-2026.5.1-py3-none-any.whl:

Publisher: python-publish.yml on SukramJ/aiohomematic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page