Skip to main content

prana-local-api-client

An asynchronous Python client for the local HTTP API of Prana devices.

This library provides a small, well-documented async client to read the device state and control Prana recuperators over a local network using HTTP.

Quick links

  • Installation: see the Installation section
  • Quick start: see Quick example (async)
  • API reference: see API / Methods

Requirements

  • Python 3.10+
  • aiohttp

Firmware compatibility

⚠️ This client works only with Prana recuperators running firmware 47+.

To check firmware: open the Prana Online 2.0 app → press and hold the device card → About Device.

Table of contents

  • Features
  • Installation
  • Quick example (async)
  • API / Methods
  • Data models
  • Exceptions
  • License

Features

  • Fetch device information (get_device_info).
  • Retrieve structured device state (get_state) as PranaState / FanState.
  • Control fan speed, toggles, and brightness (set_speed, set_switch, set_brightness).
  • Fully asynchronous (asyncio + aiohttp).
  • Helpful model parsing (e.g., temperature reported in tenths of °C is normalized).

Installation

Install from PyPI:

pip install prana-local-api-client

From a local checkout (editable, with dev extras):

pip install -e .[dev]

Quick example (async)

import asyncio
from prana_local_api_client.prana_local_api_client import PranaLocalApiClient
from prana_local_api_client.models.prana_fan_type import PranaFanType
from prana_local_api_client.models.prana_switch_type import PranaSwitchType


async def main():
    # Device IP and optional port
    async with PranaLocalApiClient("192.168.1.100", port=80) as client:
        info = await client.get_device_info()
        print("Device:", info.to_dict())

        state = await client.get_state()
        print("State:", state.to_dict())

        # NOTE: the device expects speed values scaled by 10. For example,
        # to set speed '1' pass 10, for speed '3' pass 30.
        await client.set_speed(30, fan_type=PranaFanType.EXTRACT.value)

        # Enable a switch (e.g. BOOST)
        await client.set_switch(PranaSwitchType.BOOST.value, True)

        # Set backlight brightness (0-100)
        await client.set_brightness(50)

asyncio.run(main())

API / Methods

Top-level client: PranaLocalApiClient (module: prana_local_api_client.prana_local_api_client).

  • PranaLocalApiClient(host: str, port: int = 80) — create client instance.
  • async with PranaLocalApiClient(...) as client: — context manager that opens/closes an aiohttp.ClientSession.
  • get_device_info() -> PranaDeviceInfo — returns device info as a PranaDeviceInfo.
  • get_state() -> PranaState — returns the current device state as a PranaState.
  • set_speed(speed: int, fan_type: str) — set fan speed; fan_type is one of: supply, extract, bounded (10, 20, 30 ... 100).
  • set_switch(switch_type: PranaSwitchType, value: bool) — toggle a switch; use PranaSwitchType values.
  • set_brightness(brightness: int) — set panel/backlight brightness (0, 1, 2, 4, 8, 16, 32).
  • set_speed_is_on(speed_is_on: bool, fan_type: str) — enable/disable speed for a fan type.

Data models

Models are defined in prana_local_api_client.models and provide from_dict helpers:

  • PranaDeviceInfo — fields: manufactureId, isValid, fwVersion, pranaModel, label.
  • PranaState — contains extract, supply, bounded (FanState) plus flags and optional sensor fields (inside_temperature, outside_temperature, humidity, co2, etc.).
  • FanState — speed, is_on, max_speed.

Notes on parsing

  • Temperatures are often reported by the device in tenths of °C; PranaState.from_dict converts these to °C floats.
  • PranaDeviceInfo.from_dict handles numeric strings and byte values for firmware/model fields.

Exceptions

Defined in prana_local_api_client.models.exceptions:

  • PranaApiClientException — base exception class.
  • PranaApiCommunicationError — network/timeout related errors.
  • PranaApiUpdateFailed — HTTP error returned by device (status != 200).
  • UpdateFailed — wrapper for higher-level update failures.
  • ValueError — invalid values encountered.

Wrap client calls in try/except and handle these exceptions depending on your application needs.

Metadata

Release files for prana-api-client 0.12.0

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

Source distribution (sdist)

Source distribution for prana-api-client 0.12.0
File Size Uploaded Provenance Actions
prana_api_client-0.12.0.tar.gz 7.7 kB Without provenance Details for prana_api_client-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prana-api-client 0.12.0
File Interpreter ABI Platform Actions
prana_api_client-0.12.0-py3-none-any.whl Python 3 none any Details for prana_api_client-0.12.0-py3-none-any.whl

Total release size: 17.4 kB

Release files / prana_api_client-0.12.0.tar.gz

Download URL prana_api_client-0.12.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c281116341fdb3c3facf7ef96b1ccfcf69395566f4c5126d59c02e5ad2c5b495
BLAKE2b-256 checksum
How to use checksums
2e3958aa530dbada3d38aed642d9beccfcfa7d7eb2f00d8e41285e22706cab58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / prana_api_client-0.12.0-py3-none-any.whl

Download URL prana_api_client-0.12.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de7e4809fb7f99d476d5bfb77a16aa5ca33b3ba9324804e9da1bdb0f193fb780
BLAKE2b-256 checksum
How to use checksums
d80a3b855ac81e17246ed6974bef72b584dc79f968889f608c5a05f6b86faa48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for prana-api-client 0.12.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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