Integration of Polestar 2

image

I managed to get information into Home Assistant from Tasker using AutoInput. It’s not the right solution, but this seems to be the only way to make this work as of today. I only got this working in one direction. I haven’t tried making things happen from Home Assistant through Tasker on the Polestar app.

AutoInput has an UI Query feature that can pull information from a screen. My task looks like this:

  • Launch Polestar App
  • Wait 10 seconds (the Polestar app can be very slow to update, especially the first time)
  • AutoInput UI Query
  • Clean up Variables by removing the % from the battery percentage and “Range” “.0 miles” from range so tha they are a valid integer
  • Send value to Home Assistant variables using HA call-service (uses an HTTP post with an API key. Info here)

Pulling the Lock and Climate state can be done the same way, but it seems the output of the app differs when Locked vs Unlocked and Off vs Active. The values aren’t always pulled correctly, so it needs some tweaking.

I thought about maybe running this on an old Pixel, but, it really isn’t worth that much effort because it will break when the app can’t talk to the car and needs to be force closed (which I have to do very often). So this is more of a Proof of Concept

edit: added details about how this is done

3 Likes

Well done . That is a major step forward. Can you elaborate on how that works please. Thx.

Thanks. I added more details to my post above

1 Like

Something like this …

YES -that`s what i really like to see in my HA :blush:

It works for the Fiat 500e now. Still a bit work in progress.

But at least now I can determine which car is charging. When the charger changes to ‘Charging’, I query the Fiat to check if it is connected to the charger, if so it’s the Fiat, if not it’s the Polestar (or a guest …).

Can’t compare the Fiat with the Polestar, but when it comes to ‘satisfaction’ 100x better than the Polestar.

But this is the feature request for Polestar, not for Fiat

Now that the Polestar works with Google assistant, can we integrate it in Home Assistant?

I had never looked into how Google Assistant integrates with HA, but it doesn’t look like you can query information from Google Assistant into HA.

I added the car to my Google Assistant and I can ask GA to get me things like Charge Level, Door Lock and Window Status, Climate Control Status. I can also ask it to lock/unlock the car, and start/stop climate control. Not sure if I can roll down the windows.

I found a reference to an Assistant Relay project that would allow you to send commands to Google, and I assume you could read the response back, but the dev that created it stopped updating almost 3 years ago. GitHub - greghesp/assistant-relay: A Node.js server that allows for sending commands to Google Home/Assistant from endpoints

I might be able to use Tasker on my phone for this in a more reliable manner than AutoInput to read the data from the Polestar app.

Just as information.
The Swedish electricity provider Tibber is now able to read battery status through Polestars API in their app.

First a login to Polestars API (I guess)
Authorize the request of “vehicle state”
See your battery state

As a new user I could only post one image

Maybe someone can monitor what happens? how they do it?

They announce it here: Smart charge your Polestar with Tibber | Tibber Support Center

Apparently, this is coming… Is that another shot we have at integrating with HA?

Since HA 2023.1 we can use google_assistant_sdk.send_text_command to send commands to Google Assistant. So once we do have an integration with GA, we’d be able to create some switches like this:

  - platform: template
    switches:
      polestar_preheat:
        friendly_name: Switch Preheat Polestar
        turn_on:
          service: google_assistant_sdk.send_text_command
          data:
            command: "Preheat the Polestar please"
        turn_off:
          service: google_assistant_sdk.send_text_command
          data:
            command: "Stop the preheating in the car"
3 Likes

Sounds like we are getting close. I really want to be able to interrogate Google Home to ask the battery status and use the response value to work out if I need to use import energy to replenish it or if I can wait until tomorrow so I can solar charge it.

This is now available in the UK, just tested and I can interrogate battery status via Google Assistant. If you ask it about your state of charge it will give you both % as well as projected range, which is pretty nice. Just need to parse the response and add it to a card somewhere.

Unfortunately I can’t figure out how to change how many amps your car is pulling via Assistant, which sucks because that would be great to use as a bootleg solar diverter.

Is it possible to do that. I have it set up but looking at the Home Assistant integration for Google Assistant SDK I didn’t see how you could parse the response.

To get and parse the responses you can install:

1 Like

Sounds like we now have all the puzzle pieces. Mine was delivered on Thursday so following with interest.

Following! Would highly appriciate to have an integration for Polestar that works as smoothly as the Volvo onCall integration!

2 Likes

Also very keen on this (new PS2 owner and passionate Home Assistant user)