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"
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.