Skip to main content

Communicate with Skoda Connect

Project description

Version PyPi Downloads PyPi

Skoda Connect v1.0.30

Fork of https://github.com/robinostlund/volkswagencarnet where it was modified to support also Skoda Connect. Changes made to utilize the same API calls as the MySkoda mobile app.

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.

Breaking changes

Major code changes have been made to consolidate functions and also enable auxiliary climatisation for PHEV vehicles. Names have been changed to avoid confusion when working with the code.

  • From version 1.0.30 and onwards there might be breaking changes for the combustion heating/climatisation.

  • Parking Heater is the auxiliary/parking heater for non-PHEV vehicles. This uses the "legacy" remotestandheizung API function. Heating is what it sounds like and ventilation is used to ventilate/cool the car.

  • Auxiliary Heater is the auxiliary/parking heater for PHEV vehicles. This uses the climater API function, same as electric climatisation.

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',
}

RESOURCES = [
        - charging_cable_connected
        - charging_cable_locked
        - door_closed_left_front
        - door_closed_left_back
        - door_closed_right_front
        - door_closed_right_back
        - doors_locked
        - energy_flow
        - external_power
        - hood_closed
        - parking_light
        - request_in_progress
        - sunroof_closed
        - trunk_closed
        - trunk_locked
        - vehicle_moving
        - window_closed_left_front
        - window_closed_left_back
        - window_closed_right_front
        - window_closed_right_back
        - windows_closed
        - position
        - door_locked
        - trunk_locked
        - adblue_level
        - battery_level
        - charger_max_ampere
        - charging_time_left
        - climatisation_target_temperature
        - combined_range
        - combustion_range
        - electric_range
        - fuel_level
        - last_connected
        - last_trip_average_electric_consumption
        - last_trip_average_fuel_consumption
        - last_trip_average_speed
        - last_trip_duration
        - last_trip_length
        - odometer
        - oil_inspection_days
        - oil_inspection_distance
        - outside_temperature
        - parking_time
        - pheater_status
        - pheater_duration
        - request_results
        - requests_remaining
        - service_inspection_days
        - service_inspection_distance
        - auxiliary_climatisation
        - charging
        - climatisation_from_battery
        - electric_climatisation
        - force_data_refresh
        - parking_heater_heating
        - parking_heater_ventilation
        - window_heater
]

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.30.tar.gz (33.2 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.30-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skodaconnect-1.0.30.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for skodaconnect-1.0.30.tar.gz
Algorithm Hash digest
SHA256 2aacf2d49e3656c7e61f8e43c184564f7ebd3d1e16a03cf0aa29bd70acf5913d
MD5 1790a72973806c195b091a9c9f3765d3
BLAKE2b-256 bd979568774fe9431037618310bdf606d4f68da129d49747402c431b6451dbba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skodaconnect-1.0.30-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for skodaconnect-1.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 99beb82278c4acbcec95fd4e9ad925db28446fa595f60144eb5d407ff891e837
MD5 6da3d978ec74f1bf9bd75e76feac03c1
BLAKE2b-256 a87ccce6586885ce934e279cada9d507021f1303cbbe232b401913eec1a4a2dc

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