Langer75 / volkswagencarnet-client

Commandline script to interact with volkswagencarnet library
GNU General Public License v3.0
4 stars 0 forks source link

Setlock (and other commands except update) return error #1

Closed odelma closed 1 year ago

odelma commented 2 years ago

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.

Langer75 commented 2 years ago

As can be seen from the URL there is a "/" missing between vin and "services". But this is because you edited the vin, right? Does it work with the ID.3? The second one is also within the library. I can not test it, because I have no combustion car working with myvolkswagen. But, first the initial car data could not be updated (Could not update information: Invalid audience). I don't know why. In consequence the key 'climater' could not be found in the datastructure. Are you sure, that you can call the update action for the passat and it works? Because exactly the same subroutine is called for both at the beginning. Can you reproduce the error several times?

odelma commented 2 years ago

Yeah, I guess VIN is not very sensitive info but just thought to myself to anonymize it and accidentally I seem to have removed one forward slash.

It does not work with ID3 as it uses a different API I guess. For the ID3 I've been using https://github.com/skagmo/ha_vwid (https://github.com/skagmo/ha_vwid/blob/main/custom_components/vwid/libvwid.py + the example).

I also had a working version of wolkswagencarnet but after the updates I was not able to use door locking or remote heating anymore. And actually now a few weeks ago it stopped with status updates, just returns 404. So very happy that with this command line solution the status updates are again working at least. And yes, I'm quite sure the update works. With debug it returns:

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.
DEBUG:vw_connection:Going to call vehicle updates
DEBUG:vw_connection:HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZXXXYYYZZZ/homeRegion"
DEBUG:vw_connection:Request for "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZXXXYYYZZZ/homeRegion" returned with status code [200]
DEBUG:vw_vehicle:Get homeregion for VIN WVWZZZXXXYYYZZZ
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZXXXYYYZZZ"
DEBUG:vw_connection:Attempting extraction of subject from identity token.
DEBUG:vw_connection:HTTP GET "https://customer-profile.apps.emea.vwapps.io/v1/customers/23663581-ed84-4d77-ad56-e709bafdf4/realCarData"
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZXXXYYYZZZ" returned with status code [200]
DEBUG:vw_connection:Request for "https://customer-profile.apps.emea.vwapps.io/v1/customers/23663581-ed84-4d77-ad56-e709bafdf4/realCarData" returned with status code [200]
INFO:vw_vehicle:Vehicle WVWZZZXXXYYYZZZ added. Homeregion is "https://mal-1a.prd.ece.vwg-connect.com/api"
DEBUG:vw_vehicle:Attempting discovery of supported API endpoints for vehicle.
DEBUG:vw_connection:HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZXXXYYYZZZ"
DEBUG:vw_connection:Request for "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZXXXYYYZZZ" returned with status code [200]
DEBUG:vw_vehicle:Discovered enabled service: carfinder_v1
DEBUG:vw_vehicle:Discovered enabled service: rhonk_v1
DEBUG:vw_vehicle:Discovered enabled service: trip_statistic_v1
DEBUG:vw_vehicle:Discovered enabled service: rheating_v1
DEBUG:vw_vehicle:Discovered enabled service: rlu_v1
DEBUG:vw_vehicle:Discovered enabled service: statusreport_v1
DEBUG:vw_vehicle:API endpoints: {'rheating_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['P_QSTOPACT', 'P_STNG', 'G_RQSTAT', 'G_LACT', 'P_DTDEACT', 'P_QSACT', 'G_STAT', 'P_DTACT']}, 'rclima_v1': {'active': False}, 'rlu_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['G_LACT', 'LOCK', 'G_RQSTAT', 'UNLOCK']}, 'trip_statistic_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['G_TRIPDATA', 'D_TRIPDATA', 'G_JOBSTATUS', 'G_AGGR_TRIPDATA']}, 'statusreport_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['G_CVDATA', 'G_RQSTAT', 'G_SVDATA', 'G_CVDATAID']}, 'rbatterycharge_v1': {'active': False}, 'rhonk_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['G_REQSTATUS', 'P_VREQ', 'G_RHIST']}, 'carfinder_v1': {'active': True, 'expiration': datetime.datetime(2022, 6, 11, 19, 43, tzinfo=datetime.timezone.utc), 'operations': ['FIND_CAR']}}
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/rs/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/shortTerm?newest"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/cf/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/position"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/vsr/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status"
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/cf/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/position" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/rs/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/vsr/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/shortTerm?newest" returned with status code [200]
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/rs/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/shortTerm?newest"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/cf/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/position"
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/vsr/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status"
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/shortTerm?newest" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/cf/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/position" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/vsr/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status" returned with status code [200]
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/rs/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/status" returned with status code [200]
DEBUG:vw_dashboard:Setting up dashboard with config :{}
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Position is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Door locked is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Trunk locked is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Force data refresh is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Window Heater (WindowHeater:window_heater) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Climatisation from battery (BatteryClimatisation:climatisation_without_external_power) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Electric Climatisation (ElectricClimatisation:electric_climatisation) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Auxiliary Climatisation (AuxiliaryClimatisation:auxiliary_climatisation) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking Heater Ventilation is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking Heater Heating is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Charging (Charging:charging) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Request results is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Odometer is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Battery level (Sensor:battery_level) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Adblue level is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Fuel level is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Service inspection days is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Service inspection distance is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Oil inspection days is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Oil inspection distance is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last connected is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking time is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Charging time left (Sensor:charging_time_left) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Electric range (Sensor:electric_range) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Combustion range is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Combined range (Sensor:combined_range) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Charger max ampere (Sensor:charge_max_ampere) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Climatisation target temperature (Sensor:climatisation_target_temperature) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average speed is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average electric engine consumption (Sensor:trip_last_average_electric_engine_consumption) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average fuel consumption is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip duration is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip length is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip recuperation (Sensor:trip_last_recuperation) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average recuperation (Sensor:trip_last_average_recuperation) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average auxillary consumption (Sensor:trip_last_average_auxillary_consumption) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip average auxillary consumer consumption (Sensor:trip_last_average_aux_consumer_consumption) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Last trip total electric consumption (Sensor:trip_last_total_electric_consumption) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking Heater heating/ventilation status is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking Heater heating/ventilation duration is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Outside temperature is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Requests remaining is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ External power (BinarySensor:external_power) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Energy flow (BinarySensor:energy_flow) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Parking light is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Doors locked is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Door closed left front is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Door closed right front is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Door closed left back is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Door closed right back is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Trunk locked is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Trunk closed is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Hood closed is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Charging cable connected (BinarySensor:charging_cable_connected) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Charging cable locked (BinarySensor:charging_cable_locked) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Sunroof closed (BinarySensor:sunroof_closed) is not supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Windows closed is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Window closed left front is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Window closed left back is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Window closed right front is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Window closed right back is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Vehicle Moving is supported
DEBUG:vw_dashboard:WVWZZZXXXYYYZZZ Request in progress is supported
DEBUG:vw_connection:HTTP GET "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/longTerm?newest"
DEBUG:vw_connection:Request for "https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/VW/DE/vehicles/WVWZZZXXXYYYZZZ/tripdata/longTerm?newest" returned with status code [200]
{"VIN":"WVWZZZXXXYYYZZZ","last_request":"update","response":"None","Pos_x":60.00000,"Pos_y":24.00000,"Pos_time":"2021-11-09 18:34:21+02:00","Door locked":"Locked","Trunk locked":"Locked","Force data refresh":"Off","Parking Heater Ventilation":"Off","Parking Heater Heating":"Off","Request results":"Unknown","Odometer":"53750 km","Adblue level":"8000 km","Fuel level":"89 %","Service inspection days":"2 days","Service inspection distance":"6000 km","Oil inspection days":"367 days","Oil inspection distance":"6000 km","Last connected":"2021-11-09 19:18:23","Parking time":"2021-11-09 18:34:21","Combustion range":"980 km","Last trip average speed":"47 km/h","Last trip average fuel consumption":"5.1 l/100 km","Last trip duration":"26 min","Last trip length":"21 km","Parking Heater heating/ventilation status":"off","Parking Heater heating/ventilation duration":"30 minutes","Outside temperature":"4.0 °C","Requests remaining":"-1","Parking light":"Off","Doors locked":"Locked","Door closed left front":"Closed","Door closed right front":"Closed","Door closed left back":"Closed","Door closed right back":"Closed","Trunk locked":"Locked","Trunk closed":"Closed","Hood closed":"Closed","Windows closed":"Closed","Window closed left front":"Closed","Window closed left back":"Closed","Window closed right front":"Closed","Window closed right back":"Closed","Vehicle Moving":"Off","Request in progress":"Off","tripData": {"overallMileage": 53750, "tripType": "longTerm", "averageFuelConsumption": 56, "traveltime": 781, "startMileage": 53071, "tripID": 2160187839, "averageSpeed": 52, "mileage": 678, "timestamp": "2021-11-09 16:33:56+00:00", "reportReason": "clamp15off"}}
INFO:vw_connection:Initiating logout

Which for me looks good 😄

For the couple of dozen times I tried e.g. the locking command, it has always returned the same error.

odelma commented 2 years ago

Hmm, since yesterday evening it has not worked:

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 "/home/pi/domoticz/scripts/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 "/home/pi/domoticz/scripts/carnet_cli.py", line 132, in main
    rc = await vehicle.update()
  File "/usr/local/lib/python3.7/dist-packages/vw_vehicle.py", line 122, in update
    await self.discover()
  File "/usr/local/lib/python3.7/dist-packages/vw_vehicle.py", line 71, in discover
    homeregion = await self._connection.getHomeRegion(self.vin)
  File "/usr/local/lib/python3.7/dist-packages/vw_connection.py", line 552, in getHomeRegion
    if not await self.validate_tokens:
  File "/usr/local/lib/python3.7/dist-packages/vw_connection.py", line 1077, in validate_tokens
    id_exp = jwt.decode(idtoken, options={"verify_signature": False}, algorithms=JWT_ALGORITHMS).get('exp', None)
  File "/usr/local/lib/python3.7/dist-packages/jwt/api_jwt.py", line 104, in decode
    self._validate_claims(payload, merged_options, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/jwt/api_jwt.py", line 140, in _validate_claims
    self._validate_aud(payload, audience)
  File "/usr/local/lib/python3.7/dist-packages/jwt/api_jwt.py", line 189, in _validate_aud
    raise InvalidAudienceError('Invalid audience')
jwt.exceptions.InvalidAudienceError: Invalid audience

Is it perhaps related to this: https://github.com/robinostlund/volkswagencarnet/issues/131

Langer75 commented 2 years ago

yes the update looks fine. But what I do not understand, both update and lock uses the same login routine within the library including first discovery of all available data. So the point where the error occours has nothing to do with set lock or set climatisation. It happens before at a point where the car data are discovered for the first time. so the error happens in line 105. What about the other actions? setclimatisationtemp, does this work?

Langer75 commented 2 years ago

As you mentioned the issue #131: I had the same problem few weeks ago. But I tried a lot of things (changed the code) within the library and thought that I did something wrong. I also reinstalled the library and it works again. So may be just reinstall it

odelma commented 2 years ago

Just in case - tried to unistall and then reinstall volkswagencarnet, no change. Still getting the same error now also for update and setrefresh. I have not tried setclimatisationtemp as the auxiliary heater in 2019 Passat does not support this feature. I think it is only update, setrefresh, setclimatisation and setlock are supported in this car. In ID3 also the temp, window heating and charger are available, but as mentioned I think it uses a different api.

But yeah, totally agree it does not make sense why it fails on same spot with other commands that (at least originally) update and setrefresh. Is there something I can do to help debugging this?

Langer75 commented 2 years ago

As this is an library issue I reopened #131 in volkswagencarnet

Langer75 commented 1 year ago

should work now