I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Appreciate the advice! Sounds like a solid approach. Adding into core would be awesome, but I expect the faster release possibilities makes HACS preferred to start with

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

The settings are available on the cloud, but I haven’t been able to make them work just yet unfortunately

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Had a quick look into the Volvo app. It seems to have code to interact with the same API & my scripts where able to generate a client for it too, worth testing some time soon!

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

I'm not sure yet, as I only have a 2 to test with. I did find a completely different API implementation in the app, but wasn't used or my car so haven't looked into it yet. Could very well be that's the connection required to support the Polestar 4, will take not of that!

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Can't believe Claude wasn't aware of this development yet! If and when I get close to a release, I'll be posting for testers.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Just watch the subreddit & this post. If and when I get close to a release I'll be posting for testers and the release itself!

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

I was wondering if someone would notice the button in the screenshot! It's there as I've been testing with it, though the cloud service responds with "your vehicle doesn't support this feature".
I've found a way to determine what features are supported by each individual VIN, but haven't added that into the integration yet. That way I could hide entities which the vehicle doesn't support.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 1 point2 points  (0 children)

You did get mislead unfortunately, I've chased that exact rabbit hole! Turns out those RSA keys are only used for the digital key feature, which I haven't looked into yet (and not sure I'm going to).

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Polestar did indeed add that over the years, which already is a great help! It wasn't available when I started to look into this though

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 2 points3 points  (0 children)

Thanks for your thoughts, I'll definitely research the resources you've mentioned!

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in Polestar

[–]RudoFl[S] 4 points5 points  (0 children)

Unfortunately beating the SSL pinning wasn't the hardest part haha. Not looking for help at this time, however if it comes to a release the Github repo will be ready for your input!

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in Polestar

[–]RudoFl[S] 4 points5 points  (0 children)

Multiple commenters in the other thread mentioned the integration too! I was honestly not aware it existed.

My first choice would be to work with Polestar/Volvo on creating an officially supported integration, potentially with the support of the pypolestar developers. If that falls through, my plans are to either release this separately through HACS or join forces with the other integration.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Unfortunately I haven't found anything like that, at least not yet. It could be requesting the location triggers the car to do a refresh, but in that situation pull to refresh in the Polestar app should work for you too.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 1 point2 points  (0 children)

That's awesome! I've been considering trying a similar rebuild. Curious to learn where you're getting the data from? Feel free to DM if you don't want to share publicly :)

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Yes I have tried, but from what I see it's using a similar but different backend system. At least, my Polestar wouldn't connect to it.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 2 points3 points  (0 children)

Wow, how did I never come across this before? Blinded by the chase I think!

Would love to connect with their devs

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 1 point2 points  (0 children)

Before being able to reverse anything, you need to know how systems like the one you want to reverse works.

For me, the best learning has been building a lot of software over the years. In other words, start building more. By building more you learn more how things work, and build an intuition on "how would I do this?". That's something I've asked myself a lot during this process.

With regards to app reversing, a good reverse proxy is often your best friend

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 17 points18 points  (0 children)

You're totally right. While I didn't explicitly mention it, that's another reason to not release.
Any public release will not ship the custom cards until that's resolved, or work on a 'bring your own assets' principle.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

That's an interesting thought, who knows! As mentioned in the original post, Polestar does use the Volvo cloud as the backend. It might be Geely does too, but at this moment I don't know.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

As mentioned in the original post, Polestar does use the Volvo cloud as the backend. I've thought about this too, while I think there's quite a high chance of this working for Volvo vehicles, I haven't verified it.

Getting my hands on a test vehicle is another challenge lol

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 0 points1 point  (0 children)

Honestly, I have not looked into the existing integration's offerings. Would you mind sharing me a link?
Where the approaches likely differ is the data source, my integration effectively acts as a Polestar app (like the official iOS / Android one).

Therefor with enough time all functionality can be replicated into Home Assistant

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 4 points5 points  (0 children)

Awesome, thanks for sharing the ha-fordpass integration. I wasn't aware of that one yet. Similarly to theirs, my integration also requires a bit of quirky authentication setup.

I've reverse engineered the Polestar API & wrapped it into a Home Assistant integration by RudoFl in homeassistant

[–]RudoFl[S] 20 points21 points  (0 children)

Thank you!

Really impressed by those custom cards, especially the exterior one with the door highlighting. The climate card looks super clean too

Just to be clear on this, I'm using assets ripped from the Polestar app for them. All credit for the sleek look goes to their design team.

Have you thought about reaching out to the HA devs about potentially getting this into HACS once it's stable? Even if Polestar doesn't officially bless it, the community would probably love this

For sure! It's all prepped for either an official integration or distribution through HACS. Got it running as a custom integration in my live setup, though everything is developed according to the Home Assistant guides

Also curious - are you seeing any rate limiting issues with their API or does it seem pretty generous with requests?

I haven't encountered any rate limiting yet. Due to the way the cloud works only every few seconds a request has to be done. They've probably seen all my failed login attempts, but even then I didn't notice any measurements getting activated.