Commandline script to interact with volkswagencarnet library

Overview

volkswagencarnet-client

command line script to interact with volkswagencarnet library

Table of Contents

General Information

The volkswagencarnet library retrieves statistics about your Volkswagen car from the Volkswagen Carnet online service. Also some actions can be requested via this library. This simple python script allows to use the library via command line and parameters list. In that way it can be used in an easy way e.g. in nodered with the exec node.

Setup

  • Just install the volkswagencarnet library
  • copy/download the script and put it whereever you want to use it from the command line
  • edit the credentials (user email, user password, SPIN) for your myvolkswagen account in the script

Usage

start from command line:

python3 carnet_cli.py 
    
     
     
      
e.g.
python3 carnet_cli.py 
      
        update
python3 carnet_cli.py 
       
         setrefresh python3 carnet_cli.py 
        
          setcharger 
         
           python3 carnet_cli.py 
          
            setchargercurrent <#ampere> python3 carnet_cli.py 
           
             setclimatisationtemp <#temperature> python3 carnet_cli.py 
            
              setclimatisation 
             
               <#temperature> 
              
                python3 carnet_cli.py 
               
                 setwindowheating 
                
                  python3 carnet_cli.py 
                 
                   setlock 
                  
                   " 
                  
                 
                
               
              
             
            
           
          
         
        
       
      
     
    
   

(vin: Vehicle ID, true: without external power; false: with charging cable only)

All output data are printed out in json format

Features

Currently the following actions are implemented:

  • update - get all available data of the car identified by the VIN (from VW backend only)
  • setrefresh - force the vehicle data update directly from the car
  • setcharger - start or stop charging
  • setchargercurrent - set the chargingcurrent
  • setclimatisationtemp - set the targettemperature for climatisation
  • setclimatisation - start or stop climatisation (for auxiliary heater SPIN needed)
  • setwindowheating - start or stop the window heating
  • setlock - lock or unlock your car (only when activated, SPIN needed)

In addition to the volkswagencarnet library the script gets the newest longtermtripstatistics.

Example for usage

Nodered example of course you have to do something in nodered to get such a dashboard ;-)

Acknowledgements

Project Status

It was developed to use the volkswagencarnet library in nodered. All basic (from my point of view) functions are implemented. However I have tested it only with an eGolf. Feel free to use it or improve it for combustion cars or other functionalities available in the volkswagencarnet library. No licence, public domain, no guarantees.

You might also like...
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

🌌 A Python script to generate blog banners from command line.
🌌 A Python script to generate blog banners from command line.

Auto Blog Banner Generator A Python script to generate blog banners. This script is used at RavSam. The following image is an example of the blog bann

Simple script to download OTA packages from Realme's endpoint.

Realme OTA Downloader CLI tool (based on this C# program) to create requests to the Realme's endpoint. Requirements Python 3.9. pycryptodome. Installa

A simple automation script that logs into your kra account and files your taxes with one command

EASY_TAX A simple automation script that logs into your kra account and files your taxes with one command Currently works for Chrome users. Will creat

Command-line script to upload videos to Youtube using theYoutube APIv3.

Introduction Command-line script to upload videos to Youtube using theYoutube APIv3. It should work on any platform (GNU/Linux, BSD, OS X, Windows, ..

Yet another bash/zsh prompt script
Yet another bash/zsh prompt script

Here we have yet another script for Git-aware customization of the command prompt in Bash and zsh. Unlike all the other scripts, I wrote this one, so

Python script to tabulate data formats like json, csv, html, etc

pyT PyT is a a command line tool and as well a library for visualising various data formats like: JSON HTML Table CSV XML, etc. Features Print table o

Ipylivebash - Run shell script in Jupyter with live output
Ipylivebash - Run shell script in Jupyter with live output

ipylivebash ipylivebash is a library to run shell script in Jupyter with live ou

Automaton - python script to execute bash command based on changes in size of a file.

automaton python script to execute given command = everytime size of a given file changes,hence everytime a file is modified.(almost) download automa

Comments
  • Node-red config

    Node-red config

    Hey, very I'm interested to create a dashboard like yours when I get my PHEV in march. I'm already running node-red for other home automation projects and would love to incorporate this in it as well. Your dashboard looks perfect! Would you mind sharing the node-red flows file for that page? What library do you use for visuals, node red dashboard?

    Thanks!

    I'm very interested in the feature to limit amps while charging to balance my draw from the grid and to optimize for direct usage of solar panels. I already have the monitoring in place so its an easy thing to do! Have you played around with this? What is the range (0-16 amps) And the resolution? (just integer or can you go into more precise)

    opened by Lars-the-tinkerer 4
  • Setlock (and other commands except update) return error

    Setlock (and other commands except update) return error

    Hello and first of all thanks for this excellent tool. We have 2019 Passat (not a hybrid) and ID.3 and was hoping to use this to integrate the Passat to my homeautomation system. Update function works fine, but if I e.g. try to use setlock I get:

    sudo python3 carnet_cli.py WVWZZZXXYYZZ setlock lock -vv
    DEBUG:vw_connection:Using service https://msg.volkswagen.de
    DEBUG:vw_connection:Initiating new login
    DEBUG:vw_connection:Got authorization endpoint
    DEBUG:vw_connection:Authenticating with email and password.
    DEBUG:vw_connection:Parsing login response.
    DEBUG:vw_connection:Login successful, received authorization code.
    DEBUG:vw_connection:Trying to fetch user identity tokens.
    DEBUG:vw_connection:User identity token verified OK.
    INFO:vw_connection:Successfully logged in
    DEBUG:vw_connection:Trying to fetch api tokens.
    DEBUG:vw_connection:VW-Group API token verified OK.
    DEBUG:vw_connection:Fetching vehicles associated with account
    DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
    DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles" returned with status code [200]
    DEBUG:vw_connection:Found vehicle(s) associated with account.
    WARNING:vw_connection:Could not update information: Invalid audience
    DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/api/rolesrights/authorization/v2/vehicles/WVWZZZXXXYYYZZZservices/rlu_v1/operations/LOCK/security-pin-auth-requested"
    ERROR:vw_connection:Got HTTP 400 "Bad Request" from server, this request might be malformed or not implemented correctly for this vehicle
    ERROR:vw_connection:Could not generate security token (maybe wrong SPIN?), error: 'securityPinAuthInfo'
    WARNING:vw_vehicle:Failed to lock vehicle - 'securityPinAuthInfo'
    Traceback (most recent call last):
      File "carnet_cli.py", line 153, in <module>
        loop.run_until_complete(main())
      File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
        return future.result()
      File "carnet_cli.py", line 131, in main
        response = await vehicle.set_lock(mode,spin)
      File "/usr/local/lib/python3.7/dist-packages/vw_vehicle.py", line 505, in set_lock
        raise Exception('Lock action failed')
    Exception: Lock action failed
    

    or with Climatization (not sure but here it could be that non-hybrid has only the auxiliary option and basically it is start/stop, you cannot e.g. set the temperature):

    sudo python3 carnet_cli.py WVWZZZXXXYYYZZZ setclimatisation auxiliary 21 true -vv
    DEBUG:vw_connection:Using service https://msg.volkswagen.de
    DEBUG:vw_connection:Initiating new login
    DEBUG:vw_connection:Got authorization endpoint
    DEBUG:vw_connection:Authenticating with email and password.
    DEBUG:vw_connection:Parsing login response.
    DEBUG:vw_connection:Login successful, received authorization code.
    DEBUG:vw_connection:Trying to fetch user identity tokens.
    DEBUG:vw_connection:User identity token verified OK.
    INFO:vw_connection:Successfully logged in
    DEBUG:vw_connection:Trying to fetch api tokens.
    DEBUG:vw_connection:VW-Group API token verified OK.
    DEBUG:vw_connection:Fetching vehicles associated with account
    DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
    DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles" returned with status code [200]
    DEBUG:vw_connection:Found vehicle(s) associated with account.
    WARNING:vw_connection:Could not update information: Invalid audience
    Traceback (most recent call last):
      File "carnet_cli.py", line 153, in <module>
        loop.run_until_complete(main())
      File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
        return future.result()
      File "carnet_cli.py", line 122, in main
        vehicle._states['climater']['settings']['targetTemperature']['content']=(float(argv[4])+273)*10
    KeyError: 'climater'
    

    I've checked and double-checked that SPIN is correct.

    opened by odelma 7
Owner
null
Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Tharuk Renuja 3 May 12, 2022
Tarstats - A simple Python commandline application that collects statistics about tarfiles

A simple Python commandline application that collects statistics about tarfiles.

Kristian Koehntopp 13 Feb 20, 2022
cli simple python script to interact with iphone afc api based on python library( tidevice )

afcclient cli simple python script to interact with iphone afc api based on python library( tidevice ) installation pip3 install -U tidevice cp afccli

fyst_14 2 Jul 15, 2022
Interact with Replit remotely with the Replit CLI

Replit CLI pip install repl-cli Welcome to Replit CLI! With the Replit CLI Application, you can work with your repls locally, including clone, pull,

Shuchir Jain 4 Aug 18, 2022
flora-dev-cli (fd-cli) is command line interface software to interact with flora blockchain.

Install git clone https://github.com/Flora-Network/fd-cli.git cd fd-cli python3 -m venv venv source venv/bin/activate pip install -e . --extra-index-u

null 14 Sep 11, 2022
A command line interface to interact with the Hypixel api allowing the user to get stats, leaderboards, etc

HyConsole is a way to get data on players and leaderboards from the Hypixel Minecraft server from the command line. Keep in mind I have no a

null 1 Feb 14, 2022
This is a Command Line program to interact with your NFTs, Cryptocurrencies etc

This is a Command Line program to interact with your NFTs, Cryptocurrencies etc. via the ThirdWeb Platform. This is just a fun little project that I made to be able to connect to blockchains and Web3 from the command line.

Arpan Pandey 5 Oct 2, 2022
The Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the targetPythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Boy From Future 15 Sep 16, 2022
A simple python script to execute a command when a YubiKey is disconnected

YubiKeyExecute A python script to execute a command when a YubiKey / YubiKeys are disconnected. ‏‏‎ ‎ How to use: 1. Download the latest release and d

null 6 Mar 12, 2022
A python script that enables a raspberry pi sd card through the CLI and automates the process of configuring network details and ssh.

This project is one script (wpa_helper.py) written in python that will allow for the user to automate the proccess of setting up a new boot disk and configuring ssh and network settings for the pi

Theo Kirby 6 Jun 24, 2021