leeyuentuen / polestar_api

Polestar Api - Home Assistant Component
MIT License
112 stars 18 forks source link

Unexpected Error Creating API #133

Closed Legot closed 2 months ago

Legot commented 2 months ago

When adding the integration, after inputting the username and password (for a confirmed and functional Polestar ID) I get this error.

jKwimage

Probably related to #121 and #117

leeyuentuen commented 2 months ago

maybe check in the log for the error

Legot commented 2 months ago
2024-04-22 15:25:03.614 ERROR (MainThread) [custom_components.polestar_api.pypolestar.polestar] No cars found in account
NoneType: None
2024-04-22 15:25:03.614 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 43, in _create_device
    await device.init()
  File "/config/custom_components/polestar_api/polestar.py", line 35, in init
    await self.polestarApi.init()
  File "/config/custom_components/polestar_api/pypolestar/polestar.py", line 48, in init
    await self._get_vehicle_data()
  File "/config/custom_components/polestar_api/pypolestar/polestar.py", line 123, in _get_vehicle_data
    raise PolestarNoDataException("No cars found in account")
custom_components.polestar_api.pypolestar.exception.PolestarNoDataException: No cars found in account

I was seeing this before, but the issue persists even after creating a new Polestar ID and transferring the car to the new ID using the standard pairing procedure. The app does work with the new ID with no issues.

leeyuentuen commented 2 months ago

try to login here https://www.polestar.com/uk/login/cars

and see if you see in the car tab if you car is exists.

Legot commented 2 months ago

It looks like that's the issue! Most of the EU/UK pages don't actually exist on the us version of polestar.com, interestingly the US cars page does exist [https://www.polestar.com/us/login/cars], but the take/transfer of ownership page doesn't exist, and the UK transfer of ownership page doesn't accept VINs originally sold in the US.

I will contact Polestar support and see what they can do.

leeyuentuen commented 2 months ago

let me know if you have fixed them

Legot commented 2 months ago

Ok, that was the issue. Everything appears to be working correctly now.

I appreciate the help and the excellent integration!

It may be worth noting in the documentation that (for used cars on the US market at least) transferring ownership via the App does not transfer ownership on the Polestar website, and with the US page not existing users will have to provide proof of ownership to [custsupp@polestar.com]

Thanks again.

leeyuentuen commented 2 months ago

Ok, that was the issue. Everything appears to be working correctly now.

I appreciate the help and the excellent integration!

It may be worth noting in the documentation that (for used cars on the US market at least) transferring ownership via the App does not transfer ownership on the Polestar website, and with the US page not existing users will have to provide proof of ownership to [custsupp@polestar.com]

Thanks again.

thanks for the information! hope you enjoy it