evcc-io / evcc

Sonne tanken β˜€οΈπŸš˜
https://evcc.io
MIT License
3.48k stars 642 forks source link

Polestar API #15053

Closed unikinCK closed 2 months ago

unikinCK commented 3 months ago

Describe the bug

Hello, I am trying to connect my Polestar 2 to evcc.

After entering email as ID and password I get: cannot create vehicle type 'template': cannot create vehicle type 'polestar': cannot find vehicle, got: []

when entering wrong password I get: cannot create vehicle type 'template': cannot create vehicle type 'polestar': login failed: code not found

Vehicle is registered in Polestar account / app.

Any ideas?

Steps to reproduce

1. 2. 3. ...

Configuration details

- name: Polestar
    type: template
    template: polestar
    title: Polestar # Wird in der BenutzeroberflΓ€che angezeigt (optional)
    user: xxx@yyy.de # Benutzerkonto (bspw. E-Mail Adresse, User Id, etc.)
    password: xxx
    capacity: 75

Log details

cannot create vehicle type 'template': cannot create vehicle type 'polestar': cannot find vehicle, got: []

What type of operating system are you running?

Linux

Version

evcc version 0.128.3

DAMEK86 commented 2 months ago

no issues with 0.128.4 on my side. config:

    vehicles:
    - name: polestar
      type: template
      template: polestar
      title: Polestar 2
      user: xxx@yyy.de
      password: 'xxx'
      cache: 20m

startup logs

[main  ] INFO 2024/07/26 06:52:12 evcc 0.128.4                                                                                                                                                                                                                                       β”‚
β”‚ [main  ] INFO 2024/07/26 06:52:12 using config file: /etc/evcc.yaml                                                                                                                                                                                                                  β”‚
β”‚ [db    ] INFO 2024/07/26 06:52:12 using sqlite database: /root/.evcc/evcc.db                                                                                                                                                                                                         β”‚
β”‚ [main  ] INFO 2024/07/26 06:52:12 listening at :7070                                                                                                                                                                                                                                 β”‚
β”‚ [ocpp-1] DEBUG 2024/07/26 06:52:14 waiting for chargepoint: 5m0s                                                                                                                                                                                                                     β”‚
β”‚ [ocpp  ] INFO 2024/07/26 06:52:15 charge point connected, registering: xyz                                                                                                                                                                                                    β”‚
β”‚ [lp-1  ] DEBUG 2024/07/26 06:52:23 charge total import: 201.070kWh                                                                                                                                                                                                                   β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23 site config:                                                                                                                                                                                                                                       β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23   meters:      grid βœ“ pv βœ“ battery βœ“                                                                                                                                                                                                               β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23     grid:      power βœ“ energy βœ“ currents βœ“                                                                                                                                                                                                         β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23     pv 1:      power βœ“ energy βœ— currents βœ—                                                                                                                                                                                                         β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23     pv 2:      power βœ“ energy βœ— currents βœ—                                                                                                                                                                                                         β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23     battery 1: power βœ“ energy βœ— currents βœ— soc βœ“ capacity βœ—                                                                                                                                                                                        β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23   vehicles:                                                                                                                                                                                                                                        β”‚
β”‚ [site  ] INFO 2024/07/26 06:52:23     vehicle 1: range βœ“ finish βœ“ status βœ“ climate βœ— wakeup βœ—                                                                                                                                                                                        β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23 loadpoint 1:                                                                                                                                                                                                                                       β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23   mode:        minpv                                                                                                                                                                                                                               β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23   charger:     power βœ“ energy βœ“ currents βœ— phases βœ— wakeup βœ—                                                                                                                                                                                       β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23   meters:      charge βœ“                                                                                                                                                                                                                            β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23     charge:    power βœ“ energy βœ“ currents βœ—                                                                                                                                                                                                         β”‚
β”‚ [site  ] DEBUG 2024/07/26 06:52:23 set buffer soc: 60                                                                                                                                                                                                                                β”‚
β”‚ [site  ] DEBUG 2024/07/26 06:52:23 set buffer start soc: 75                                                                                                                                                                                                                          β”‚
β”‚ [site  ] DEBUG 2024/07/26 06:52:23 set priority soc: 30                                                                                                                                                                                                                              β”‚
β”‚ [site  ] DEBUG 2024/07/26 06:52:23 set battery discharge control: false                                                                                                                                                                                                              β”‚
β”‚ [lp-1  ] DEBUG 2024/07/26 06:52:23 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger)                                                                                                                                                                         β”‚
β”‚ [lp-1  ] DEBUG 2024/07/26 06:52:23 phase timer inactive                                                                                                                                                                                                                              β”‚
β”‚ [lp-1  ] DEBUG 2024/07/26 06:52:23 pv timer inactive                                                                                                                                                                                                                                 β”‚
β”‚ [lp-1  ] INFO 2024/07/26 06:52:23 vehicle updated: unknown -> Polestar 2`` 

did you checked your yaml config? on top of that check if you are able to login into https://polestarid.eu.polestar.com/PolestarLogin/login Seems for some accounts, you need to request the api permissions over support.

unikinCK commented 2 months ago

Solved: If you buy a Polestar pre-owned you need to register new ownership with Polestar customer service.