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". Some third-party devices/gateways (e.g., Bosch, Intertechno) may be supported as well.

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
  • Extensible via custom entity classes for complex devices (thermostats, lights, covers, locks, sirens)
  • Fast startups through caching of paramsets
  • Robust operation with automatic reconnection after CCU restarts
  • Fully typed with strict mypy compliance
  • Async/await based on asyncio

How It Works

Unlike pyhomematic, which required manual device mappings, aiohomematic automatically creates entities for each relevant parameter on every device channel (unless blacklisted). To achieve this it:

  • Fetches and caches device paramsets (VALUES) for fast successive startups
  • Provides hooks for custom entity classes where complex behavior is needed
  • Includes helpers for robust operation, such as automatic reconnection after CCU restarts

Relationship to Homematic(IP) Local

This project follows a two-layer architecture that separates concerns between the library and the Home Assistant integration:

┌─────────────────────────────────────────────────────────┐
│                    Home Assistant                        │
│                                                          │
│  ┌────────────────────────────────────────────────────┐ │
│  │           Homematic(IP) Local Integration          │ │
│  │                                                    │ │
│  │  • Home Assistant entities (climate, light, etc.)  │ │
│  │  • UI configuration flows                          │ │
│  │  • Services and automations                        │ │
│  │  • Device/entity registry integration              │ │
│  └────────────────────────┬───────────────────────────┘ │
└───────────────────────────┼─────────────────────────────┘
                            │
                            │ uses
                            ▼
┌───────────────────────────────────────────────────────────┐
│                      aiohomematic                         │
│                                                           │
│  • Protocol implementation (XML-RPC, JSON-RPC)            │
│  • Device model and data point abstraction                │
│  • Connection management and reconnection                 │
│  • Event handling and callbacks                           │
│  • Caching for fast startups                              │
└───────────────────────────────────────────────────────────┘
                            │
                            │ communicates with
                            ▼
┌───────────────────────────────────────────────────────────┐
│              CCU3 / OpenCCU / Homegear                    │
└───────────────────────────────────────────────────────────┘

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 and notifies subscribers
  6. Homematic(IP) Local translates events into Home Assistant state updates

For Developers

If you want to:

  • Use Homematic devices in Home Assistant → Install Homematic(IP) Local
  • Build a custom Python application → Use aiohomematic directly
  • Contribute to device support → Most changes go into aiohomematic
  • Fix HA-specific issues → Changes go into Homematic(IP) Local

Requirements

Python

  • Python 3.13 or higher

CCU Firmware

Due to a bug in earlier CCU2/CCU3 firmware, aiohomematic requires at least the following versions when used with HomematicIP devices:

Platform Minimum Version
CCU2 2.53.27
CCU3 3.53.26

See details: OpenCCU Issue #843

Installation

For Home Assistant Users

Use the Home Assistant custom integration "Homematic(IP) Local", which is powered by aiohomematic:

  1. Prerequisites

    • Latest version of Home Assistant
    • A CCU3, OpenCCU, or Homegear instance reachable from Home Assistant
    • For HomematicIP devices, ensure CCU firmware meets the minimum versions listed above
  2. Install the integration

  3. Configure via Home Assistant UI

    • Settings → Devices & Services → Add Integration → "Homematic(IP) Local"
    • Enter CCU/Homegear host (IP or hostname)
    • Enable TLS if using HTTPS (skip verification for self-signed certificates)
    • Enter credentials
    • Choose interfaces: HM (2001), HmIP (2010), Virtual (9292)
  4. Network callbacks

    • Ensure Home Assistant is reachable from the CCU (no NAT/firewall blocking)

New to Homematic? See the Glossary for definitions of terms like Backend, Interface, Device, Channel.

For Developers

pip install aiohomematic

Or install from source:

git clone https://github.com/sukramj/aiohomematic.git
cd aiohomematic
pip install -r requirements.txt

Quick Start

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

config = CentralConfig(
    central_id="ccu-main",
    host="ccu.local",
    username="admin",
    password="secret",
    default_callback_port=43439,
    interface_configs={
        InterfaceConfig(interface=Interface.HMIP, port=2010, enabled=True)
    },
)

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

# Access devices
for device in central.devices:
    print(f"{device.name}: {device.device_address}")

await central.stop()

Public API

The public API is explicitly defined via __all__ in each module:

Module Contents
aiohomematic.central CentralUnit, CentralConfig and related schemas
aiohomematic.client Client, InterfaceConfig, Interface
aiohomematic.model Device/channel/data point abstractions
aiohomematic.exceptions Library exception types
aiohomematic.const Constants and enums

Import from specific submodules for stable imports:

from aiohomematic.central import CentralConfig, CentralUnit
from aiohomematic.client import InterfaceConfig, Interface
from aiohomematic.exceptions import ClientException

Documentation

For Users

For Developers

Contributing

Contributions are welcome! Please read our Contributing Guide for details on:

  • Development environment setup
  • Code standards and type annotations
  • Pull request process
  • Testing guidelines

See CLAUDE.md for comprehensive development guidelines.

Related Projects

License

This project is licensed under the MIT License - see the LICENSE file 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.1.20.tar.gz (486.4 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.1.20-py3-none-any.whl (587.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiohomematic-2026.1.20.tar.gz
Algorithm Hash digest
SHA256 1c35a1b56b4b4bcec8a487f7210ab35e21c5971a56697d52153b89f248e43dc2
MD5 72a0e49f7b6f1887c307740a5d5d94e4
BLAKE2b-256 d26c613143f2502977c41b1ccd91857d5a158316c8082236f52b75567147858a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohomematic-2026.1.20.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.1.20-py3-none-any.whl.

File metadata

File hashes

Hashes for aiohomematic-2026.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 2829ab679f1b9eedd4e4525019a9f6ca0d007ea4b91c01a600dcf229c22948f1
MD5 f4eeb4e6e536ae8e520b970460dfa03d
BLAKE2b-256 24f86c1e876870c5ace8ccd9bcffa2dc7a8c8c8ed8782ac61a3c5531560c778c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiohomematic-2026.1.20-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