pypolestar / polestar_api

Polestar API - Home Assistant Component
MIT License
139 stars 27 forks source link

Cannot login #15

Closed supersonical closed 10 months ago

supersonical commented 10 months ago

Logger: custom_components.polestar_api.config_flow Source: custom_components/polestar_api/config_flow.py:47 Integration: polestar_api (documentation) First occurred: 12:44:51 AM (3 occurrences) Last logged: 12:48:23 AM

Unexpected error creating device 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

have you installed polestar api before? (clean install of polestar api or upgrade) maybe give me more debug log

leeyuentuen commented 10 months ago

@supersonical

supersonical commented 10 months ago

Still the same error after redownloading the in HACS?

image
leeyuentuen commented 10 months ago

try to remove the configured polestar_api and log in with your polestar credential (before it was using volvo development credential)

https://github.com/leeyuentuen/polestar_api#fill-the-information

supersonical commented 10 months ago

have you installed polestar api before? (clean install of polestar api or upgrade) maybe give me more debug log

Download the full logs from Home assistant but their is no more details of the error. How do i turn on debug for the integration?

2023-12-20 10:22:06.290 ERROR (MainThread) [custom_components.polestar_api.config_flow] Unexpected error creating device 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
supersonical commented 10 months ago

try to remove the configured polestar_api and log in with your polestar credential (before it was using volvo development credential)

https://github.com/leeyuentuen/polestar_api#fill-the-information

I have tried to login and know for sure my credentials work, or did i miss understand you?

supersonical commented 10 months ago

Should i maybe go backa version where it uses the Volvo Dev?

leeyuentuen commented 10 months ago

you can login in this site? https://polestarid.eu.polestar.com/PolestarLogin/login and you can see your car located there?

leeyuentuen commented 10 months ago

Should i maybe go backa version where it uses the Volvo Dev?

the volvo dev doesn't work anymore on polestar car

supersonical commented 10 months ago

you can login in this site? https://polestarid.eu.polestar.com/PolestarLogin/login and you can see your car located there?

Hmm that is maybe the problem, the car is not located their, due to my partner is the "Owner" of the car. She can se it on that page. Let me try it with her account.

supersonical commented 10 months ago

This is so weird! if i login with her account on www.polestar.com i can see the car and the battery status. But when i login to "https://polestarid.eu.polestar.com/PolestarLogin/login" i can only see here acount details but not the car. Is it possible that the issue with that the car is a leasing?

Below info is when i login to Polestar.com

Skärmavbild 2023-12-20 kl  10 53 27

@leeyuentuen

leeyuentuen commented 10 months ago

i gave the wrong url. should be this one:

https://polestarid.eu.polestar.com/as/authorization.oauth2?response_type=code&client_id=polmystar&redirect_uri=https%3A%2F%2Fwww.polestar.com%2Fsign-in-callback&scope=openid%20profile%20email%20customer:attributes%20customer:attributes:write

leeyuentuen commented 10 months ago

@supersonical still got the issue?

supersonical commented 10 months ago

Weird, now it just worked. So no, its fixed now and i got it in now. :)