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.
- 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
EventBusfor 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
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.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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.
| 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
- Homematic(IP) Local creates a
CentralUnitvia aiohomematic's API - aiohomematic connects to the CCU/Homegear and discovers devices
- aiohomematic creates
Device,Channel, andDataPointobjects - Homematic(IP) Local wraps these in Home Assistant entities
- aiohomematic receives events from the CCU (XML-RPC callbacks or MQTT bridge for CUxD/CCU-Jack) and notifies subscribers via the
EventBus - Homematic(IP) Local translates events into Home Assistant state updates
Use the Home Assistant custom integration Homematic(IP) Local:
- Install HACS in your Home Assistant instance (see HACS documentation).
- In HACS, add
https://github.com/SukramJ/homematicip_localas a custom repository (category: Integration). - Install Homematic(IP) Local via HACS and restart Home Assistant.
- Configure the integration under Settings β Devices & Services β Add Integration.
See the Integration Guide for detailed instructions.
pip install aiohomematicimport 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.
- Development environment:
docs/contributor/dev-environment.md - Contract tests (protocol / capability invariants, incl. CUxD / CCU-Jack):
tests/contract/ - Benchmarks:
tests/benchmarks/ - AI assistant / contributor quick-reference:
CLAUDE.md
- 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.
- 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.
| 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) |
Contributions are welcome! See the Contributing Guide and the in-repo CLAUDE.md for coding standards and the refactoring checklist.
MIT License - see LICENSE for details.
If you find this project useful, consider sponsoring the development.