Skip to main content

pywebasto

Current Release

Buy Me A Coffee

Python client for Webasto ThermoConnect devices.

The protocol is reverse engineered. There is no official Webasto API for this module.

Warning

USE THIS MODULE AT YOUR OWN RISK.

Installation

pip3 install pywebasto

Login

The preferred login is with an app client_id and client_secret.

import asyncio

from pywebasto import WebastoConnect


async def main() -> None:
    webasto = WebastoConnect(
        client_id="your-client-id",
        client_secret="your-client-secret",
    )

    try:
        await webasto.connect()

        for device in webasto.devices.values():
            print(f"{device.name}: {device.temperature}{device.temperature_unit}")
    finally:
        await webasto.close()


asyncio.run(main())

You can read the values after connect:

print(webasto.client_id)
print(webasto.client_secret)

Store them somewhere safe and reuse them next time.

The client is shown as Android 3.2.0 in Webasto's client list by default. If you want a custom name/version there, pass a short text with three parts. The first part is shown as the name, the second as the version, and the third must be an integer stamp:

webasto = WebastoConnect(
    client_id="your-client-id",
    client_secret="your-client-secret",
    client_info="my-client 1.0 0",
)

First Run With Email And Password

If you do not have app credentials yet, you can still start with email and password. The module will create an app client and save it if you give it a file path.

import asyncio

from pywebasto import WebastoConnect


async def main() -> None:
    webasto = WebastoConnect(
        username="your-email",
        password="your-password",
        credential_store_path="webasto_credentials.json",
    )

    try:
        await webasto.connect()

        print(webasto.client_id)
        print(webasto.client_secret)
    finally:
        await webasto.close()


asyncio.run(main())

Integrations that already have their own storage can use credential_load and credential_save instead of credential_store_path.

On first run, a device may need approval in the ThermoConnect app. If a device is waiting for approval, device.pending_approval is True. Approve it in the app and then call:

await webasto.update(force=True)

Email and password are still needed for:

  • first-time association when app credentials do not already exist
  • set_low_voltage_cutoff
  • set_temperature_compensation
  • webapi-only settings

When they are provided, connect() loads the webapi-only settings for each associated device. Settings writes reload those values from the webapi response.

Updates

Status is read from the app endpoint. Normal update() calls are cached for 60 seconds. One update reads all devices associated with the app client. It does not use webapi change_device.

await webasto.update()

Use force=True when you know you need fresh data:

await webasto.update(force=True)

Available Properties

Property Description Type
client_id App client id used for the current session str
client_secret Secret for the app client id str
temperature Measured temperature int
voltage Measured battery voltage float
location Vehicle location if enabled, otherwise False dict or bool
output_main Main output state bool
output_aux1 AUX1 output state bool
output_aux2 AUX2 output state bool
is_ventilation Main output is in ventilation mode bool
temperature_unit C or F display unit str
allow_location Location setting from webapi settings bool
low_voltage_cutoff Webapi low-voltage cutoff setting float
temperature_compensation Webapi temperature compensation setting float
device_id Device id str
name Device name str
pending_approval Device is waiting for app approval bool
association_status Raw app association status str
connection_lost Raw cloud link state bool
is_connected Derived cloud link state bool

Functions

Function Description
connect Set up app credentials and load devices
update Refresh all app devices, cached for 60 seconds unless force=True
get_timers Read simple timers for an output
save_timers Save the full simple timer list for an output
set_output_main Turn heater or ventilation output on/off
set_output_aux1 Turn AUX1 on/off
set_output_aux2 Turn AUX2 on/off
ventilation_mode Switch between heating and ventilation
associate_device Start association for a DeviceID and CheckID
association_status Read association status for a device
disassociate_device Remove this app client from a device
set_location_services Enable or disable location services
get_location_text Read raw /location2 text
set_low_voltage_cutoff Change low-voltage cutoff using webapi
set_temperature_compensation Change temperature compensation using webapi

Association

Manual association:

status = await webasto.associate_device(
    device_id="device-id-from-label",
    check_id="check-id-from-label",
)
print(status)

If you start with email/password and no app credentials, connect() creates an app client and starts association for webapi devices it can find. For accounts with more than one device, it may use webapi change_device during this bootstrap step to read each device's check_id.

The usual first status is pending. Approve the request in the ThermoConnect app, then refresh:

await webasto.update(force=True)

Timers

Timer support is for simple timers.

from pywebasto import SimpleTimer

timers = await webasto.get_timers(device)

new_timer = SimpleTimer(
    start=830,  # minutes after midnight UTC
    duration=5400,  # seconds
    repeat=31,  # Monday-Friday
    enabled=True,
)

await webasto.save_timers(device, timers + [new_timer])

save_timers() sends the full timer list. To edit or delete a timer, read the list, change it locally, and save the whole list again.

Weekday bitmask:

  • Monday = 1
  • Tuesday = 2
  • Wednesday = 4
  • Thursday = 8
  • Friday = 16
  • Saturday = 32
  • Sunday = 64

Examples:

  • repeat=31 means Monday-Friday
  • repeat=17 means Monday and Friday
  • repeat=0 means no repeat

Location

Use the app endpoint to enable or disable location services:

await webasto.set_location_services(device, True)

After enabling, the device can report WAITING_FOR_LOCATION until a fresh position is available.

Notes

  • Commands and normal status reads use the app backend.
  • Email/password login uses the older webapi only when it is needed.
  • Command writes are not retried automatically.
  • Rate-limited responses raise an exception.

Metadata

Release files for pywebasto 3.0.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 pywebasto 3.0.1
File Size Uploaded Provenance
pywebasto-3.0.1.tar.gz 29.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pywebasto 3.0.1
File Interpreter ABI Platform
pywebasto-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 58.5 kB

Release files / pywebasto-3.0.1.tar.gz

Download URL pywebasto-3.0.1.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e80a38431f2cda722ed96ea6cb6b3e3a5ad70876d34fba905bae4f13b2caa66b
BLAKE2b-256 checksum
How to use checksums
c44b45c0aa67fb45baa4134c4a3eaa95703a784290b564500a6df78da488e8d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / pywebasto-3.0.1-py3-none-any.whl

Download URL pywebasto-3.0.1-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2018aed2c293854663b3e94fc94d6c63dce0df6ccdfae900040d64b596d773af
BLAKE2b-256 checksum
How to use checksums
4bca979839f43ea8e87f082525e8094c59743fd8aa149b7493bee50879b8c4c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.3 CPython/3.12.3 Linux/6.17.0-1022-azure

Security for pywebasto 3.0.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.

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