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.1.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.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qstream-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 46f92d5b3513c5baf121b75126f8eec383ae812f225f461bd64de2bcca1bd304
MD5 1127cb207b5f3e2d3c0e19a4c9321163
BLAKE2b-256 58e0f5e0a85844fd1e1efe7bdd0aa97bbeaafb5f3e96bca9b2a530f1273677a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qstream-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: qstream-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3188e9bcf7f80fa76bbe6b2469b89518a8b98d3d60fbb07c59946aeb8c3fb805
MD5 658647a0f2cc2670c33c481a06eeb56f
BLAKE2b-256 6b2319afd15832ce6226b6a852eed4e925acae1bf79b0c0f36fbedfc49d252fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for qstream-0.1.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