Skip to main content

Communicate with Skoda Connect

Project description

Version PyPi Downloads Downloads PyPi

Skoda Connect v1.0.16

Fork of https://github.com/robinostlund/volkswagencarnet where it was modified to support also Skoda Connect

Information

Retrieve statistics about your Skoda from the Skoda Connect online service

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

Thanks to

  • RobinostLund for initial project for Volkswagen Carnet I was able to fork
  • Farfar for modifications related to electric engines
  • tanelvakker for modifications related to correct SPIN handling for various actions and using correct URLs also for MY2021

Other related repositories

Installation

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

Example

#!/usr/bin/env python3
import skodaconnect
import pprint
import asyncio
import logging

from aiohttp import ClientSession

logging.basicConfig(level=logging.DEBUG)

USERNAME='test@example.com'
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',
	'service_inspection_km',
    'oil_inspection',
	'oil_inspection_km',
    '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',
	'outside_temperature'
]

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 = skodaconnect.Connection(session, USERNAME, PASSWORD)
        if await connection._login():
            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())

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

skodaconnect-1.0.16.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

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

skodaconnect-1.0.16-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file skodaconnect-1.0.16.tar.gz.

File metadata

  • Download URL: skodaconnect-1.0.16.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for skodaconnect-1.0.16.tar.gz
Algorithm Hash digest
SHA256 df8d46ee94a13e77d437c66b9e67c6a43b8982b9449bd305c59f4c7170be5e82
MD5 3bce033899f2194f99812c0a89d60634
BLAKE2b-256 f33c7286f7f15f2dc0d9f0f34f08921e125257c3aaeca25d505911f5e82164c7

See more details on using hashes here.

File details

Details for the file skodaconnect-1.0.16-py3-none-any.whl.

File metadata

  • Download URL: skodaconnect-1.0.16-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for skodaconnect-1.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 fe22890a30226456a0e4f540bccc265e03768f6dfed646056c910cea5e56c32f
MD5 2d3211cb8d40f136003e527294e265eb
BLAKE2b-256 69dcd2be694e6916b674bf6683f0f18ecbc28124a6bd2a7da4375603ab8bc277

See more details on using hashes here.

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