Async Python library for BUVA QStream 2.0 ventilation fan control
Project description
QStream Python Library
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 statusawait client.get_air_quality()->int- Air quality indexawait client.get_nominal_flow()->str- Nominal flow rate (e.g., "70%")await client.get_datetime()->datetime- Device date/timeawait 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 timerawait 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 exceptionQStreamConnectionError- Cannot connect to deviceQStreamTimeoutError- Request timed outQStreamResponseError- 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40a7204ce2732763da17f4197a3df863dfcc94e619420f138eedc133b9a87a6
|
|
| MD5 |
7fb308658435651c0d152a712693fbc0
|
|
| BLAKE2b-256 |
3cbc145e8bcfb816683693c62bf1f474b545dceff2ca90a3181c12f5beafe024
|
Provenance
The following attestation bundles were made for qstream-0.2.0.tar.gz:
Publisher:
publish.yml on bramd/qstream-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qstream-0.2.0.tar.gz -
Subject digest:
a40a7204ce2732763da17f4197a3df863dfcc94e619420f138eedc133b9a87a6 - Sigstore transparency entry: 641190281
- Sigstore integration time:
-
Permalink:
bramd/qstream-python@b886042b9a1d05808416f88c5b32363110fb082d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/bramd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b886042b9a1d05808416f88c5b32363110fb082d -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12410ed8b3b7a68bc23dcea96b7b4ede12dcc4ed9c013d8aef0993953e5cadd3
|
|
| MD5 |
c5780e327001af45d265348b6825c12e
|
|
| BLAKE2b-256 |
ce7f948c44b1b85f7cc7bfa6ba316842270de815f864dda8833f3a06232642d9
|
Provenance
The following attestation bundles were made for qstream-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on bramd/qstream-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qstream-0.2.0-py3-none-any.whl -
Subject digest:
12410ed8b3b7a68bc23dcea96b7b4ede12dcc4ed9c013d8aef0993953e5cadd3 - Sigstore transparency entry: 641190282
- Sigstore integration time:
-
Permalink:
bramd/qstream-python@b886042b9a1d05808416f88c5b32363110fb082d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/bramd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b886042b9a1d05808416f88c5b32363110fb082d -
Trigger Event:
release
-
Statement type: