My Polestar arrives tomorrow. I think a Home Assistant add-in would be brilliant as it appears there are lots of available datapoints going to the Polestar app, plus of course control options back to the car.
Automation 1: If outside air temp below 8 degrees C, and time after 6:00am and before 7:00 am warm up drivers seat and turn on heating to 21 degrees.
Then step into a warm car on the morning commute at 6:30
We’ve had our P2 for 5 months. I thought I had figured out a way to track the car’s presence with UniFi, but it turned out the random MAC I was seeing was my partner’s Apple Watch with privacy turned on.
The car really really does not like to connect to WiFi, and I think it might also profile dependent, so when you lock the car, I don’t think it even tries to establish a WiFi connection at all. This is just to be able to track its presence in my case.
It would be great if we could pull information into HA. These days you even get parking location in the Polestar app, so that could be used to detect if the car is at home.
I bought an Emporia EVSE that does the charging automations I wanted. You can add a $30 dongle that talks to the meter over Zigbee (in supported markets) and with it you can do things like charge using excess Solar energy, or track TOU rates automatically and charge when it’s cheaper. Someone made an Emporia integration that would allow other controls via HA.
I can pull the actual charging rate, status and total kWh consumed from the EVSE, so I have a dashboard that can show all that data. Seeing the battery level would be a nice addition.
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
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.
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.
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"