Skip to main content

Unofficial async Python client for Polestar vehicle APIs

Project description

unofficial-polestar-api

Unofficial async Python client for Polestar vehicle gRPC APIs.

This project aims to bring you as much control as possible over your car. It uses the same APIs as the official mobile app and exposes most functionality (Atleast for the PS4 for now)

Supported Cars

This library for now just implements the C3 (Volvo Cars Cloud Connectivity) backend. The Polestar app actually supports four backends — C3, PCCS, Vocmo, and HuanFu — and the server assigns one per vehicle via a remoteControlType field.

The server assigns a backend per vehicle — which cars use which backend is currently unclear, but the Polestar 4 (Which i developed against) - responds to commands through the C3 Backend.

If you use this library (or the HA integration) please report back what works and what doesn't, for your model.

Contributions and testing from owners of other models are welcome and encouraged

Model Backend Verified
Polestar 4 C3 ✅ Mostly working
Backend Status
C3 ✅ Implemented
PCCS ❌ Not implemented
Vocmo ❌ Not implemented
HuanFu ❌ Not implemented

Not all features are available on all models.

Usage

Home Assistant

For integrating with Home Assistant, use this integration (which uses this API)

As a library

from polestar_api import PolestarApi

async with PolestarApi(email="you@example.com", password="...") as api:
    vehicles = await api.get_vehicles()
    car = vehicles[0]

    battery = await car.get_battery()
    print(f"{battery.charge_level}% — {battery.range_km} km")

    location = await car.get_location()
    print(f"Lat {location.coordinate.latitude}, Lon {location.coordinate.longitude}")

Features

  • Battery — charge level, range, charging status, power (with real-time streaming)
  • Location — last known and last parked position (with real-time streaming)
  • Climate — start/stop climatization with target temperature, seat and steering wheel heating
  • Climate timers — view and manage scheduled parking climate timers
  • Locks — lock, unlock, trunk unlock
  • Honk & flash — flash lights or honk+flash
  • Windows — open/close all windows
  • Exterior — door, window, sunroof, hood, tailgate, and alarm status
  • Charging — target SOC, amp limit, charge timers, start/stop immediate charging
  • Charge locations — full CRUD for saved locations with per-location amp limits, min SOC, timers, departure times, and smart charging
  • Health — service warnings, fluid levels, tyre pressures (kPa), all exterior light warnings, 12V battery
  • Availability — vehicle online status with unavailable reason
  • Weather — temperature at car location
  • OTA — software update info, scheduling, install now, cancel
  • Pre-cleaning — air quality status (PM2.5, AQI) and start/stop cabin pre-cleaning

For the full API reference with all methods, models, and enums, see the docs.

Disclaimer

This project is not affiliated with, endorsed by, or in any way officially connected to Polestar, Volvo Cars, or any of their subsidiaries.

This library does not contain any proprietary code, or copyrighted material from Polestar or Volvo. All code is written from scratch by observing the behaviour of the official app.

All API interactions are based on reverse-engineered, undocumented interfaces. These may change or break without notice. Use at your own risk. The authors are not responsible for any consequences of using this software, including but not limited to vehicle malfunctions, warranty implications, or account restrictions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unofficial_polestar_api-0.1.0.tar.gz (87.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unofficial_polestar_api-0.1.0-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

Details for the file unofficial_polestar_api-0.1.0.tar.gz.

File metadata

  • Download URL: unofficial_polestar_api-0.1.0.tar.gz
  • Upload date:
  • Size: 87.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for unofficial_polestar_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 432199e008ee86ae6e0e6a5bb4eb9b4019d6d8b87b44ef16f993dd388e277a1b
MD5 81c86d181ed53b79e1363c6f59d87d28
BLAKE2b-256 469e449398443f966ab21294b4e4206e19e1bc13a11deeec37ec21cf6d572fa4

See more details on using hashes here.

File details

Details for the file unofficial_polestar_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unofficial_polestar_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d10c4142abc57115a1d6399845924aa3770d64095fba761216a27852ab2a89df
MD5 cb30b01180c973540ee0267060e6a8b2
BLAKE2b-256 fd63efc0690022ae74b931f6c0d08a5e1f6433d246f778b38709a3bd446effff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page