Skip to main content

Volkswagen Carnet

buy me a coffee

Release PyPi Version CodeStyle Known Vulnerabilities CodeQL codecov

Downloads a day Downloads a week Downloads a month

Help Wanted

As i don't have a car with Volkswagen Connect anymore i would appreciate if it would be possible to get help to keep this repository maintained. So if you feel that you have some time over and is interested in helping out with this. Please feel to contact me! Thanks

Information

Retrieve statistics about your Volkswagen from the Volkswagen Carnet online service

No licence, public domain, no guarantees, feel free to use for anything. Please contribute improvements/bugfixes etc.

Thanks to

For supporting and helping in this project.

Installation

[venv-python3] user@localhost:~
$ pip install volkswagencarnet

Example

#!/usr/bin/env python3
from volkswagencarnet.vw_connection import Connection
import pprint
import asyncio
import logging

from aiohttp import ClientSession

logging.basicConfig(level=logging.DEBUG)

VW_USERNAME = "test@example.com"
VW_PASSWORD = "mysecretpassword"


COMPONENTS = {
    "sensor": "sensor",
    "binary_sensor": "binary_sensor",
    "lock": "lock",
    "device_tracker": "device_tracker",
    "switch": "switch",
    "climate": "climate",
}

RESOURCES = [
    "position",
    "distance",
    "electric_climatisation",
    "combustion_climatisation",
    "window_heater",
    "combustion_engine_heating",
    "charging",
    "adblue_level",
    "battery_level",
    "fuel_level",
    "service_inspection",
    "oil_inspection",
    "last_connected",
    "charging_time_left",
    "electric_range",
    "combustion_range",
    "combined_range",
    "charge_max_ampere",
    "climatisation_target_temperature",
    "external_power",
    "parking_light",
    "climatisation_without_external_power",
    "door_locked",
    "trunk_locked",
    "request_in_progress",
    "windows_closed",
    "sunroof_closed",
    "trip_last_average_speed",
    "trip_last_average_electric_consumption",
    "trip_last_average_fuel_consumption",
    "trip_last_duration",
    "trip_last_length",
    "trip_refuel_average_speed",
    "trip_refuel_average_electric_consumption",
    "trip_refuel_average_fuel_consumption",
    "trip_refuel_duration",
    "trip_refuel_length",
]


def is_enabled(attr):
    """Return true if the user has enabled the resource."""
    return attr in RESOURCES


async def main():
    """Main method."""
    async with ClientSession(headers={"Connection": "keep-alive"}) as session:
        connection = Connection(session, VW_USERNAME, VW_PASSWORD)
        if await connection.doLogin():
            if await connection.update():
                # Print overall state
                pprint.pprint(connection._state)

                # Print vehicles
                for vehicle in connection.vehicles:
                    pprint.pprint(vehicle)

                # get all instruments
                instruments = set()
                for vehicle in connection.vehicles:
                    dashboard = vehicle.dashboard(mutable=True)

                    for instrument in (
                        instrument
                        for instrument in dashboard.instruments
                        if instrument.component in COMPONENTS
                        and is_enabled(instrument.slug_attr)
                    ):
                        instruments.add(instrument)

                # Output all supported instruments
                for instrument in instruments:
                    print(f"name: {instrument.full_name}")
                    print(f"str_state: {instrument.str_state}")
                    print(f"state: {instrument.state}")
                    print(f"supported: {instrument.is_supported}")
                    print(f"attr: {instrument.attr}")
                    print(f"attributes: {instrument.attributes}")


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    # loop.run(main())
    loop.run_until_complete(main())

Development

I'd strongly advise installing the git pre-commit hook using pre-commit install. See pre-commit.com for details. Some basic checks are performed before you commit the code, so code style issues will be visible and fixable before creating the PR. Git pre-commit hooks can always be skipped using the --no-verify flag to git commit, if there is something preventing you from actually fixing the reported (and non-auto-fixed) issues.

Decent test coverage for any new or changed code is also much appreciated :)

Metadata

Release files for volkswagencarnet 5.5.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 volkswagencarnet 5.5.1
File Size Uploaded Provenance Actions
volkswagencarnet-5.5.1.tar.gz 93.2 kB With provenance Details for volkswagencarnet-5.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 163.8 kB

Release files / volkswagencarnet-5.5.1.tar.gz

Download URL volkswagencarnet-5.5.1.tar.gz
Size 93.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a6e822b273afec9d76e162ed23d342d74574e1c7486b1e98f477d469ef0c873e
BLAKE2b-256 checksum
How to use checksums
86ba3474d87d40b85da0b73b542177bc92587bdb4aa1a04a969395f299cb3832
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 17, 2026.

Transparency log

Release files / volkswagencarnet-5.5.1-py3-none-any.whl

Download URL volkswagencarnet-5.5.1-py3-none-any.whl
Size 70.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c9e0597183d2bf0311e330f61e260b001ce89bde6b4abda56a17527f2896c32
BLAKE2b-256 checksum
How to use checksums
eb3cb0889ba72162a9c04ae83b1b6fd85995cf621405dbb39f0dd951305ee29b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 17, 2026.

Transparency log

Security for volkswagencarnet 5.5.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for volkswagencarnet-5.5.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 Aug 17, 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.

Release history Release notifications | RSS feed

This release

5.5.1 This release

2 release files Full provenance

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