aiohomematic-config

raw JSON →
2026.4.2 verified Thu Apr 16 auth: no python

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.

pip install aiohomematic-config
error 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.
fix
Ensure aiohomematic-config is installed (pip install aiohomematic-config) and use the correct import path: from aiohomematic_config.config_schema import FormSchemaGenerator.
error 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.
fix
Upgrade 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.
error 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.
fix
Verify 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.
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.
fix Upgrade your Python environment to 3.14 or later. Ensure your deployment environment (e.g., Home Assistant OS) meets this requirement.
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.
fix Always install the latest version of `aiohomematic` when upgrading `aiohomematic-config`, or ensure `pip` resolves to a compatible `aiohomematic` version (e.g., `pip install aiohomematic-config 'aiohomematic>=<REQUIRED_VERSION>'`).
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.
fix Always provide the explicit version of `homematicip_local` (from Home Assistant's integrations page) and the specific library versions (`aiohomematic`, `aiohomematic-config`) when seeking support.
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.
fix Review any custom code that directly interacts with channel types or profile lookups to ensure compatibility with the new alias resolution, especially for channels sharing profiles (e.g., `OPTICAL_SIGNAL_RECEIVER` aliasing to `DIMMER_VIRTUAL_RECEIVER`).
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.
fix Update frontend or consuming logic to properly handle new fields like `cross_validation`, `parameter_groups`, `visible_when`, `presets`, `allow_custom_value`, `subset_group_id`, `SubsetOption`, `SubsetGroup` within the `FormSchema` and `FormParameter` models.

This quickstart demonstrates how to instantiate the `FormSchemaGenerator` and use it to generate a configuration schema for a hypothetical Homematic device channel. It involves setting up a `CentralUnit` (mocked for simplicity here, but would connect to a real CCU/Homegear in practice) and then calling `generate` with device and channel details to get a structured `FormSchema` object.

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())