Skip to main content

A Python library to interact with the API behind the myVAILLANT app

Project description

myPyllant

PyPI GitHub Workflow Status

A Python library to interact with the API behind the myVAILLANT app (and branded versions of it, such as the MiGo app from Saunier Duval and Glow-worm). Needs at least Python 3.10.

[!WARNING]
This integration is not affiliated with Vaillant, the developers take no responsibility for anything that happens to your devices because of this library.

myPyllant

Install and Test

[!WARNING]

You need at least Python 3.10

pip install myPyllant

# Only on Windows, and other systems without a timezone database:
pip install tzdata

..or use Docker, if you just want to use it as a CLI tool:

docker run -ti ghcr.io/signalkraft/mypyllant:latest uv run -m myPyllant.export user password brand --country country

Usage

Exporting Data about your System

python3 -m myPyllant.export user password brand --country country
# See python3 -m myPyllant.export -h for more options and a list of countries

The --data argument exports historical data of the devices in your system. Without this keyword, information about your system will be exported as JSON.

Exporting Energy Reports

python3 -m myPyllant.report user password brand --country country
# Wrote 2023 report to energy_data_2023_ArothermPlus_XYZ.csv
# Wrote 2023 report to energy_data_2023_HydraulicStation_XYZ.csv

Writes a report for each heat generator, by default for the current year. You can provide --year to select a different year.

Using the API in Python

#!/usr/bin/env python3

import argparse
import asyncio
import logging
from datetime import datetime, timedelta

from myPyllant.api import MyPyllantAPI
from myPyllant.const import ALL_COUNTRIES, BRANDS, DEFAULT_BRAND

parser = argparse.ArgumentParser(description="Export data from myVaillant API   .")
parser.add_argument("user", help="Username (email address) for the myVaillant app")
parser.add_argument("password", help="Password for the myVaillant app")
parser.add_argument(
    "brand",
    help="Brand your account is registered in, i.e. 'vaillant'",
    default=DEFAULT_BRAND,
    choices=BRANDS.keys(),
)
parser.add_argument(
    "--country",
    help="Country your account is registered in, i.e. 'germany'",
    choices=ALL_COUNTRIES.keys(),
    required=False,
)
parser.add_argument(
    "-v", "--verbose", help="increase output verbosity", action="store_true"
)


async def main(user, password, brand, country):
    async with MyPyllantAPI(user, password, brand, country) as api:
        async for system in api.get_systems():
            if not system.zones:
                print(f"Skipping {system} because there are no active zones")
                continue
            print(await api.set_set_back_temperature(system.zones[0], 18))
            print(await api.quick_veto_zone_temperature(system.zones[0], 21, 5))
            print(await api.cancel_quick_veto_zone_temperature(system.zones[0]))
            setpoint = 10.0 if system.control_identifier.is_vrc700 else None
            print(
                await api.set_holiday(
                    system,
                    datetime.now(system.timezone),
                    datetime.now(system.timezone) + timedelta(days=7),
                    setpoint,  # Setpoint is only required for VRC700 systems
                )
            )
            print(await api.cancel_holiday(system))
            if system.domestic_hot_water:
                print(await api.boost_domestic_hot_water(system.domestic_hot_water[0]))
                print(await api.cancel_hot_water_boost(system.domestic_hot_water[0]))
                print(
                    await api.set_domestic_hot_water_temperature(
                        system.domestic_hot_water[0], 46
                    )
                )


if __name__ == "__main__":
    args = parser.parse_args()
    if args.verbose:
        logging.basicConfig(level=logging.DEBUG)
    asyncio.run(main(args.user, args.password, args.brand, args.country))

Tested Configurations

See https://github.com/signalkraft/mypyllant-component/blob/main/README.md#tested-setups

Contributing

[!WARNING]

You need at least Python 3.10 and uv installed

I'm happy to accept PRs, if you run the pre-commit checks and test your changes:

git clone https://github.com/signalkraft/myPyllant.git
cd myPyllant
uv tool install pre-commit --with pre-commit-uv
pre-commit install
uv run pytest

Contributing Test Data

Because the myVAILLANT API isn't documented, you can help the development of this library by contributing test data:

uv run -m myPyllant.tests.generate_test_data -h
uv run -m myPyllant.tests.generate_test_data username password brand --country country

..or use Docker:

docker run -v $(pwd)/test_data:/build/src/myPyllant/tests/json -ti ghcr.io/signalkraft/mypyllant:latest uv run -m myPyllant.tests.generate_test_data username password brand --country country

With docker, the results will be put into test_data/.

You can then either create a PR with the created folder, or zip it and attach it to an issue.

Acknowledgements

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

mypyllant-0.9.12.tar.gz (230.9 kB view details)

Uploaded Source

Built Distribution

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

mypyllant-0.9.12-py3-none-any.whl (164.1 kB view details)

Uploaded Python 3

File details

Details for the file mypyllant-0.9.12.tar.gz.

File metadata

  • Download URL: mypyllant-0.9.12.tar.gz
  • Upload date:
  • Size: 230.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mypyllant-0.9.12.tar.gz
Algorithm Hash digest
SHA256 587b0398639847f96e143bf91b329d5451553b43c7b06e0b86904d8a7d2f3e9e
MD5 06a2ab2a0498f55eecc1c50cf2fb9b98
BLAKE2b-256 adfbce5e843aaf1e77b58cee95c801c72d1d2c86f470e7b8fcb56873ea10b05f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mypyllant-0.9.12.tar.gz:

Publisher: build-test.yaml on signalkraft/myPyllant

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

File details

Details for the file mypyllant-0.9.12-py3-none-any.whl.

File metadata

  • Download URL: mypyllant-0.9.12-py3-none-any.whl
  • Upload date:
  • Size: 164.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mypyllant-0.9.12-py3-none-any.whl
Algorithm Hash digest
SHA256 b2fa3b883de1556aaca10962fffa490e19115e6798fab4fead9f426e5c74e53b
MD5 49624a02fd722ce330184f40cf6a2148
BLAKE2b-256 c7ed1d1bba52731b1ee72cf044a5ad477501f0682c86ead2651ff4f7c4847e77

See more details on using hashes here.

Provenance

The following attestation bundles were made for mypyllant-0.9.12-py3-none-any.whl:

Publisher: build-test.yaml on signalkraft/myPyllant

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