GithubHelp home page GithubHelp logo

tillsteinbach / weconnect-cli Goto Github PK

View Code? Open in Web Editor NEW
56.0 6.0 3.0 164 KB

Commandline Interface to interact with the Volkswagen WeConnect Services

License: MIT License

Makefile 2.15% Python 97.85%
volkswagen volkswagen-carnet volkswagen-weconnect carnet weconnect telemetry telemetry-data telemetry-client command-line command-line-tool

weconnect-cli's Introduction

WeConnect-cli

GitHub sourcecode GitHub release (latest by date) GitHub GitHub issues PyPI - Downloads PyPI - Python Version Donate at PayPal Sponsor at Github

Commandline Interface to interact with the Volkswagen WeConnect Services

What is the purpose?

If you want to query data from weconnect you can use this command line interface to query the service. This commandline interface behaves like a user using the WeConnect ID App and the WeConnect secion on myvolkswagen.de. Use this if you want to work with the data from WeConnect.

Requirements

You need to install python 3 on your system: How to install python. The minimum required python version is 3.8

Login & Consent

WeConnect-cli is based on the new WeConnect API that was introduced with the new series of ID cars. If you use another car or hybrid you probably need to agree to the terms and conditions of the new WeConnect interface. Easiest to do so is by installing the Volkswagen app on your smartphone and login there. If necessary you will be asked to agree to the terms and conditions.

How to install

If you want to use WeConnect-cli, the easiest way is to obtain it from PyPI. Just install instead using:

pip3 install weconnect-cli

Updates

If you want to update WeConnect-cli, the easiest way is:

pip3 install weconnect-cli --upgrade

How to use

Start weconnect-cli from the commandline, by default you will enter the interactive shell:

weconnect-cli --username [email protected] --password test123

You get all the usage information by using the --help command

weconnect-cli --help

With the "list" command you can get a list of all available information you can query (use "list -s" if you want to see which attributes can be changed)

weconnect-cli --username [email protected] --password test123 list
/vehicles/WVWABCE1ZSD057394
/vehicles/WVWABCE1ZSD057394/vin
/vehicles/WVWABCE1ZSD057394/role
/vehicles/WVWABCE1ZSD057394/enrollmentStatus
/vehicles/WVWABCE1ZSD057394/model
/vehicles/WVWABCE1ZSD057394/nickname
/vehicles/WVWABCE1ZSD057394/capabilities
...

You can then pass the addresses to the "get" command:

weconnect-cli --username [email protected] --password test123 get /vehicles/WVWABCE1ZSD057394/model
ID.3

or the "set" command:

weconnect-cli --username [email protected] --password test123 set /vehicles/WVWABCE1ZSD057394/controls/climatisation stop

The "events" command allows you to monitor what is happening on the WeConnect Interface:

weconnect-cli --username [email protected] --password test123 events
2021-05-26 16:49:58.698570: /vehicles/WVWABCE1ZSD057394/access/accessStatus/overallStatus: new value: unsafe
2021-05-26 16:49:58.698751: /vehicles/WVWABCE1ZSD057394/access/accessStatus/doors/bonnet/lockState: new value: unknown lock state
2021-05-26 16:49:58.698800: /vehicles/WVWABCE1ZSD057394/access/accessStatus/doors/bonnet/openState: new value: closed
2021-05-26 16:49:58.698980: /vehicles/WVWABCE1ZSD057394/access/accessStatus/doors/frontLeft/lockState: new value: unlocked
2021-05-26 16:49:58.699056: /vehicles/WVWABCE1ZSD057394/access/accessStatus/doors/frontLeft/openState: new value: closed

S-PIN

For some commands (e.g. locking/unlocking supported on some cars) you need in addition to your login the so called S-PIN, you can provide it with the -s option:

weconnect-cli --username [email protected] --password test123 -s 1234 set /vehicles/WVWABCE1ZSD057394/controls/access lock

Charging Stations

To obtain data for charging stations you have to add a location to search for in geo coordinates and a search radius in meters:

weconnect-cli --chargingLocation 52.437132 10.796628 --chargingLocationRadius=500 get /chargingStations
ID:                  40a4b8d3-d534-422c-9cd8-81bbfa5b578f
Name:                VW Group Oebisfelder Straße Parkhaus Ost
Operator:            VW Group (Id: edd03be9-2df7-4fe3-be32-1573ba91aac0)
Latitude:            52.4370178
Longitude:           10.7977292
Distance:            76m
Address:             Oebisfelder Straße 1, 38448 Wolfsburg, Deutschland
Max. Charging Power: 50.0kW
Charging Spots: 2 items
	Availability: OCCUPIED
	Max. Charging Power: 22.0kW
	Connectors: 1 items
		Plug Type: Type2
		Max. Charging Power: 22.0kW

	Availability: AVAILABLE
	Max. Charging Power: 50.0kW
	Connectors: 1 items
		Plug Type: CCS
		Max. Charging Power: 50.0kW

Authentification:    RFID, APP, UNKNOWN, UNKNOWN
Options:             weCharge partner;

Interactive Shell

You can also use an interactive shell:

weconnect-cli --username [email protected] --password test123 shell
Welcome! Type ? to list commands
[email protected]@weconnect-sh:/$update
update done
[email protected]@weconnect-sh:/$cd vehicles
[email protected]@weconnect-sh:/vehicles$ ls
..
WVWABCE1ZSD057394
WVWABCE13SD057505
[email protected]@weconnect-sh:/vehicles$ cd /vehicles/WVWABCE13SD057505/status/parkingPosition
[email protected]@weconnect-sh:/vehicles/WVWABCE13SD057505/status/parkingPosition$ cat
[parkingPosition] (last captured 2021-06-01T19:05:04+00:00)
	Latitude: 51.674535
	Longitude: 16.154376
[email protected]@weconnect-sh:/vehicles/WVWABCE13SD057505/parking/parkingPosition$ exit
Bye

Caching

By default weconnect-cli will cache (store) the data for 300 seconds before retrieving new data from the servers. This makes weconnect-cli more responsive and at the same time does not cause unneccessary requests to the vw servers. If you want to increase the cache duration use --interval option. If you do not want to cache use --no-cache option. Please use the no-cache option with care. You are generating traffic with subsequent requests.

Credentials

If you do not want to provide your username or password all the time you have to create a ".netrc" file at the appropriate location (usually this is your home folder):

machine volkswagen.de
login [email protected]
password testpassword123

You can also provide the location of the netrc file using the --netrc option

The optional S-PIN needed for some commands can be provided in the account section:

# For WeConnect
machine volkswagen.de
login [email protected]
password testpassword123
account 1234

Images

You can also work with images from the API Either you have a look at the commandline

weconnect-cli get /vehicles/WVWABCE13SD057505/pictures/car
                                     zjo]?![[[[]!!??I*{{rlllcc?uzo7zjjuunT#Jwfy25Fmd
                                *JywJ##TTuua]1t7LLjLLLjz7ot[Ir]att11[[aaeeeeoooeozjzet[>
                             1T2p6p5Fmh4Jeut1eoeLT#nL1ou##jeLne]!]!1j[[][[[[[]]I}I][1tee?
                         =[nypmqgdXbbYgzaTuTfzI}}}I!t}jTwjjJL}llllc}Tz?I*}}*****ssr*}}I[1[l
                     rcsoCF6pmgddVhgg6aaCL1##1IIIIII}!ettTwt%%v%cr?]{eI{v%cccllrrrsr*I??aw!}
              Q@GEVgqTnw2yw##TTuuLjj7oaat[]!?IIIIII??!!!7nt{>="i%c{![oea[[taeeeeeeet1eeeetta]i
        a7uJCJ#nLjz7ot1]!?II}**{{srlllrs*}}}}}I?]1e7juLLLLzL1%}1[11teat!rI?I*{srlccvccls{{srri:
    ufzx%lrcv)<\)||"""""|||)\\<<>)%l{**{rs}[7u#TuLz77zjuTL7]I{lx%vi><<\)ii\\\\\\\\\<>>%rss*{cv"
  Ypje{cx%%%%%%v%xxxcccllrs{*?[ezLuTJwf36dGdFw6Vg#Ii\\)xlxi|///////////////////////++++;_'^\v)"
  Y&&F7t!I!?!?t1jt[[1ttttaju5hggV&DkgpdBDXSo}?ttr";:_..-^"|/==^^^^^^^^^;^;;;;;;;;;;;;^">i|__/\/
 #L#e]1*%v%ii\v<\>>ii%v%xclI1e1ajhZFuo#hS#[II*v/)l***c\,`:^^;;;;;;;;;;;;;^^^^==++/=,;/%s][c:;=^
33]||vrr***{*{{rxllrrrrrsrlrllrs{{{{***}I?}r%<"%r1}]ts]{\_;;;===++////""""""||||||/;^){s![!\"}r
]z}i:,:\EGPE6q6VE44d};^==^^=+/"|\ir*?!1tsc)|/=c1?*I]![[?{\,+""/////""|)\<>)vxcrs{***>)!?*}[%{oe
=/"\=^'^t77joo7nJwfyc_'::^+""|)\>%}????#a=""+/!I!*r1nIs!tv|<vxlr{*}I??!???}*{rlxv)<|^|]u{}7%?
>wt)=+^_-` `. .   . ._``://"/""|)\)ls{}!d{;\i%]!aos{e[*e7vl**{srlc%%vii))>><<\\/^;^^=/%1!oI"
 Ewz[><<<<<>)%{{srcv)v))vlrsrrrlll*e7zz7ei)I]{Ia71e{}IjT?)^;,:'_-`.              -^+///>xi/
   .g `:;==/\l[1[I%<)""""+///"||)|+====+="||/"v?l*e]]nf?|`                         `_:,'-
        `_''''':'_.                       -;+|\<vs*?Ic<^
                                            `:^^^=+=^:

but it makes more sense to save the image to a file:

weconnect-cli save /vehicles/WVWABCE13SD057505/pictures/car car.png
ls -alh car.png
-rw-r--r--  1 tillsteinbach  staff   135K  5 Jul 15:07 car.png

If there is information regarding door, light and window status provided for your car you can also use the 'status' picture

Disabling features

You can disable data for the cars capabilities with --no-capabilities If you only need a subset of the data you can use the --selective option. E.g. --selective climatisation

Tested with

  • Volkswagen ID.3 Modelyear 2021
  • Volkswagen Passat GTE Modelyear 2021

Reporting Issues

Please feel free to open an issue at GitHub Issue page to report problems you found.

Known Issues

  • The Tool is in alpha state and may change unexpectedly at any time!

Related Projects:

  • WeConnect-MQTT: MQTT Client that publishes data from Volkswagen WeConnect
  • WeConnect-python: Python API to connect to Volkswagen WeConnect Services
  • VWsFriend: VWsFriend is a software to visualize and record statistics of your car and allows control via HomeKit

Seat, Cupra, Skoda IV, ...

In an effort to try to make WeConnect-cli also to work with latest generation of vehicles from other volkswagen brands I'm looking for users to temporarily share access to their accounts. If you are willing to support please send me a message.

  • Already tried: Cupra Born (The API looks a bit different, maybe it is older, I will check again in some weeks), thanks to the user initdebugs

weconnect-cli's People

Contributors

dependabot[bot] avatar tillsteinbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

weconnect-cli's Issues

error 4112, capability is missing info

When running the example for getting the parking position, I get an error message instead:

$cat /vehicles/WVWZZZE1ZMP00xxxx/status/parkingPosition
...
[parkingPosition]
Error: Error 4112: The capability for the requested operation is missing info: Internal error, please try again later. If the problem persists, please contact our support.

What exactly is missing there?

Seems to be not working since 2 or 3 days...

I get this error when trying to connect, no problem with Trinity or the wechargeid app
weconnect-cli --username xxxxxx --password xxxxx list
CRITICAL:weconnect-cli:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: No credentials form found

Best

Philippe

Does this not work for Cupra Born?

I try to log in with the valid credentials that work fine with the mycupra app. But I get this response:

CRITICAL:There was a problem when authenticating with WeConnect: Error during login, account [email protected]  does not exist

(where the x's are my actual email address used for login).

isActive flag disappeared

The isActive entry disappeared from the readynessStatus --> ConnectionState . Is this information available somewhere else now?

Aufruf der CLI funktioniert nicht mehr

Zuerst dachte ich, der Fehler hängt mit dem aktuellen Update der CLI zusammen. Allerdings tritt das neuerdings auch mit 0.38.2 auf. Kann keinen Befehl mehr ausführen – weder list, noch set auf eine Ressource.

 p-j58p0z @  [a-vwxfmm]  ~/files  weconnect-cli --username [email protected] --password secure list
Traceback (most recent call last):
  File "/files/.mwsoftware/python/pip/bin/weconnect-cli", line 8, in <module>
    sys.exit(main())
  File "/files/.mwsoftware/python/pip/weconnect_cli/weconnect_cli_base.py", line 223, in main
    weConnect.update(updateCapabilities=(not args.noCapabilities), updatePictures=(not args.noPictures), selective=args.selective)
  File "/files/.mwsoftware/python/pip/weconnect/weconnect.py", line 194, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/weconnect.py", line 216, in updateVehicles
    vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict, fixAPI=self.fixAPI,
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 133, in __init__
    self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 227, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 355, in updateStatus
    self.domains[domain.value][key] = className(vehicle=self, parent=self.domains[domain.value], statusId=key,
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 24, in __init__
    super().__init__(vehicle=vehicle, parent=parent, statusId=statusId, fromDict=fromDict, fixAPI=fixAPI)
  File "/files/.mwsoftware/python/pip/weconnect/elements/generic_status.py", line 38, in __init__
    self.update(fromDict=fromDict)
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 47, in update
    self.nextChargingTimer = ChargingProfiles.NextChargingTimer(parent=self, fromDict=fromDict['value']['nextChargingTimer'])
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 242, in __init__
    self.update(fromDict)
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 248, in update
    self.timer = self.parent.profiles[fromDict['id']]
KeyError: 0

Exception ObserverPriority

I had the cli running with the events command and got the following exception:

Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\Scripts\weconnect-cli.exe\__main__.py", line 7, in <module>
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect_cli\weconnect_cli.py", line 208, in main
    weConnect.update()
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\weconnect.py", line 415, in update
    self.__vehicles[vin].update(fromDict=vehicleDict, updateCapabilities=updateCapabilities)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 117, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 154, in updateStatus
    self.statuses[key].update(fromDict=data['data'][key])
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 1148, in update
    self.targetTemperature_K.setValueWithCarTime(
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\addressable.py", line 174, in setValueWithCarTime
    self.notify(flags)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\addressable.py", line 49, in notify
    observers = self.getObservers(flags)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\addressable.py", line 34, in getObservers
    return [observerEntry[0] for observerEntry in self.getObserverEntries(flags)]
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\addressable.py", line 46, in getObserverEntries
    return sorted(observers, key=lambda entry: entry[2])
TypeError: '<' not supported between instances of 'ObserverPriority' and 'ObserverPriority'

Output format JSON

Hi Till
Thanks for the great tool! Would it be possible to add an option to retrieve the output in JSON format? Especially for status information this would be really great.
BR
Markus

Error message: No credentials form found

Command:
weconnect-cli --username [email protected] --password VerySecret

Give error message:
2023-01-05:CRITICAL:weconnect-cli:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: No credentials form found

The email is a @t-online.de (--> is the "-" a problem?) and the password includes a "!" and a "?" (--> seems to be no problem, a change led to the same error message).

Running Python 3.6.3; car is ID3, access both for IOS and Android weconnect Apps run fine.

Crash after logging in

I just installed the WeConnect CLI and get the following error when I try to logon with:
weconnect-cli --username xxxx --password yyyyy
I am running Ubuntu 18.04 and have python 3.6.9 installed.

file "/home/stephan/.local/lib/python3.6/site-packages/weconnect/util.py", line 11, in robustTimeParse
    return datetime.fromisoformat(timestring)
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'

KeyError: 'car_birdview'

Traceback (most recent call last):
File "/usr/local/bin/wc-cli", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/weconnect_cli/weconnect_cli.py", line 185, in main
weConnect.update(updateCapabilities=(not args.noCapabilities), updatePictures=(not args.noPictures))
File "/usr/local/lib/python3.8/site-packages/weconnect/weconnect.py", line 419, in update
self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force)
File "/usr/local/lib/python3.8/site-packages/weconnect/weconnect.py", line 457, in updateVehicles
vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict,
File "/usr/local/lib/python3.8/site-packages/weconnect/elements/vehicle.py", line 67, in init
self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures)
File "/usr/local/lib/python3.8/site-packages/weconnect/elements/vehicle.py", line 167, in update
self.updatePictures()
File "/usr/local/lib/python3.8/site-packages/weconnect/elements/vehicle.py", line 389, in updatePictures
self.updateStatusPicture()
File "/usr/local/lib/python3.8/site-packages/weconnect/elements/vehicle.py", line 392, in updateStatusPicture
img = self.__carImages['car_birdview']
KeyError: 'car_birdview'

Possibility to get service information

Hi,

In we connect app for Golf GTE (not we connect ID), we can get the "service" information.
Any way to have this information on your plugin ?

Thanks in advance !

how to set climatisationTimer?

I want to change the climatisationTimer of my ID.4 as the same is possible in the WeConnect ID App.
But the path /vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers is read only.
Any idea how to change the climatisationTimer ?

Climatisation does not start

Hi dev,

Thanks for all the work on the CLI!

I'm trying to start the climatisation from the command line for my ID.4, but it does not start and i dont get any feedback why not:
weconnect-cli --username XXXXX --password XXXXXX set /vehicles/WVGZZZE2ZMXXXXX/controls/climatisation start

I do get a message when i use the wrong command (not stop or start).

cannot "cd" to a node with numeric name

Nice tool, but I have a small problem:
My ID.4 has numeric nodes in the climatisationTimer tree:

I can list the nodes with find:

user@domain@weconnect-sh:/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers$find
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/1
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/1/enabled
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/1/singleTimer
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/1/singleTimer/startDateTime
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/2
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/2/enabled
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/2/singleTimer
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers/2/singleTimer/startDateTime

But I cannot "cd" into it:
user@domain@weconnect-sh:/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers$cd 1
*** 1 does not exist
user@domain@weconnect-sh:/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers$pwd
/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers

reading the whole tree content with cat does work:
user@domain@weconnect-sh:/vehicles/WVGZZZE2ZXXXXXXX/status/climatisationTimer/timers$cat
[1: Enabled: False at 2021-11-14T07:25:00+00:00 , 2: Enabled: True at 2021-11-19T16:35:00+00:00 ]

Getting data fails

This is what I just got:

Traceback (most recent call last):
File "/usr/local/bin/wc-cli", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/weconnect_cli/weconnect_cli.py", line 158, in main
weConnect.update()
File "/usr/local/lib/python3.8/site-packages/weconnect/weconnect.py", line 414, in update
vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict,
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 49, in init
self.update(fromDict)
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 146, in update
self.updateStatus(updateCapabilities=updateCapabilities, force=force)
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 214, in updateStatus
self.statuses[status] = keyClassMap[status](vehicle=self, parent=self.statuses, statusId=status,
KeyError: 'chargeMode'
Traceback (most recent call last):
File "/usr/local/bin/wc-cli", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/weconnect_cli/weconnect_cli.py", line 158, in main
weConnect.update()
File "/usr/local/lib/python3.8/site-packages/weconnect/weconnect.py", line 414, in update
vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict,
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 49, in init
self.update(fromDict)
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 146, in update
self.updateStatus(updateCapabilities=updateCapabilities, force=force)
File "/usr/local/lib/python3.8/site-packages/weconnect/elements.py", line 214, in updateStatus
self.statuses[status] = keyClassMap[status](vehicle=self, parent=self.statuses, statusId=status,
KeyError: 'chargeMode'

Any ideas?

is it possilbe to set climatisation with an temperatur as parameter

i have the problem, i get no targetTemperature_C from VW Server.
so i start the climatisation via CLI and it starts, about with 20,5 °C.
is it possible to send the target Temperatur as parameter, or can i change it in the sorce of yout files to my value i want.

regards
simon

Window heating not starting (4104 Bad Gateway)

Thank you for this package, it's really awesome. I got it up and running in a few minutes.
I can start and stop climatisation without issues. However, when I try the window heating I get the following error:
# weconnect-cli set /vehicles/XXX/controls/windowheating start
id /vehicles/XXX/controls/windowheating cannot be set: Could not control windowheating (Bad Gateway - Looks like your service has expired. Please update your service subscription. - No retry possible)
The window heating function is working smoothly in the app. The car is a Passat GTE 2021.

If I run:
#weconnect-cli get /
then I see the same error in several places, all related to battery and charging:

[chargingProfiles] Elements: 1 items
        [chargingProfilesStatus]
                Error:  Error 4104: Bad Gateway
                        info: Looks like your service has expired. Please update your service subscription.
                        timestamp: 2022-09-07 13:43:13+00:00
                        Profiles: 0 items

Thanks for your help!

Problems with CLI after install

I have installed the WeConnect-cli package using the command

pip3 install weconnect-cli

The installation appeared to be successful but when I issue the command I get:
pi@raspberrypi:~ $ weconnect-cli
bash: weconnect-cli: command not found

Am I missing something?

Temporarily no response from command line

I really appreciate your work. Unfortunately there is strange problem with WeConnect-cli: It works fine from morning to afternoon and informs about battery status, range, odometer, door status and lock status as expected, every 5 minutes.
In the afternoon of the day, only battery status and range is reported correctly, all other commands do not give back the expected value, but (for odometer for instance) "id /vehicles/WVWXXXXXXXXXX/domains/measurements/odometerStatus/odometer not found".
This continues until the next morning, then the correct value ist shown again (till afternoon)
What could be the reason for this strange behaviour?
Thanks for your reply
Gerhard

No credentials form found

when I start the script on a raspberry pi I get the following error:
CRITICAL:weconnect-cli:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: No credentials form found
The same comman line on a MAC is working.

Username and password

Hi,
during my log-in problems yesterday I found out that neither the rigth username nor the right password is necessary to get access via weconnect-cli to the myvolkswagen API. Only a placeholder for both ist necessary. A single random character for username and password is sufficient. Modifying the vehicle number denies the access.
What is the reason behind it? I tested it with a commandline interpreter with the following command:

weconnect-cli --username [email protected] --password YYYYYYYYYY get /vehicles/WVWZZZZZZZZZZZZZZ/domains/charging/batteryStatus/currentSOC_pct

Import Fehler

Ich bekomme beim ausführen immer Import Fehler:

PS C:\Users\frank\Downloads\WeConnect-cli-main\WeConnect-cli-main> & C:/Users/frank/AppData/Local/Programs/Python/Python39/python.exe c:/Users/frank/Downloads/WeConnect-cli-main/WeConnect-cli-main/weconnect_cli/weconnect_cli.py --help
Traceback (most recent call last):
File "c:\Users\frank\Downloads\WeConnect-cli-main\WeConnect-cli-main\weconnect_cli\weconnect_cli.py", line 17, in
from .__version import version
ImportError: attempted relative import with no known parent package
PS C:\Users\frank\Downloads\WeConnect-cli-main\WeConnect-cli-main>

only 3 changes possible

what i have tested, it is only possilbe to make 3 changes via CLI or MQTT, then the VW-Servers says: ->
ignition must be switched on to protect the battery

i think that is new, again 1 week or so.
can you confirm it?

regards
simon

Error message: No credentials form found

Command:
weconnect-cli --username [email protected] --password VerySecret list

Give error message:
2022-02-11T12:54:47+0200:CRITICAL:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: No credentials form found

Error message: No credentials form found

Command:
weconnect-cli --username [email protected] --password VerySecret

Gives error message:
2022-01-28T13:18:24+0200:CRITICAL:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: No credentials form found

Tested version:
weconnect-cli --version
weconnect-cli 0.23.1 (using WeConnect-python 0.35.0)

Does the WeConnect API support MBB platform vehicles ?

Hi,
I have two VW cars, one e-Golf and one ID.4
VW has lately abandoned the old We-Connect App and Renamed the We-Connect ID app to Volkswagen. This app now handles both cars. I thus wondered if your API could now also handle both car types.
This is interesting because it seems that the HomeAssistant custom integration also use your Python API.

I tried weconnect-cli, and it finds both cars.
However, when listing tags for the e-Golf, 'capabilities', 'domains' and 'controls' are missing.
I only get this:

xx.xx@gmail.com@weconnect-sh:/vehicles/WVWZZZAU.....$ls tags
..
vin
role
enrollmentStatus
userRoleStatus
model
devicePlatform
nickname
brandCode
images
tags
pictures

When using the "cat" command I only get this:

Vehicle: WVWZZZ.........
VIN: WVWZZZ...........
Model: e-Golf
Device Platform: MBB
Nickname: e-GOLF COMFO 100 E1F
Brand Code: V
Role: PRIMARY_USER
Enrollment Status: COMPLETED
User Role Status: ENABLED

Is this caused my missing support for MBB platforms in the library?
Or is there something in the the VW server implementation that causes this?

Thanks.
Jon

recurringTimer is None

hey folks,

i get the following exception when running the cli:

Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\Scripts\weconnect-cli.exe\__main__.py", line 7, in <module>
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect_cli\weconnect_cli.py", line 142, in main
    weConnect.update()
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\weconnect.py", line 411, in update
    vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict,
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 46, in __init__
    self.update(fromDict)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 117, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 157, in updateStatus
    self.statuses[key] = className(vehicle=self, parent=self.statuses, statusId=key,
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 1586, in __init__
    super().__init__(vehicle=vehicle, parent=parent, statusId=statusId, fromDict=fromDict, fixAPI=fixAPI)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 312, in __init__
    self.update(fromDict=fromDict)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 1598, in update
    self.timers[climatizationTimerDict['id']] = ClimatizationTimer.Timer(
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 1636, in __init__
    self.update(fromDict)
  File "C:\Users\MaxDhom\AppData\Roaming\Python\Python39\site-packages\weconnect\elements.py", line 1660, in update
    self.recurringTimer.enabled = False
AttributeError: 'NoneType' object has no attribute 'enabled'

It doesn't make any difference wether i run it with list argument or without.
Would be glad to get some help here!

Climatisation not working

Hi Till,

great job in creating this. I am not an expert in coding, but I did manage to get it running thanks to your good instructions :-).

I started looking for this kind of code because I want to be able to trigger the auxiliary heating (Standheizung) from outside the app. Ideally I would like to be able to us an iOS shortcut action to trigger this, but for now I am happy if I get it up and running using my computer.

I have a Tiguan from 2019 (Model 2020).

When I want to start the climatisation I get the following error:

python3 weconnect-cli --username [email protected] --password ................ -s **** set /vehicles/WVGZZZ5NZLW......./controls/climatisation start
id /vehicles/WVGZZZ5NZLW....../controls/climatisation cannot be set: Could not control climatisation (Not Found - Upstream service responded with an unexpected status. If the problem persists, please contact our support. - Please retry in a moment)

Using the Volkswagen App I am able to start the auxiliary heating.

Is there anything you can do to make this work or am I doing something wrong?

Thank you in advance.

All car capabilities lost today

Hello,
Since this morning, after having to reconnect my car to my main profile, a lot of features are not available anymore.
I can get only static information like the vehicle model or the vehicle vin but all the informations I was getting from /vehicles/VIN/domains/[...] are not found, for example:

id /vehicles/VIN/domains/charging/batteryStatus/currentSOC_pct not found

I tried weconnect-mqtt and I can see that I'm missing some useful topics for my vehicle.

Are you experimenting the same thing from your side?

no right feedback by maxChargeCurrentAC value

i have test the in/output from maxChargeCurrentAC via CLI.
is set in App 5A the variable give me = reduced - back
is set in App to 10A or 13A it gives = invalid - back
is set via App to 16A it gives = maximum - back

there an Error or givs VW no more feedback to load?

regards
simon

PassatGTE range status not showing

Login works well, but get status after query range is not showing:
"weconnect-cli --verbose --username foobar --password foobar get /vehicles/WVWDEADBEEF/status"

....working "well" ....
[rangeStatus]
Error: Error 4003: The performed call is unauthorized info: Something went wrong. Please try to re-login. If the problem persists, please contact our support.
[parkingPosition] (last captured 2021-08-23T05:04:09+00:00)
... working well...

--verbose setting does not work......

Offline car in "my cars" break the access

Hello,

I have a old "offline" car added to my Volkswagen. Than the access with weconnect-cli to my new "online" car does not work. I get this message:
~$ weconnect-cli --netrc .netrc -v list 2023-12-11T23:34:15+0100:WARNING:/vehicles/WVWZ*******52: Vehicle data for WVWZ*******52 is empty, this can happen when there are too many requests 2023-12-11T23:34:16+0100:ERROR:Failed to retrieve data for VIN WVWZ*******52: Could not fetch data. Status Code was: 400 2023-12-11T23:34:19+0100:CRITICAL:There was a problem when communicating with WeConnect: Could not fetch data. Status Code was: 400
And no information about my online car.
This VIN WVWZ*******52 is from my offline car.
After I deleted this offline car I can access also to my new car...

Accepting terms and conditions

I get the following message when trying to read status data:
CRITICAL:weconnect-cli:There was a problem when authenticating with WeConnect: You have to login at myvolkswagen.de and accept the terms and conditions
Is it possible to catch this condition and accept the terms through the CLI as well?

Start and stop charging not working in 0.25.0

Hello,
I get the following error when starting and stopping charging in 0.25.0. Climatisation still works.

weconnect-cli --username [email protected] --password  yyy set /vehicles/WVWZZZE1ZMPxxxxxx/controls/charging start     
Traceback (most recent call last):
  File "/Users/preventlow/Library/Python/3.8/bin/weconnect-cli", line 8, in <module>
    sys.exit(main())
  File "/Users/preventlow/Library/Python/3.8/lib/python/site-packages/weconnect_cli/weconnect_cli_base.py", line 236, in main
    element.value = args.value
  File "/Users/preventlow/Library/Python/3.8/lib/python/site-packages/weconnect/addressable.py", line 368, in value
    elif issubclass(valType, Enum):
TypeError: issubclass() arg 1 must be a class

Using macOS 12.2.1
Rolled back to 0.24.2 and charging works again.

Regards Peter

CLI returns "None" for every request

Whenever using the CLI interface, the response (including JSON responses) contains the string "None" at the very beginning. This leads to non interpretable JSON format.

Reproduce like this:
$ weconnect-cli --username= --password=

Leads to:
None
Welcome! Type ? to list commands

Form does not contain postAction

When trying to login using

weconnect-cli --username [email protected] --password "s3cret" list

it returns: 2022-03-21T22:06:36+0100:CRITICAL:There was a problem when communicating with WeConnect. If this problem persists please open a bug report: Form does not contain postAction

no function to set maxChargeCurrentAC

weconnect-cli --username xxxxxxxxx --password xxxxxxxxx set /vehicles/WVWZZZAUZLW916270/domains/charging/chargingSettings/maxChargeCurrentAC maximum id /vehicles/WVWZZZAUZLW916270/domains/charging/chargingSettings/maxChargeCurrentAC cannot be set: Could not set value (Resource could not be found - Internal error, please try again later. If the problem persists, please contact our support. - Please retry in a moment)

via WeConnect App i can set the maxChargeCurrentAC to 5/10/13 and MAX without problems.

Set the temperature

Does anyone know how to set the temperature before starting the climatization?
/vehicles/{myvin}/controls/climatisation start
just starts the climatization.

Issue with login, HTLM error 302

Hello
I have used this code for the last 6 months, on daily basis, without any problems, now have started to get
API warnings - "Access file not found"
Nothing has been changed in my code. My last successful execution was yesterday (28. January 2022 12.05)

I have no change in user id or password.
Can access the account with my Weconnect app, Weconnect ID app and from the myvolkswagen.net homepage

I can see in the log file some kind of redirection there is going wrong: Error 302.

Any suggestion on how to solve it?

Thanks

Here is some data from the log
[29/01/2022 10:57:53] [API::WARNING] Access file not found
[29/01/2022 10:57:53] [API::INFO] logger
[29/01/2022 10:57:53] [API::DEBUG] Checking tokens
[29/01/2022 10:57:53] [API::DEBUG] Token checking failed
[29/01/2022 10:57:53] [API::WARNING] Forcing login
[29/01/2022 10:57:53] [API::INFO] Attempting to login
[29/01/2022 10:57:53] [API::DEBUG] Login parameters: {'prompt': 'login', 'state': '6bkhsihwuAxLGOCqQxuNcCaJpXI06Lg30vY9BpAoby6', 'response_type': 'code id_token token', 'code_challenge_method': 's256', 'scope': 'openid profile mbb cars birthdate nickname address phone', 'code_challenge': 'jvAGJOSrWk20-PY48nlDya6RiibpE_heYcaxT2nmmdM', 'redirect_uri': 'carnet://identity-kit/login', 'client_id': '9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com', 'nonce': '6wVdu4W0Fdn0AuBUYH2FWPXKW7Rme7S49BQpY3PpQw3'}
[29/01/2022 10:57:54] [API::INFO] Sending GET request to https://identity.vwgroup.io/signin-service/v1/signin/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Parameters: https://identity.vwgroup.io/signin-service/v1/signin/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Cookie': 'SESSION=NGY5YjllZmEtZDYyYS00ZWNlLWFiZjYtNDFhMDMyNDUxOWQx; vcap_journey=0739660b-afe5-43bb-baf2-52928b1c8e76'}
[29/01/2022 10:57:54] [API::INFO] Response with code: 200
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'Date': 'Sat, 29 Jan 2022 09:57:54 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Content-Language': 'en', 'Expires': '0', 'Pragma': 'no-cache', 'Set-Cookie': 'SESSION=MWE0ZTI3NDAtMWUyZi00MDViLWEzMzgtYmVlNWJjMjQ4NWMw; Path=/signin-service/v1/; Secure; HttpOnly; SameSite=Lax', 'Strict-Transport-Security': 'max-age=31536000 ; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Vcap-Request-Id': '070adde6-5e60-422c-6518-88bd850e0d63', 'X-Xss-Protection': '1; mode=block'}
[29/01/2022 10:57:54] [API::DEBUG] History: [<Response [302]>]
[29/01/2022 10:57:54] [API::INFO] Found email login url: /signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/identifier
[29/01/2022 10:57:54] [API::INFO] Sending GET request to https://identity.vwgroup.io/signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/authenticate?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Parameters: https://identity.vwgroup.io/signin-service/v1/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com/login/authenticate?relayState=2e6ac3f995f8ff3a2ae3f00f88d7068ea7e8cb86
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'User-Agent': 'python-requests/2.25.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Cookie': 'SESSION=MWE0ZTI3NDAtMWUyZi00MDViLWEzMzgtYmVlNWJjMjQ4NWMw; vcap_journey=0739660b-afe5-43bb-baf2-52928b1c8e76'}
[29/01/2022 10:57:54] [API::INFO] Response with code: 200
[29/01/2022 10:57:54] [API::DEBUG] Headers: {'Date': 'Sat, 29 Jan 2022 09:57:54 GMT', 'Content-Type': 'text/html;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Content-Language': 'en', 'Expires': '0', 'Pragma': 'no-cache', 'Strict-Transport-Security': 'max-age=31536000 ; includeSubDomains', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'DENY', 'X-Vcap-Request-Id': 'b52b87eb-c1b4-4d04-55c9-06c822ad0314', 'X-Xss-Protection': '1; mode=block'}
[29/01/2022 10:57:54] [API::DEBUG] History: [<Response [303]>]
[29/01/2022 10:57:54] [API::CRITICAL] Raising error msg: This account does not exist
Traceback (most recent call last):
File "/volume1/web/volkswagen/weconnect/weNew.py", line 34, in
vwc.login()
File "/volume1/web/volkswagen/weconnect/NativeAPI.py", line 278, in login
return self.__force_login()
File "/volume1/web/volkswagen/weconnect/NativeAPI.py", line 333, in __force_login
raise VWError('This account does not exist')
NativeAPI.VWError: This account does not exist

Can't login

Hello,

I'm getting the following error messages when trying to get info about my ID.3 using latest version of WeConnect-Cli. I've run the update which installed WeConnect 0.54, but that didn't help. Running macOS 12.6.3.

Traceback (most recent call last):
File "/Users/zzz/Library/Python/3.9/bin/weconnect-cli", line 8, in
sys.exit(main())
File "/Users/zzz/Library/Python/3.9/lib/python/site-packages/weconnect_cli/weconnect_cli_base.py", line 209, in main
weConnect.login()
File "/Users/zzz/Library/Python/3.9/lib/python/site-packages/weconnect/weconnect.py", line 182, in login
self.__session.login()
File "/Users/zzz/Library/Python/3.9/lib/python/site-packages/weconnect/auth/we_connect_session.py", line 75, in login
authorizationUrl = self.authorizationUrl(url='https://identity.vwgroup.io/oidc/v1/authorize')
File "/Users/zzz/Library/Python/3.9/lib/python/site-packages/weconnect/auth/we_connect_session.py", line 96, in authorizationUrl
redirect = tryLoginResponse.headers['Location']
File "/Users/zzz/Library/Python/3.9/lib/python/site-packages/requests/structures.py", line 52, in getitem
return self._store[key.lower()][1]
KeyError: 'location'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.