Python client for Komfovent C6 ventilation units
Project description
pykomfovent
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykomfovent-1.0.2.tar.gz.
File metadata
- Download URL: pykomfovent-1.0.2.tar.gz
- Upload date:
- Size: 80.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729043b4178de0bf2f4f5a148e2b3aa831dccc6cb4c1ce4460ab386d3760a392
|
|
| MD5 |
52978cb367f0715949678115d59cc6bf
|
|
| BLAKE2b-256 |
59ce7945aaeb5c2367d2014ec9e2baeb8fdca4e77f244b08bdf9fd9376042c2a
|
Provenance
The following attestation bundles were made for pykomfovent-1.0.2.tar.gz:
Publisher:
ci.yml on mostaszewski/pykomfovent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pykomfovent-1.0.2.tar.gz -
Subject digest:
729043b4178de0bf2f4f5a148e2b3aa831dccc6cb4c1ce4460ab386d3760a392 - Sigstore transparency entry: 844620126
- Sigstore integration time:
-
Permalink:
mostaszewski/pykomfovent@8bff7a0d412f21bb5cb77559ab2bd1be29bfb758 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/mostaszewski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@8bff7a0d412f21bb5cb77559ab2bd1be29bfb758 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pykomfovent-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pykomfovent-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a498ae7a5bb1b34cc4cc2220e4d28a6ef19a9eb98929d0143849cb62777e1710
|
|
| MD5 |
4cd491335fab28cb249ce526f91c4f8b
|
|
| BLAKE2b-256 |
e5fab737037927908587ef3f903449c8bac52b308dbdfc8f18d60ed802180280
|
Provenance
The following attestation bundles were made for pykomfovent-1.0.2-py3-none-any.whl:
Publisher:
ci.yml on mostaszewski/pykomfovent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pykomfovent-1.0.2-py3-none-any.whl -
Subject digest:
a498ae7a5bb1b34cc4cc2220e4d28a6ef19a9eb98929d0143849cb62777e1710 - Sigstore transparency entry: 844620130
- Sigstore integration time:
-
Permalink:
mostaszewski/pykomfovent@8bff7a0d412f21bb5cb77559ab2bd1be29bfb758 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/mostaszewski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@8bff7a0d412f21bb5cb77559ab2bd1be29bfb758 -
Trigger Event:
release
-
Statement type: