Skip to main content

pykomfovent

CI PyPI Python License

Async Python client for Komfovent C6 ventilation units.

Support: Open an issue or contact pykomfovent@ostaszewski.pl

Installation

pip install pykomfovent

Quick Start

import asyncio
from pykomfovent import KomfoventClient

async def main():
    async with KomfoventClient("192.168.1.100", "user", "password") as client:
        # Read state
        state = await client.get_state()
        print(f"Mode: {state.mode}, Supply: {state.supply_temp}°C")
        
        # Control
        await client.set_mode("normal")
        await client.set_supply_temp(22.5)

asyncio.run(main())

API Reference

KomfoventClient

The main client for communicating with Komfovent C6 units.

  • Async context manager for automatic session cleanup
  • Automatic retry (3 attempts) with exponential backoff
  • 10 second timeout per request
client = KomfoventClient(
    host="192.168.1.100",  # IP address of your unit
    username="user",       # Web interface username
    password="password",   # Web interface password
    port=80                # Optional, defaults to 80
)

Methods

Method Description
authenticate() Verify credentials, returns bool
get_state() Get current unit state, returns KomfoventState
set_mode(mode) Set mode: "away", "normal", "intensive", "boost"
set_supply_temp(temp) Set target supply temperature (10-35°C)
get_schedule() Get weekly schedule configuration
set_schedule(commands) Update schedule settings
set_register(register, value) Low-level register access
close() Close the HTTP session

KomfoventState

Immutable dataclass containing all sensor values.

Temperatures

Property Description
supply_temp Supply air temperature (°C)
extract_temp Extract air temperature (°C)
outdoor_temp Outdoor temperature (°C)
supply_temp_setpoint Target supply temperature (°C)
extract_temp_setpoint Target extract temperature (°C)

Fan Status

Property Description
supply_fan_percent Supply fan speed (%)
extract_fan_percent Extract fan speed (%)
supply_fan_intensity Supply fan intensity
extract_fan_intensity Extract fan intensity

Heat Exchanger & Heating

Property Description
heat_exchanger_percent Heat exchanger position (%)
heat_exchanger_efficiency Heat recovery efficiency (%)
heat_recovery_power Heat recovery power (W)
electric_heater_percent Electric heater power (%)
heating_power Total heating power (W)

Energy Statistics

Property Description
power_consumption Current power consumption (W)
energy_consumed_daily Energy consumed today (kWh)
energy_consumed_monthly Energy consumed this month (kWh)
energy_consumed_total Total energy consumed (kWh)
energy_heating_daily Heating energy today (kWh)
energy_heating_monthly Heating energy this month (kWh)
energy_heating_total Total heating energy (kWh)
energy_recovered_daily Energy recovered today (kWh)
energy_recovered_monthly Energy recovered this month (kWh)
energy_recovered_total Total energy recovered (kWh)
spi_actual Current SPI - Specific Power Input (W/(m³/h))
spi_daily Daily average SPI

Other

Property Description
mode Current operating mode (string)
filter_contamination Filter contamination level (%)
air_quality Air quality sensor (%)
humidity Humidity sensor (%)
flags Raw status flags (int)
is_on True if unit is running
heating_active True if heater is active
eco_mode True if ECO mode is enabled

KomfoventDiscovery

Auto-discover Komfovent devices on your local network.

from pykomfovent import KomfoventDiscovery

discovery = KomfoventDiscovery(
    subnet="192.168.1.0/24",  # Optional, auto-detected
    timeout=2.0,              # Per-host timeout (default: 2.0)
    max_concurrent=10         # Parallel connections (default: 10)
)

devices = await discovery.discover()
for device in devices:
    print(f"{device.host} - {device.name}")

Returns list of DiscoveredDevice with host and name properties.


Schedules

The schedule is a dictionary mapping days to mode/time sequences:

schedule = await client.get_schedule()
# {'p0r0': [1, 360, 2, 1020, 1], 'p0r1': [...], ...}
Format Description
Key: p0r{day} Day of week (0=Monday, 6=Sunday)
Value: [mode, minutes, ...] Alternating mode and time from midnight

Mode codes: 1=away, 2=normal, 3=intensive, 4=boost

Setting a schedule:

# Monday: away→6:00→normal→17:00→away
await client.set_schedule({
    "p0r0_0": 1,     # Away
    "p0r0_1": 360,   # 6:00
    "p0r0_2": 2,     # Normal
    "p0r0_3": 1020,  # 17:00
    "p0r0_4": 1,     # Away
})

Exceptions

Exception Description
KomfoventAuthError Invalid credentials
KomfoventConnectionError Network or connection issues
KomfoventParseError Failed to parse device response

Examples

Energy Monitoring

async def monitor_efficiency():
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        state = await client.get_state()
        print(f"Efficiency: {state.heat_exchanger_efficiency}%")
        print(f"Power: {state.power_consumption}W")
        print(f"Recovered: {state.heat_recovery_power}W")

Filter Alert

async def check_filter():
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        state = await client.get_state()
        if state.filter_contamination and state.filter_contamination > 80:
            print(f"⚠️ Replace filter: {state.filter_contamination}%")

Auto Mode Based on Temperature

async def auto_mode():
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        state = await client.get_state()
        if state.outdoor_temp and state.outdoor_temp > 25:
            await client.set_mode("intensive")
        elif state.outdoor_temp and state.outdoor_temp < 5:
            await client.set_mode("normal")
            await client.set_supply_temp(23.0)

Periodic Monitoring

async def monitor_loop():
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        while True:
            state = await client.get_state()
            print(f"[{state.mode}] {state.supply_temp}°C / {state.outdoor_temp}°C")
            await asyncio.sleep(60)

Set Workday Schedule

async def set_workday_schedule():
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        workday = {
            "0": 1, "1": 360, "2": 2, "3": 480,      # Away→6:00→Normal→8:00
            "4": 1, "5": 1020, "6": 2, "7": 1320,    # Away→17:00→Normal→22:00
            "8": 1                                    # Away
        }
        for day in range(5):  # Mon-Fri
            await client.set_schedule({f"p0r{day}_{k}": v for k, v in workday.items()})

Error Handling

from pykomfovent import KomfoventClient, KomfoventAuthError, KomfoventConnectionError

try:
    async with KomfoventClient("192.168.1.100", "user", "pass") as client:
        state = await client.get_state()
except KomfoventAuthError:
    print("Invalid credentials")
except KomfoventConnectionError as e:
    print(f"Connection failed: {e}")

Requirements

  • Python 3.11+
  • Komfovent C6 ventilation unit with web interface enabled

License

MIT

Metadata

Release files for pykomfovent 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykomfovent 1.0.2
File Size Uploaded Provenance Actions
pykomfovent-1.0.2.tar.gz 80.4 kB With provenance Details for pykomfovent-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pykomfovent 1.0.2
File Interpreter ABI Platform Actions
pykomfovent-1.0.2-py3-none-any.whl Python 3 none any Details for pykomfovent-1.0.2-py3-none-any.whl

Total release size: 89.9 kB

Release files / pykomfovent-1.0.2.tar.gz

Download URL pykomfovent-1.0.2.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
729043b4178de0bf2f4f5a148e2b3aa831dccc6cb4c1ce4460ab386d3760a392
BLAKE2b-256 checksum
How to use checksums
59ce7945aaeb5c2367d2014ec9e2baeb8fdca4e77f244b08bdf9fd9376042c2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Release files / pykomfovent-1.0.2-py3-none-any.whl

Download URL pykomfovent-1.0.2-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a498ae7a5bb1b34cc4cc2220e4d28a6ef19a9eb98929d0143849cb62777e1710
BLAKE2b-256 checksum
How to use checksums
e5fab737037927908587ef3f903449c8bac52b308dbdfc8f18d60ed802180280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Security for pykomfovent 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pykomfovent-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page