Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Duka Connect

An event-driven Python client for Duka One ventilation units on the local network, over the unit's own UDP protocol.

You subscribe to the values you care about and are told when one changes - with its quality, so "offline", "not on this unit" and a real value never look alike.

Supported units

Unit Status
Duka One (S6W, 50+) Untested: every point is from the manufacturer's connection guide, none read by this library yet

Every point is taken from the manufacturer's connection guide for the protocol, and has not been tested on a unit. point.certainty says so: REPORTED until a point has been read on a Duka One, VERIFIED after. Values may be wrong or missing; reports of what a unit shows are welcome. What each point is: docs/protocol.md; the manufacturer's documents themselves: docs/models.

Installation

pip install duka-connect

Everything you use comes from duka_connect; a simulated unit for your own tests is in duka_connect.testing. The library has no dependencies.

Usage

import asyncio
from duka_connect import Client, PointKey

def on_change(key, old, new):
    print(f"{key}: {new.value} ({new.quality.name})")

async def main():
    # The device id is in Duka's app; the password is 1111 unless it was changed there.
    client = Client("<unit-ip>", "<device-id>", "1111")
    await client.connect()              # reads every point once

    client.subscribe(PointKey.HUMIDITY, on_change)
    client.subscribe(PointKey.ALARM, on_change)
    client.subscribe(PointKey.RTC_BATTERY_VOLTAGE, on_change)

    while True:                         # you own the clock; the library owns the plan
        await client.poll()             # reads only what is due - free when nothing is
        await asyncio.sleep(1)

asyncio.run(main())

discover() lists the units that answer a broadcast, with their address and device id.

Values

Every value is a DataValue with .value, .quality, .timestamp, and .raw: the bytes the unit answered.

Quality Meaning
GOOD A value the unit answered.
NO_DATA The unit answered a number no state names.
STALE The last read failed; the value is the last good one.
OFFLINE The unit has not answered since the client connected.
MISSING The unit says it does not have this value.

A subscribed point is read on its poll rate: FAST 10 s, MEDIUM 30 s, SLOW 60 s, RARE 15 min, or STATIC, once when connecting. set_poll_interval(key, seconds) changes one.

Writing

from duka_connect import PointKey, Speed, VentilationMode

await client.write(PointKey.VENTILATION_MODE, VentilationMode.HEAT_RECOVERY)
await client.write_many([(PointKey.SPEED, Speed.MANUAL), (PointKey.MANUAL_SPEED, 120)])
await client.write(PointKey.RESET_FILTER_TIMER, None)   # a command

A value outside a point's limits raises InvalidValueError before anything is sent; a value the unit does not take raises WriteError.

Error Meaning
CannotConnectError The unit did not answer. A unit does not answer a wrong device id or password either.
UnsupportedDeviceError The unit answered, but not as a Duka One does.

Trying it on your unit

pip install -e . -r requirements-test.txt
DUKA_HOST=<unit-ip> DUKA_DEVICE_ID=<device-id> python -m pytest -m live -s

It only reads, and prints what the unit answers for every point.

License

MIT

Metadata

Release files for duka-connect 0.1.0rc1

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

Source distribution (sdist)

Source distribution for duka-connect 0.1.0rc1
File Size Uploaded Provenance Actions
duka_connect-0.1.0rc1.tar.gz 37.5 kB With provenance Details for duka_connect-0.1.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for duka-connect 0.1.0rc1
File Interpreter ABI Platform Actions
duka_connect-0.1.0rc1-py3-none-any.whl Python 3 none any Details for duka_connect-0.1.0rc1-py3-none-any.whl

Total release size: 58.5 kB

Release files / duka_connect-0.1.0rc1.tar.gz

Download URL duka_connect-0.1.0rc1.tar.gz
Size 37.5 kB
Tags Source
SHA-256 checksum
How to use checksums
693b12a5c56a4b7ddd0b63005cbf77cf9dbcfcb019f079727373bc7029279034
BLAKE2b-256 checksum
How to use checksums
0d5d5324891a9a4e1bafc4e50ff72ea152e322a01d9769027bf1d201216882c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Release files / duka_connect-0.1.0rc1-py3-none-any.whl

Download URL duka_connect-0.1.0rc1-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
869cfb912c857964f37cb3d5ef5fcb7ee09aa1fa52b1e8d3f336964348c6e17d
BLAKE2b-256 checksum
How to use checksums
95ed0c331c1b85ca929df4abca14802c4e07ad73ff68e17c25c10c1c0ba1980b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Security for duka-connect 0.1.0rc1

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 duka_connect-0.1.0rc1.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 Oct 25, 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.

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