Skip to main content

Async Python library for BUVA QStream 2.0 ventilation fan control

Project description

QStream Python Library

CI codecov Python Version License: MIT

Async Python library for controlling BUVA QStream 2.0 WiFi-enabled ventilation fans via their HTTP API.

Features

  • Fully async API using aiohttp
  • Type-safe responses with dataclasses
  • Home Assistant compatible (external session support)
  • Complete error handling
  • Python 3.11+ with full type hints

Installation

Using uv:

uv add qstream

Using pip:

pip install qstream

Quick Start

import asyncio
from qstream import QStreamClient

async def main():
    async with QStreamClient("192.168.1.100") as client:
        # Get current status
        status = await client.get_status()
        print(f"Current speed: {status.actual_flow}%")
        print(f"Timer active: {status.timer_active}")

        # Check air quality
        aqi = await client.get_air_quality()
        print(f"Air quality index: {aqi}")

        # Set timer for 30 minutes at 75%
        await client.set_timer(duration_minutes=30, speed_percentage=75)

        # Cancel timer
        await client.cancel_timer()

if __name__ == "__main__":
    asyncio.run(main())

API Reference

QStreamClient

Initialization

client = QStreamClient(
    host="192.168.1.100",      # Device IP or hostname
    session=None,               # Optional aiohttp session
    timeout=10                  # Request timeout in seconds
)

Read Operations

  • await client.get_status() -> QStreamStatus - Complete device status
  • await client.get_air_quality() -> int - Air quality index
  • await client.get_nominal_flow() -> str - Nominal flow rate (e.g., "70%")
  • await client.get_datetime() -> datetime - Device date/time
  • await client.get_level(index) -> int - Preset level percentage (index 1-4)

Write Operations

  • await client.set_timer(duration_minutes, speed_percentage, demand_control=False) - Set timer
  • await client.cancel_timer() - Cancel active timer

QStreamStatus

Dataclass containing parsed device status:

@dataclass
class QStreamStatus:
    timer_active: bool
    timer_remaining_minutes: int | None
    schedule_enabled: bool
    schedule_remaining_minutes: int | None
    schedule_mode: ScheduleMode | None  # DAY or NIGHT
    analog_flow: int                     # 0-100
    set_flow: int                        # 0-100
    actual_flow: int                     # 0-100
    demand_control_enabled: bool
    valve_open: bool
    raw_value: str

Exceptions

  • QStreamError - Base exception
  • QStreamConnectionError - Cannot connect to device
  • QStreamTimeoutError - Request timed out
  • QStreamResponseError - Invalid response format

Home Assistant Integration

import aiohttp
from qstream import QStreamClient

# Share session with Home Assistant
async with aiohttp.ClientSession() as session:
    client = QStreamClient("192.168.1.100", session=session)
    status = await client.get_status()

Development

# Clone repository
git clone <repo-url>
cd qstream

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=qstream --cov-report=html

License

MIT

Credits

This library is not officially affiliated with BUVA. The API endpoints were discovered through community reverse engineering efforts.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qstream-0.2.0.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qstream-0.2.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file qstream-0.2.0.tar.gz.

File metadata

  • Download URL: qstream-0.2.0.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qstream-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a40a7204ce2732763da17f4197a3df863dfcc94e619420f138eedc133b9a87a6
MD5 7fb308658435651c0d152a712693fbc0
BLAKE2b-256 3cbc145e8bcfb816683693c62bf1f474b545dceff2ca90a3181c12f5beafe024

See more details on using hashes here.

Provenance

The following attestation bundles were made for qstream-0.2.0.tar.gz:

Publisher: publish.yml on bramd/qstream-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qstream-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: qstream-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qstream-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12410ed8b3b7a68bc23dcea96b7b4ede12dcc4ed9c013d8aef0993953e5cadd3
MD5 c5780e327001af45d265348b6825c12e
BLAKE2b-256 ce7f948c44b1b85f7cc7bfa6ba316842270de815f864dda8833f3a06232642d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for qstream-0.2.0-py3-none-any.whl:

Publisher: publish.yml on bramd/qstream-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page