pypolestar / polestar_api

Polestar API - Home Assistant Component
MIT License
137 stars 25 forks source link

Error 'unexpected error creating API' #23

Closed thriolsson closed 10 months ago

thriolsson commented 10 months ago

I am trying to add this integration for the first time. I get the error 'Unexpected error adding the API' I can log in on Polestar web site and app using the same credentials.

How can I best troubleshoot this?

Screenshot_2023-12-21-08-48-04-93_c3a231c25ed346e59462e84656a70e50

leeyuentuen commented 10 months ago

maybe take a look at the logs and see what log you can see

thriolsson commented 10 months ago

Traceback (most recent call last): File "/config/custom_components/polestar_api/config_flow.py", line 47, in _create_device await device.init() File "/config/custom_components/polestar_api/polestar_api.py", line 51, in init 'data': result['data']['getConsumerCarsV2'][0], 'timestamp': datetime.now()}


IndexError: list index out of range
leeyuentuen commented 10 months ago

i think duplicate error. https://github.com/leeyuentuen/polestar_api/issues/15

you don't have car in that account. can you check if you have the full access on that account?

thriolsson commented 10 months ago

When I log in using my phone number, it works. 😊 But using my e-mail does not work. (On the web page and in the app both works)

Borales commented 10 months ago

When using version <1.2.0 (with the VIN setup form field) - it was working fine. Updating to the latest version doesn't break the app, but a clean install of 1.2.0 - gives the error below.

Screenshot 2023-12-25 at 21 04 09 Screenshot 2023-12-25 at 21 04 28
leeyuentuen commented 10 months ago

When using version <1.2.0 (with the VIN setup form field) - it was working fine. Updating to the latest version doesn't break the app, but a clean install of 1.2.0 - gives the error below.

Screenshot 2023-12-25 at 21 04 09 Screenshot 2023-12-25 at 21 04 28

@Borales thanks for report, should be fix on next public code: https://github.com/leeyuentuen/polestar_api/releases/tag/1.2.1

Borales commented 10 months ago

@leeyuentuen checked 1.2.1 - that solved the problem for me, thanks!

leeyuentuen commented 10 months ago

i'll close this ticket, for issue, open a new one with logs for better follow up the problem.