Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR (MainThread) [custom_components.porscheconnect] Unexpected error fetching porscheconnect data #242

Open
barto64 opened this issue Jun 12, 2024 · 12 comments
Labels
breaking Breaking Changes

Comments

@barto64
Copy link

barto64 commented Jun 12, 2024

Version of the custom_component

0.0.18

Configuration

Add your logs here.
``2024-06-12 12:33:55.372 ERROR (MainThread) [custom_components.porscheconnect] Unexpected error fetching porscheconnect data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/porscheconnect/__init__.py", line 211, in _async_update_data
    summary = await self.controller.getSummary(vin)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/client.py", line 484, in getSummary
    data = await self._connection.get(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyporscheconnectapi/connection.py", line 304, in get
    return await resp.json()
           ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 79, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1192, in json
    return loads(stripped.decode(encoding))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 48, in json_loads
    return orjson.loads(__obj)  # type:ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)`

## Describe the bug

Integration does not work, device and entities not available.

## Debug log

<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ -->

```text

Add your logs here.
@augmentedtraffic
Copy link

same with me - looks like Porsche made a big change on their APIs that needs to be reflected

@fredriklj
Copy link
Collaborator

What HA versions are you on?

@barto64
Copy link
Author

barto64 commented Jun 12, 2024 via email

@augmentedtraffic
Copy link

i am using your latest python lib directly. I only stopped by here to see if others are seeing it. I will set up HA later to test as I use it also but just not with this integration. . The normal python lib stopped working Sunday morning early for me EST so I stopped my automatic (hourly) ping. I just realized it actually worked yesterday about 3:40pm EST (I was doing a test), but this morning it had the same error as above. On Sunday I was getting a valid response but effectively empty JSON values. When I log into the Connect web site I get an alert about changes coming (i.e. it looks like they will remove web access and work only via the mobile apps)

@fredriklj
Copy link
Collaborator

I just noticed they have scrapped all remote services from the web access, possibly they have retired all those APIs. In which case we might have some trouble.

@augmentedtraffic
Copy link

that's what I was afraid of. I suppose someone would need to work from the Android app side to see if the mobile APIs can be used. I won't be able to do this, but I would be willing to pay a bounty to someone

@fredriklj
Copy link
Collaborator

This is going to take a while.

@fredriklj
Copy link
Collaborator

I've had a first stab at the new APIs in this branch:

https://github.com/CJNE/pyporscheconnectapi/tree/new_api

It currently only supports authentication and retrieving capabilities and status. And will require significant changes of the HA integration as well.

@augmentedtraffic
Copy link

I can confirm it works thanks so much I will send you an email. Note the JSON is changed quite a bit. I found ChatGPT4o quite useful to rewriting my code and the key functionality is working like before. I still need to do tire pressure and lights control but that is not as key. Really appreciate your efforts on this!

@fredriklj
Copy link
Collaborator

For anyone whose life depend on a (somewhat) functional ha integration, and is prepared to file a pull request to fix any discovered issues, there is work in progress in the new_api branch.

@Jimnaldo
Copy link

@fredriklj is there something we can help with to get it up an running again?

@fredriklj
Copy link
Collaborator

I'd appreciate any help I can get, I have quite limited time to spend on this. I've started to clean up the integration to align it with best current (hass) practices, but could certainly use some help on that. Also, pyporscheconnectapi need an overhaul. So please feel free to dive in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking Changes
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants