Hehe yeah… I’m eagerly awaiting delivery
Home assistant view already set!
yes, in the beta it is like this
sensor.polestar_1283_battery_charge_level
the only thing that you can do is reading the battery status, you can’t read the location or unlock/lock the car. so it is still ok i think
Can you read the lock status? Just to confirm the car is locked ( or not).
nope it is not possible yet
@leeyuentuen
the api integration has stopped working for me today, last update was 16 hours ago.
restart HA results in false returns from api.
on Volvo dev site I’ve got a 404 return when trying to GET “recharge-status”.
yesterday this worked just fine.
counter has only 1495 out of 10000 and is not counting anymore.
Tibber read-out is still working ok.
see github issue:
oh ok, I have the same results, thx for the info.
still finding way to access polestar API, but if someone can find contact person of polestar developer, or know how to get the access, just let me know
yes, I have used them already,
I’ve also contacted Polestar support, and they have opened a ticket to the headquarters of Polestar in Brussels, but still haven’t gotten any reply
Even contacted Volvo support (because the API on Volvo worked before) without any reply.
Maybe I need to send an email to Geely in China.
yeah, replying to emails seems to be very hard these days…
it will be a waiting game I guess, luckily we still have tibber in the meantime.
First, good job to everyone collaborating.
I’ve contacted Polestar support also about an accessible API. I suppose the more people that contact them the more they will pay attention.
I don’t have a Polestar 2, but I’m planning on buying Polestar 4 when is available.
Just pointed some people at Polestar on LinkedIn to this thread… as a response to one of them complaining about Chamberlain closing off API access to their MyQ service a few weeks ago (Chamberlain blocks smart garage door opener from working with smart homes | Ars Technica).
Asked what their view was, if its necessary for Chamberlain to have open (and even local) API access in their eyes, why their own products don’t provide it, and working solutions are killed upon detecting them. Not really expecting a response, but one can only try…
This is great work. I have one question.
I’m able to setup the Volvo developer, the Volvo ID and obtain the key
But i get the following information.
I’ve also tried with my polestar is instead of the Volvo id.
I have two api keys (primary and secondary) which should i use
It doesn’t work any longer. Volvo/polestar plugged the gap that let it work a few weeks ago.
The Polestar website now shows some vehicle data which makes reverse engineering the API a lot simpler. I’m working on this now.
From here:
You can see battery SoC and odometer reading which is interesting, as this isn’t available in the app.
Looking at the API calls, it returns this for battery data:
{
"data": {
"getBatteryData": {
"averageEnergyConsumptionKwhPer100Km": 23,
"batteryChargeLevelPercentage": 83,
"chargerConnectionStatus": "CHARGER_CONNECTION_STATUS_DISCONNECTED",
"chargingCurrentAmps": null,
"chargingPowerWatts": null,
"chargingStatus": "CHARGING_STATUS_IDLE",
"estimatedChargingTimeMinutesToTargetDistance": null,
"estimatedChargingTimeToFullMinutes": 0,
"estimatedDistanceToEmptyKm": 320,
"estimatedDistanceToEmptyMiles": 200,
"eventUpdatedTimestamp": {
"iso": "2023-12-17T14:20:33.000Z",
"unix": "1702822833",
"__typename": "EventUpdatedTimestamp"
},
"__typename": "Battery"
}
}
}
And this is the odo endpoint:
{
"data": {
"getOdometerData": {
"averageSpeedKmPerHour": 37,
"eventUpdatedTimestamp": {
"iso": "2023-12-17T14:10:28.000Z",
"unix": "1702822228",
"__typename": "EventUpdatedTimestamp"
},
"odometerMeters": 17389000,
"tripMeterAutomaticKm": 12.6,
"tripMeterManualKm": 1295.6,
"__typename": "Odometer"
}
}
}
A VIN is required to call both of these endpoints, but there is a getCars endpoint that will return all cars paired to the account along with VINs.
Authentication looks relatively straightforward. The website stores a base64 encoded cookie that’s actually a JSON object with a bearer token, refresh token and expiry time.
It’s a shame there’s no functionality on the website to have an effect on the car (e.g. lock/unlock, climate etc) but having a first party API to at least gather some data is a huge step forward!
Interesting, I can see the soc and odometer indeed.
Managed to figure out the authentication flow which took me quite a few hours! I will document this properly tomorrow.
I’ve just plugged my car in and taken a look at the data whilst it’s on charge:
{
data: {
getBatteryData: {
averageEnergyConsumptionKwhPer100Km: 23,
batteryChargeLevelPercentage: 84,
chargerConnectionStatus: 'CHARGER_CONNECTION_STATUS_CONNECTED',
chargingCurrentAmps: null,
chargingPowerWatts: null,
chargingStatus: 'CHARGING_STATUS_CHARGING',
estimatedChargingTimeMinutesToTargetDistance: null,
estimatedChargingTimeToFullMinutes: 35,
estimatedDistanceToEmptyKm: 320,
estimatedDistanceToEmptyMiles: 200,
eventUpdatedTimestamp: {
iso: '2023-12-18T00:57:51.000Z',
unix: '1702861071',
__typename: 'EventUpdatedTimestamp'
},
__typename: 'Battery'
}
}
}
Charging amps/current remains at null which is a shame, but estimatedChargingTimeToFullMinutes is populated which is handy.
I’ve published a node.js module here:
I’ve not written a Home Assistant component before, but if someone does I hope this helps. I will probably use this module to write something that just spits the car data out over MQTT.