aiohomematic-config
Aiohomematic-config is a presentation-layer library for generating and managing configuration schemas for Homematic devices. It forms a core component of the Homematic(IP) Local Home Assistant integration, abstracting complex device parameter logic into a structured format suitable for user interfaces. The library is actively maintained with frequent releases, currently at version 2026.4.2.
Common errors
-
ImportError: cannot import name 'FormSchemaGenerator' from 'aiohomematic_config'
cause The `FormSchemaGenerator` was moved or the import path is incorrect. Or, `aiohomematic-config` might not be installed or is an older version.fixEnsure `aiohomematic-config` is installed (`pip install aiohomematic-config`) and use the correct import path: `from aiohomematic_config.config_schema import FormSchemaGenerator`. -
RuntimeError: Python version 3.13 or lower is not supported. Please upgrade to Python 3.14 or higher.
cause The installed version of `aiohomematic-config` requires Python 3.14 or newer, but an older Python version is being used.fixUpgrade your Python environment to version 3.14 or later. For Home Assistant users, ensure your Home Assistant OS or container is updated to a version with Python 3.14. -
Failed to connect to CCU/Homegear: [Errno 113] Connect call failed
cause This error typically originates from the underlying `aiohomematic` library, indicating `aiohomematic-config` cannot reach the Homematic Central Control Unit. Common causes include incorrect IP address/port, network issues, firewall blocking, or the CCU's services not running.fixVerify the IP address and port configured for your CCU/Homegear. Check network connectivity between your Python environment and the CCU. Ensure the CCU's RPC/XML-RPC services are running and accessible (e.g., firewall rules). For RaspberryMatic, ensure all necessary hardware interfaces are connected for services to start.
Warnings
- breaking As of version 2026.3.2, aiohomematic-config requires Python 3.14 or newer. Support for Python 3.13 and older versions has been dropped.
- breaking The `aiohomematic` dependency is frequently updated, and `aiohomematic-config` often bumps its minimum required `aiohomematic` version. Ensure `aiohomematic` is kept up-to-date alongside `aiohomematic-config` to avoid compatibility issues.
- gotcha When used within Home Assistant, users often confuse the version of `aiohomematic` or `aiohomematic-config` with the `homematicip_local` integration version or Home Assistant Core version. This can lead to misdiagnosed problems when reporting issues.
- breaking Version 2026.4.0 introduced receiver type alias resolution and applied them in `ProfileStore` and `ParameterGrouper`. Custom logic relying on previous raw channel types might need adjustment.
- breaking Several schema generation features like `CrossValidationConstraint`, semantic parameter grouping, and metadata-based parameter ordering were added in 2026.3.5 and 2026.3.4. Consumers of `FormSchema` might see new fields or structural changes.
Install
-
pip install aiohomematic-config
Imports
- FormSchemaGenerator
from aiohomematic_config.config_schema import FormSchemaGenerator
- ConfigChangeLog
from aiohomematic_config.config_change_log import ConfigChangeLog
- DeviceScheduleData
from aiohomematic_config.models import DeviceScheduleData
- set_schedule_enabled
from aiohomematic_config.facades import set_schedule_enabled
Quickstart
import asyncio
from aiohomematic_config.config_schema import FormSchemaGenerator
from aiohomematic.central import CentralConfig, CentralUnit
from aiohomematic.const import Interface
async def main():
# This is a simplified example. In a real scenario, you'd connect to a CCU.
# We'll mock a CentralUnit to demonstrate FormSchemaGenerator usage.
# 1. Setup a dummy CentralUnit (usually connected to a real CCU/Homegear)
config = CentralConfig(
name="mock-ccu",
host="127.0.0.1", # Not actually connecting, just for object creation
port=2001,
interfaces={Interface.BIDCOS_RF: "0"}
)
central = CentralUnit(config)
await central.start_connection()
# 2. Assume you have a device and channel address
# In a real setup, you'd get these from `central.devices`
device_address = "ABC1234567"
channel_address = f"{device_address}:1"
# Mock a device and channel for schema generation demonstration
# In reality, central.get_device() would return a real device.
# For this quickstart, we'll create a placeholder.
class MockDevice:
def __init__(self, address):
self.address = address
self.channels = {1: MockChannel(f'{address}:1')}
class MockChannel:
def __init__(self, address):
self.address = address
self.type = 'CLIMATE_CONTROL_RT_TRANSCEIVER'
# The FormSchemaGenerator needs access to the CentralUnit for metadata
# and potentially to fetch current parameter values.
schema_generator = FormSchemaGenerator(central=central)
try:
# 3. Generate a form schema for a specific device channel
# In a real application, you'd pass a real device_type and channel_type
# from aiohomematic.device or aiohomematic.channel objects.
form_schema = await schema_generator.generate(
device_address=device_address,
device_type="HM-CC-RT-DN", # Example device type
channel_address=channel_address,
channel_type="CLIMATE_CONTROL_RT_TRANSCEIVER", # Example channel type
is_hmip=False # Indicate if it's a Homematic IP device
)
print(f"Generated Form Schema for {channel_address}:")
# The form_schema object would contain fields, constraints, etc.
# print(form_schema.json(indent=2)) # Requires pydantic to_json (or similar) method if FormSchema is Pydantic model
print(f"Schema has {len(form_schema.fields)} fields.")
print(f"Schema title: {form_schema.title}")
except Exception as e:
print(f"Error generating schema: {e}")
finally:
await central.stop_connection()
if __name__ == "__main__":
asyncio.run(main())