Giter Site home page Giter Site logo

pyporscheconnectapi's People

Contributors

andig avatar cjne avatar fastlorenzo avatar fredriklj avatar josiasmontag avatar rgariepy 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyporscheconnectapi's Issues

Token refresh?

Seems the new identity manager supports token refresh (scopes_supported: offline_access). A simple exchange doesn't do the trick though- probably needs additional headers. Any idea how token refresh could be supported?

Cannot connect to host my.porsche.com:443

I am using pyporscheconnectapi since a few month in a smarthome application (SmarthomeNG). So far, everything worked well and I pulled fresh data every 10 minutes. Since a few days, I am experiencing more and more connection issues.

My script to test the connection:

import asyncio
from pyporscheconnectapi.connection import Connection

email = "[email protected]"
password = "mypassword"

async def vehicles():
    conn = Connection(email, password)

    data = await conn.get("https://api.porsche.com/service-vehicle/se/sv_SE/vehicle-data/WP0ZZZxxxxxxxxxxxxx/stored")

    await conn.close()
    return data

loop = asyncio.get_event_loop()
result = loop.run_until_complete(vehicles())

print(result)

The error message:

Traceback (most recent call last):
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 702, in sock_connect
    return await self._proactor.connect(sock, address)
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 812, in _poll
    value = callback(transferred, key, ov)
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 599, in finish_connect
    ov.getresult()
OSError: [WinError 121] Das Zeitlimit für die Semaphore wurde erreicht

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:/Users/Marcus/AppData/Roaming/JetBrains/PyCharmCE2022.1/scratches/example2.py", line 38, in <module>
    result = loop.run_until_complete(vehicles())
  File "C:\Users\Marcus\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:/Users/Marcus/AppData/Roaming/JetBrains/PyCharmCE2022.1/scratches/example2.py", line 25, in vehicles
    data = await conn.get("https://api.porsche.com/service-vehicle/se/sv_SE/vehicle-data/WP0ZZZxxxxxxxxxxxx/stored")
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\pyporscheconnectapi\connection.py", line 181, in get
    headers = await self._createhead(application)
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\pyporscheconnectapi\connection.py", line 229, in _createhead
    token = await self._requestToken(application, wasExpired=(token is not None))
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\pyporscheconnectapi\connection.py", line 127, in _requestToken
    await self._login()
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\pyporscheconnectapi\connection.py", line 102, in _login
    async with self.websession.post(self.porscheLoginAuth,  data=login_data, max_redirects=30) as resp:
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\client.py", line 535, in _request
    conn = await self._connector.connect(
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "C:\Users\Marcus\PycharmProjects\pyReoCtrl\venv\lib\site-packages\aiohttp\connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host my.porsche.com:443 ssl:default [Das Zeitlimit für die Semaphore wurde erreicht]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000029BDD30C700>

As said, I believe the issue did not come up instantly, I more had the impreesion it came up more and more over the last days. Now approx. 95% of the connections fail.

Is it just me having those issues?
Anything I can do in my script to solve this?

Any support or feedback is appreciated.

KeyError: 'message'

Worked like charm for many months. Then recently the new authorisation process came. I updated pyporscheconnectapi. Worked again for 3 days and then ....

Since a few days, I am getting errors while running my script with pyporscheconnectapi even in the latest version (0.1.3).

Now as a reference, using both of your example scripts in the 'Library usage' section, I am getting the following error:

Traceback (most recent call last):
File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_3.py", line 23, in
loop.run_until_complete(vehicles())
File "C:\Program Files\Python\Python_311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_3.py", line 13, in vehicles
vehicles = await client.getVehicles()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\client.py", line 448, in getVehicles
vehicles = await self._connection.get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 233, in get
headers = await self._createhead(application)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 287, in _createhead
token = await self._requestToken(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 202, in _requestToken
await self._login()
File "C:\Users\plane\PycharmProjects\PyPorsche\venv\Lib\site-packages\pyporscheconnectapi\connection.py", line 149, in _login
raise WrongCredentials(message['message'])
~~~~~~~^^^^^^^^^^^
KeyError: 'message'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001AA684A0C50>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001AA6845B850>, 185288.109)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001AA684A0CD0>

Am I the only one?
Any idea what I need to change?

Not working anymore...

Hi,

For a few days, the porscheconnectapi has stopped working.
Here is the error message:

./overview.sh

Traceback (most recent call last):
File "/scripts/Porsche/python/dev/pyporscheconnectapi/./cli.py", line 72, in
loop.run_until_complete(main())
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/scripts/Porsche/python/dev/pyporscheconnectapi/./cli.py", line 53, in main
data = await conn.get(f"https://api.porsche.com/service-vehicle/se/sv_SE/vehicle-data/{vin}/stored")
File "/scripts/Porsche/python/dev/pyporscheconnectapi/pyporscheconnectapi/connection.py", line 136, in get
headers = await self._createhead(application)
File "/scripts/Porsche/python/dev/pyporscheconnectapi/pyporscheconnectapi/connection.py", line 166, in _createhead
token = await self._requestToken(application)#, wasExpired=(token['expiration'] < now))
File "/scripts/Porsche/python/dev/pyporscheconnectapi/pyporscheconnectapi/connection.py", line 106, in _requestToken
last_location = resp.history[len(resp.history) - 1].headers['Location']
IndexError: tuple index out of range
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0xb5e07478>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0xb5dd51a8>, 2748941.355127121)]', '[(<aiohttp.client_proto.ResponseHandler object at 0xb5e1f7a8>, 2748941.392479912)]']
connector: <aiohttp.connector.TCPConnector object at 0xb5e073d0>

Any idea ?

Thanks
Regards

Jmi

Not working anymore: Error: wasExpired=(token is not None)

Not working anymore, Error:

 File "/home/pi/pypo-main/cli.py", line 4, in <module>
    cli()
  File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 273, in cli
    loop.run_until_complete(main(args))
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 70, in main
    data = await client.getCurrentOverview(vin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/client.py", line 458, in getCurrentOverview
    progressResult = await self._connection.post(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 189, in post
    headers = await self._createhead(application)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 228, in _createhead
    token = await self._requestToken(application, wasExpired=(token is not None))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 149, in _requestToken
    last_location = resp.history[len(resp.history) - 1].headers['Location']
                    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

New service coming

I got this e-mail from Porsche today:

Dear Customer,

On behalf of Porsche, we are delighted to inform you that a new app is currently being developed that will soon be available in the App Store and in the Google Play Store.

The new app will combine the services of several already existing Porsche apps, including the Porsche Car Connect app.

This ensures a ‘one of a kind’ user experience and a maximum of connectivity between you and your vehicle.

We will soon give you more information about it but, please, note that the current Porsche Car Connect app will shortly be removed from the stores, therefore shortly unavailable for using.

If you have any specific questions regarding the new app, please email your local Porsche Customer Service at [email protected].

We are looking forward to contacting you with further details.

Kind regards,
Vodafone Automotive

porsch launch app

API not working anymore - problem of Porsche servers?

Since today, the API is not working anymore, getting error:

python cli.py -e [email protected] -p 665544 overview -v 'WP00124599564'

Traceback (most recent call last): File "/home/pi/pypo-main/cli.py", line 4, in <module> cli() File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 273, in cli loop.run_until_complete(main(args)) File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 70, in main data = await client.getCurrentOverview(vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/client.py", line 462, in getCurrentOverview f"https://api.porsche.com/service-vehicle/{self.locale_str}/vehicle-data/{vin}/current/request/{progressResult['requestId']}/status" ~~~~~~~~~~~~~~^^^^^^^^^^^^^ KeyError: 'requestId' ERROR:asyncio:Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f938eca90> ERROR:asyncio:Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f92701630>, 287032.570127384)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x7f92550a60>, 287032.646862502)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x7f92552190>, 287036.45946109)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f928d0d10>

Same problems out there ?

Thank you!

I'm totally impressed how quick this API is adjusted to the latest changes of Porsche.

Thank you all for your great work.

Andreas

BTW: I'm using this API to run a docker container providing soc to openwb.de

porschecli: error: argument command: invalid choice - not working

I'm trying to bring the cli working,

I try: python porschecli -e [email protected] -p 6passs! -v WP0ZZZY16PS111118 services

and get:

porschecli: error: argument command: invalid choice: 'WP0ZZZY1611111198' (choose from 'list', 'services', 'overview', 'maintenance', 'summary', 'capabilities', 'permissions', 'emobility', 'position', 'triplongterm', 'tripshortterm', 'speedalerts', 'theftalerts', 'tokens', 'lock', 'unlock', 'climate-on', 'climate-off', 'directcharge-on', 'directcharge-off', 'honk', 'flash', 'chargingprofile')

I also tried "python porschecli -v WP0ZZZY16111118 services" and I get the same error - hopefully you can help me :-)

What I'm doing wrong?

Thank you

What is working python porschecli services but a soon a vin is needed I get the error

tuple index out of range

Not sure if the API changed in the last 2 days but I'm now getting this error whenever I try to use the library. Seems something changed on the API related to location:

File "/home/xxx/.local/lib/python3.11/site-packages/pyporscheconnectapi/connection.py", line 167, in _requestToken last_location = resp.history[len(resp.history) - 1].headers["Location"] ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^ IndexError: tuple index out of range Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f3f8a8f08d0> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f3f8a8b5a90>, 179.306814164)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f3f8a8f0950>

API broken again?

It did work after the latest fix, but this morning there appears to be some issues again:

I wasn't able to run this the past couple of days since I confirmed it was working., but today it seems like it is not working (at least for me) - anyone else?

loop.run_until_complete(vehicles())
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "./porsche1.py", line 67, in vehicles
vehicles = await client.getVehicles()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/client.py", line 449, in getVehicles
f"https://api.porsche.com/core/api/v3/{self.locale_str}/vehicles"
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 237, in get
headers = await self._createhead(application)
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 292, in _createhead
application, wasExpired=(token is not None)
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 206, in _requestToken
await self._login()
File "/usr/local/lib/python3.7/dist-packages/pyporscheconnectapi/connection.py", line 183, in _login
self.auth_state["code"] = params["code"][0]
KeyError: 'code'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x732e69b0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x732e2ab0>, 76.183382306)]']
connector: <aiohttp.connector.TCPConnector object at 0x732e69d0>

KeyError: 'code' - not working anymore

Getting Error:

Traceback (most recent call last): File "/home/pi/pypo-main/cli.py", line 4, in <module> cli() File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 270, in cli loop.run_until_complete(main(args)) File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 67, in main data = await client.getCurrentOverview(vin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/client.py", line 460, in getCurrentOverview progressResult = await self._connection.post( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 246, in post headers = await self._createhead(application) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 291, in _createhead token = await self._requestToken( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 206, in _requestToken await self._login() File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 183, in _login self.auth_state["code"] = params["code"][0] ~~~~~~^^^^^^^^ KeyError: 'code'

Anyone a fix for this or a workaround? Maybe Polling Time Settings?

Anyone else seeing issues in past 24 hours+

Can anyone else confirm they are seeing issues? I am wondering if it is just me (I can login to the porsche mobile app, but the API doesn't appear to work).

thanks in advance

Traceback (most recent call last):
File "/home/pi/./porsche1.py", line 140, in
loop.run_until_complete(vehicles())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/./porsche1.py", line 67, in vehicles
vehicles = await client.getVehicles()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/client.py", line 448, in getVehicles
vehicles = await self._connection.get(
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 241, in get
headers = await self._createhead(application)
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 295, in _createhead
token = await self._requestToken(
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 210, in _requestToken
await self._login()
File "/home/pi/.local/lib/python3.9/site-packages/pyporscheconnectapi/connection.py", line 131, in _login
self.auth_state["client"] = params["client"][0]
KeyError: 'client'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f9b12f9d0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f9b12ed60>, 141281.36447408)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f9b12fa30>

List of vehicles returns 401 (unauthorized)

When trying to list available vehicles, the API responds with 401 (Unauthorized). This error was not caught, and causes an error in line 161 of connection.py, as it only expects a JSON object.

Trying to debug this, it seems the list call has moved to

https://api.porsche.com/core/api/v3/se/sv_SE/vehicles

Haven't had time to investigate further, so can't provide a PR. But updating getVehicles in client.py and changing line 47–59 of connection.py to this got my integration in hass to start working again:

'portal': {
    'client_id': 'TZ4Vf5wnKeipJxvatJ60lPHYEzqZ4WNp',
    'redirect_uri': 'https://my-static02.porsche.com/static/cms/auth.html',
    'prefix': 'https://api.porsche.com/core'
},
'carcontrol': {
    'client_id': 'imeVsv86TpjM9beWJqI0sNMAip6ga05O',
    'redirect_uri': 'https://my.porsche.com/myservices/auth/auth.html',
    'prefix': 'https://api.porsche.com/service-vehicle'
} 

Best,
Fredrik

Sending navigation to PCM

Hi, would it be possible to send navigation route to PCM? MyPorsche app has the ability to plan route and send it to vehicle. I want to create route via Google Maps and then send it to PCM :)

AttributeError: 'Namespace' object has no attribute 'vin'

Hi, thanks for this wonderful library.

I tried to run with the following:

./cli.py

After entering email and password, I immediately get shown this error.

Traceback (most recent call last):
  File "/Users/jeff/Projects/pyporscheconnectapi/./cli.py", line 4, in <module>
    cli()
  File "/Users/jeff/Projects/pyporscheconnectapi/pyporscheconnectapi/cli.py", line 268, in cli
    loop.run_until_complete(main(args))
  File "/Users/jeff/.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/Users/jeff/Projects/pyporscheconnectapi/pyporscheconnectapi/cli.py", line 52, in main
    if args.vin is not None:
AttributeError: 'Namespace' object has no attribute 'vin'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x101db7340>

Could be please advise on what I could be doing wrong? Any help will be greatly appreciated.

Cannot load data

I have got a new error (at least for me it is new)

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/init.py", line 215, in _async_update_data
vehicle["services"] = await self.controller.getServices(vin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyporscheconnectapi/client.py", line 488, in getServices
is_privacy = data['vehicleServiceEnabledMap']['VSR'] == 'DISABLED'
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'vehicleServiceEnabledMap'

some commands don't return data

I posted about this on the home assistant forum.
https://community.home-assistant.io/t/porsche-connect/148913/10
I've repeated the info here.

These commands work, in that they return valid data:

list, summary and capabilities.

When I query a “cli position --vin XXXXXX” (with the correct VIN, obviously) I gives me back the error:

{
“pcckErrorKey”: null,
“pcckErrorMessage”: “Gray services are not offered for this vehicle.”,
“pcckErrorCode”: null,
“pcckIsBusinessError”: true
}

I believe I’ve got full subscription services paid up for this, am I missing something?

The same ‘gray services’ error also happens with triplongterm, tripshortterm, speedalerts and theftalerts.

I have seen ‘theft alerts’ in the android app (alarm set off by someone still in the vehicle). So there is data “online” for that. I don’t have any speed or geo boundaries set for it.

Capabilities is odd in that seat heating is present in the vehicle, both front and rear. But I suspect this has more to do with not being able to de/activate them remotely. Also it returns engineType and carModel as “UNKNOWN”

$ ./cli.py --vin WP1XXXXX capabilities
{
“displayParkingBrake”: true,
“needsSPIN”: false,
“hasRDK”: true,
“engineType”: “UNKNOWN”,
“carModel”: “UNKNOWN”,
“onlineRemoteUpdateStatus”: null,
“heatingCapabilities”: {
“frontSeatHeatingAvailable”: false,
“rearSeatHeatingAvailable”: false
},
“steeringWheelPosition”: “LEFT”,
“hasHonkAndFlash”: false
}

Where would I have set a PIN code? If I try lock/unlock it prompts me for one. Trying something random throws this error:

$ ./cli.py --vin WPXXXXX unlock
PIN code:
Traceback (most recent call last):
File “./cli.py”, line 4, in
cli()
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/cli.py”, line 125, in cli
loop.run_until_complete(main(args))
File “/usr/lib/python3.8/asyncio/base_events.py”, line 616, in run_until_complete
return future.result()
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/cli.py”, line 91, in main
data = await client.unlock(vin, pin, waitForConfirmation = not args.nowait)
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/client.py”, line 168, in unlock
return await self._lockUnlock(vin, pin, ‘unlock’, waitForConfirmation=waitForConfirmation)
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/client.py”, line 34, in _lockUnlock
result = await self._spinner(f"https://api.porsche.com/service-vehicle/remote-lock-unlock/{vin}/{progressResult[‘requestId’]}/status")
KeyError: ‘requestId’
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f4c676f7220>
ERROR:asyncio:Unclosed connector
connections: [’[(<aiohttp.client_proto.ResponseHandler object at 0x7f4c67715a60>, 7499699.935139161)]’]
connector: <aiohttp.connector.TCPConnector object at 0x7f4c676f7280>

overview throws this error:

$ cli.py --vin WP1XXXX overview
Traceback (most recent call last):
File “./cli.py”, line 4, in
cli()
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/cli.py”, line 125, in cli
loop.run_until_complete(main(args))
File “/usr/lib/python3.8/asyncio/base_events.py”, line 616, in run_until_complete
return future.result()
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/cli.py”, line 57, in main
data = await client.getCurrentOverview(vin)
File “/home/wkearney/projects/porsche/pyporscheconnectapi/pyporscheconnectapi/client.py”, line 192, in getCurrentOverview
spinnerResult = await self._spinner(f"https://api.porsche.com/service-vehicle/se/sv_SE/vehicle-data/{vin}/current/request/{progressResult[‘requestId’]}/status")
KeyError: ‘requestId’
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f4612ff3190>
ERROR:asyncio:Unclosed connector
connections: [’[(<aiohttp.client_proto.ResponseHandler object at 0x7f461300aa60>, 7499233.125293788)]’]
connector: <aiohttp.connector.TCPConnector object at 0x7f4612ff31f0>

emobility errors out with:

{
“pcckErrorKey”: “GRAY_SLICE_ERROR_UNKNOWN_MSG”,
“pcckErrorMessage”: null,
“pcckErrorCode”: null,
“pcckIsBusinessError”: true
}

Likewise climate-on and climate-off also throw an error. But I don’t believe the non-EV variants can even DO remote climate controlling (it doesn’t show up as an option in the Porsche android app). Same with directcharge-on and directcharge-off.

Car in privacy mode gives error

Trying

porschecli overview -v "WP1ZZZ..."

while car is in privacy mode gives me

Traceback (most recent call last):
  File "/usr/local/bin/porschecli", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/cli.py", line 270, in cli
    loop.run_until_complete(main(args))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/cli.py", line 67, in main
    data = await client.getCurrentOverview(vin)
  File "/usr/local/lib/python3.8/dist-packages/pyporscheconnectapi/client.py", line 464, in getCurrentOverview
    f"https://api.porsche.com/service-vehicle/{self.locale_str}/vehicle-data/{vin}/current/request/{progressResult['requestId']}/status"
KeyError: 'requestId'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fcbcc275520>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fcbcc2918e0>, 5172133.566873318)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x7fcbcc2554c0>, 5172133.873355753)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fcbcc2756a0>
Yesterday and the day before already errors, but manual login and solving the captcha helped.
Today it dies not helt anymore.

Maybe it would be a good idea to detect privacy mode.

porschecli services-v "WP1ZZZ..." returns successful even in privacy mode.

KeyError: 'Location'

Now it worked for some hours, but now I get an new error:

Traceback (most recent call last):
  File "/home/pi/pypo-main/cli.py", line 4, in <module>
    cli()
  File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 270, in cli
    loop.run_until_complete(main(args))
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/cli.py", line 67, in main
    data = await client.getCurrentOverview(vin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/client.py", line 460, in getCurrentOverview
    progressResult = await self._connection.post(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 251, in post
    headers = await self._createhead(application)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 296, in _createhead
    token = await self._requestToken(
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 211, in _requestToken
    await self._login()
  File "/home/pi/pypo-main/pyporscheconnectapi/connection.py", line 177, in _login
    resume_url = resp.headers['Location']
                 ~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'Location'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fb867b390>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fb8277c40>, 38.411622587)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fb82b2f90>

Maybe they changed something in the response from the server?

Error: Invalid captcha value

when I try to retrieve the car data, I get the error message 'invalid captcha value'.
Something seems to have been changed on the server

Error while trying to get "getEmobility" conn {'pcckErrorKey': 'GRAY_SLICE_ERROR_UNKNOWN_MSG', 'pcckErrorMessage': None, 'pcckErrorCode': None, 'pcckIsBusinessError': True}

When I'm trying to get Information with client.getEmobility(vin, model) i get the following error:

conn {'pcckErrorKey': 'GRAY_SLICE_ERROR_UNKNOWN_MSG', 'pcckErrorMessage': None, 'pcckErrorCode': None, 'pcckIsBusinessError': True}

Trying to get the data direct with the cli.py the data looks okay:

{ "batteryChargeStatus": { "plugState": "DISCONNECTED", "lockState": "UNLOCKED", "chargingState": "OFF", "chargingReason": "INVALID", "externalPowerSupplyState": "UNAVAILABLE", "ledColor": "NONE", "ledState": "OFF", "chargingMode": "OFF", "stateOfChargeInPercentage": 70, "remainingChargeTimeUntil100PercentInMinutes": null, "remainingERange": { "value": 301, "unit": "KILOMETERS", "originalValue": 301, "originalUnit": "KILOMETERS", "valueInKilometers": 301, "unitTranslationKey": "GRAY_SLICE_UNIT_KILOMETER", "unitTranslationKeyV2": "TC.UNIT.KILOMETER" }, "remainingCRange": null, "chargingTargetDateTime": "2023-11-14T05:33", "status": null, "chargeRate": { "value": 0, "unit": "KM_PER_MIN", "valueInKmPerHour": 0, "unitTranslationKey": "EM.COMMON.UNIT.KM_PER_MIN", "unitTranslationKeyV2": "TC.UNIT.KM_PER_MIN" }, "chargingPower": 0, "chargingTargetDateTimeOplEnforced": null, "chargingInDCMode": false }, "directCharge": { "disabled": true, "isActive": false }, "directClimatisation": { "climatisationState": "OFF", "remainingClimatisationTime": null, "targetTemperature": "2950", "climatisationWithoutHVpower": "false", "heaterSource": "electric" }, "timers": [ { "timerID": "1", "departureDateTime": "2023-11-17T13:31:00.000Z", "preferredChargingTimeEnabled": false, "preferredChargingStartTime": null, "preferredChargingEndTime": null, "frequency": "SINGLE", "climatised": true, "weekDays": null, "active": false, "chargeOption": true, "targetChargeLevel": 25, "climatisationTimer": false, "e3_CLIMATISATION_TIMER_ID": "4" } ], "climateTimer": null, "chargingProfiles": { "currentProfileId": 0, "profiles": [ { "profileId": 4, "profileName": "Allgemein", "profileActive": false, "profileOptions": { "autoPlugUnlockEnabled": false, "energyCostOptimisationEnabled": false, "energyMixOptimisationEnabled": false, "powerLimitationEnabled": false, "timeBasedEnabled": false, "usePrivateCurrentEnabled": true }, "chargingOptions": { "minimumChargeLevel": 25, "targetChargeLevel": 100, "smartChargingEnabled": true, "preferredChargingEnabled": false, "preferredChargingTimeStart": "00:00", "preferredChargingTimeEnd": "06:00" }, "position": null, "timerActionList": { "timerAction": [ 1, 2, 3, 4, 5 ] } } ] }, "departureInformation": null, "errorInfo": []

Don't know were the error is coming from :-(

Cannot activate integration because of required Captcha

It's impossible to activate the integration because the login flow uses a Captcha challenge.
See next log messages:

2024-03-17 16:27:15.224 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry @*.com for porscheconnect
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/porscheconnect/init.py", line 94, in async_setup_entry
access_tokens = await controller.getAllTokens()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/client.py", line 32, in getAllTokens
return await self._connection.getAllTokens()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/connection.py", line 259, in getAllTokens
token = await self._requestToken(application)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/connection.py", line 266, in _requestToken
await self._login()
File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/connection.py", line 175, in _login
raise captchaRequired("Captcha required")
pyporscheconnectapi.exceptions.CaptchaRequired

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.