I have been using the integration for som e time now without issues.
But the other day when I cam back home after a week of travel i noticed the integrations did not work anymore. I got API error. I noticed there was an update for the integratopn to v 1.6.0.
Did the upgrade but since then it doe snot work at all.
Tried unistalling it and reinstalling it, but I only get “Unexpected error creating api” when I try to enter credentials when adding integration.
Finally got it to work again
The only thing that worked for me was to manually delete the custom components “polestar api” files, reboot Home assisant and start over again.
alias: Polestar API Restart
trigger:
- platform: state
entity_id:
- sensor.polestar_XXXX_api_status_code
for:
hours: 0
minutes: 10
seconds: 0
from: OK
condition: []
action:
- service: homeassistant.reload_config_entry
data: {}
target:
device_id: fe5eb71f031c15d080bea43889b2fc12
mode: single
That reloads the integration if the API stops being ‘OK’ for 10 minutes. Worth noting that it hasn’t fired for a couple of weeks which might indicate this is more reliable now, though I have been doing work in HA so restarting the whole thing fairly regularly.
The integration has been rock solid for weeks! Thanks again @leeyuentuen for the hard labor. Hence, no need to reload either.
Give me a finger I will take the hand: Is there a way to get the location information?
I used to get that reliably from the HA AAOS app in the car, but that has stopped working a while ago and the development of the app seems to have died all together.
The Polestar phone app provides the info, so this integration can as well?
The best way to get location at the moment is with car stats viewer if you can get on one of the tracks. Link is further up the thread, it is on the German Polestar forum.
The HA app still works for me, which is another option. It does not update as often. CSV is almost real time.
CSV is pretty limited though. For a start, it’s user dependent so no help if someone else (a partner, say) uses the car, unless you sign them up to a test track too and set it up on their account. Plus it gets closed if the car has been parked long enough for the infotainment to hibernate or a different user has logged in, meaning you have to remember to manually open it again next time you drive.
This is working great for me, so a big thanks! Most all of the data is updating properly and showing the correct values.
However, I notice that the software version is not correct. For me, this integration is showing a value of “P02.13”. But my car is running “2.14.3”. This is pretty low on the list of priorities, but I thought I’d mention it and see if others were seeing a similar issue.
First of all @leeyuentuen a big bow for your work, what you did, I only found this topic today. I’ve been searching for a way to connect for some tomen trying to figure out the API, and for now I was working with the EEVEE plugin. But works, but that’s about it…
I’m a DevOp myself. Is there a ‘postman’ collection/workspace then I can use to examine the API responses? I wasn’t able to connect to the API with Postman, so if I’m there, i might be of some help (don’t program myself, but do bugchecking/beta testing for several apps)
But I noticed that some trips are double counted for the daily milage. Looking at the detail showed a strange behavior of the odometer reading that explains the double counting:
I’ve been using this for a few months and it has been working great! Having this has enabled me to add some functionality that I didn’t have before.
I can now control the Charge Level by setting the Polestar 2 to 100% and watching the SoC via this integration to stop the charge from my EVSE
I can detect when the EVSE is connected to the car. I was able to do this before with my Emporia EVSE through some templating, but having a second source works great for triggering Actionable Notifications
I can more reliably use Excess Solar Charging by also leveraging the SoC sensor
Same here. Updated this morning (just search for new update while driving) and it updated to 3.0.3. Integration still shows P02.14. It’s nice to see charging power and charging current now.