Skip to main content

Viessmann API Python Client

A Python library for accessing the Viessmann Climate Solutions API. Designed for integration with Home Assistant and other async Python applications.

Features

  • Asynchronous: Built on aiohttp and asyncio.
  • OAuth2 Authentication: Handles token retrieval and automatic renewal.
  • Auto-Discovery: Automatically finds installations, gateways, and devices.
  • Recursive Feature Flattening: Converts complex nested API responses into a simple, flat list of features (e.g., heating.circuits.0.heating.curve.shift).
  • Gateway-Scoped Refresh: Refreshes multiple known devices with one normal-case request while preserving partial successes.
  • Command Execution: Supports safe single-feature writes with automatic parameter resolution and explicit multi-parameter commands.
  • Fixture-backed Client: Runs the same client workflows against bundled real-device responses without authentication, sessions, or network requests.
  • Strictly Typed: Ships as a PEP 561 complete package with py.typed; the shipped code passes strict Pyright and dynamic values follow a typed JSON value contract.

Installation

Requires Python 3.14+. Install the released package from PyPI:

python3.14 -m venv .venv
source .venv/bin/activate
pip install vi_api_client

To work on the library itself, install it from a clone in editable mode:

git clone https://github.com/ignazhabibi/vi_api_client.git
cd vi_api_client
pip install -e .

Quick Start

Try it without an account

The library ships real device data, so you can run this right away:

import asyncio

from vi_api_client import FixtureViClient


async def main():
    client = FixtureViClient("Vitocal250A")

    installation = (await client.get_installations())[0]
    device = (await client.get_full_installation_status(installation.id))[0]

    outside = device.get_feature("heating.sensors.temperature.outside")
    if outside:
        print(f"Outside temperature: {outside.value} {outside.unit}")

    device = await client.set_feature(device, "heating.dhw.temperature.main", 50)


asyncio.run(main())

With your Viessmann account

Log in once with the CLI; it saves your tokens to tokens.json:

vi-client login --client-id <YOUR_CLIENT_ID>

Then use ViClient instead of FixtureViClient. Everything else stays the same:

import asyncio

import aiohttp

from vi_api_client import OAuth, ViClient


async def main():
    async with aiohttp.ClientSession() as session:
        auth = OAuth(
            client_id="YOUR_CLIENT_ID",
            redirect_uri="http://localhost:4200/",
            token_file="tokens.json",
            websession=session,
        )
        client = ViClient(auth)

        installation = (await client.get_installations())[0]
        device = (await client.get_full_installation_status(installation.id))[0]

        outside = device.get_feature("heating.sensors.temperature.outside")
        if outside:
            print(f"Outside temperature: {outside.value} {outside.unit}")

        device = await client.set_feature(device, "heating.dhw.temperature.main", 50)


asyncio.run(main())

CLI

vi-client list-devices
vi-client list-features --available --values
vi-client list-writable
vi-client --help

Documentation

The detailed documentation is available in the docs/ directory:

  1. Getting Started: Installation and First Steps.
  2. API Structure & Concepts: Understanding the Flat Architecture.
  3. Authentication & Connection: Tokens, Sessions, and Thread-Safety.
  4. Models Reference: Devices, Features, and Constraints.
  5. Client Reference: The ViClient class methods.
  6. CLI Reference: Using the command line interface.
  7. Exceptions Reference: Handling errors.
  8. Architecture Guide (for contributors): System structure, responsibilities, data flows, and diagrams explained for developers and non-specialists. Consumers can skip this page.

Public API

Import consumer-facing symbols from vi_api_client:

from vi_api_client import (
    AbstractAuth,
    DEFAULT_SCOPES,
    Device,
    ENDPOINT_AUTHORIZE,
    ENDPOINT_TOKEN,
    EventHistoryPage,
    EventHistoryWindow,
    Feature,
    FeatureConstraints,
    FeatureDeprecation,
    FeatureValue,
    Gateway,
    GatewayDeviceRefreshResult,
    Installation,
    InstallationEvent,
    JsonValue,
    FixtureViClient,
    OAuth,
    ScheduleConstraints,
    ValidationDetail,
    ViAuthError,
    ViClient,
    ViCommandRejectedError,
    ViConnectionError,
    ViDeviceCommunicationError,
    ViError,
    ViNotFoundError,
    ViRateLimitError,
    ViResponseError,
    ViServerInternalError,
    ViValidationError,
    format_feature,
    redact_device,
    redact_feature,
    redact_sensitive,
    validate_json_value,
)

DEFAULT_SCOPES, ENDPOINT_AUTHORIZE, and ENDPOINT_TOKEN support external OAuth integrations. JsonValue, FeatureValue, ValidationDetail, and validate_json_value form the public recursive JSON value contract that dynamic feature values and API validation details follow. redact_sensitive, redact_feature, and redact_device redact secrets, address data, identifiers, and coordinates in log text, API documents, and model objects. CLI helpers, transport details, persistence, and parsing remain available from their dedicated modules.

Development

See CONTRIBUTING.md for the development setup and the local quality gate.

Metadata

Release files for vi-api-client 7.1.1

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

Source distribution (sdist)

Source distribution for vi-api-client 7.1.1
File Size Uploaded Provenance Actions
vi_api_client-7.1.1.tar.gz 171.4 kB With provenance Details for vi_api_client-7.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 352.9 kB

Release files / vi_api_client-7.1.1.tar.gz

Download URL vi_api_client-7.1.1.tar.gz
Size 171.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b81a38f0a790f910fdde251a11bd605f520ecaf652080febc14d89c23853de6c
BLAKE2b-256 checksum
How to use checksums
b14cc53b216bb6bab4e3fd89762a2b4396f77db65a41135e5e7b7845fee5d753
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 Nov 14, 2026.

Transparency log

Release files / vi_api_client-7.1.1-py3-none-any.whl

Download URL vi_api_client-7.1.1-py3-none-any.whl
Size 181.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48c7284e24c9d1cf82ee1dd31ca23b1bbb48bbdd0c37a2ab0f37adbbafdd8fbc
BLAKE2b-256 checksum
How to use checksums
f0a09feb151df3a34453f0b0330abc904ef59dbcf9368e67a8c47002a6377b5f
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 Nov 14, 2026.

Transparency log

Security for vi-api-client 7.1.1

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 vi_api_client-7.1.1.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 Nov 14, 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