Skip to content

Services

polestar_api.services

Service client wrappers grouped by vehicle capability area.

AmpLimitServiceClient

AmpLimitServiceClient(connection: GrpcConnection, vin: str)

BatteryServiceClient

BatteryServiceClient(connection: GrpcConnection, vin: str)

Battery service wrapper.

get_latest async

get_latest() -> Battery | None

Get the latest battery status, or None if the backend omits it.

stream async

stream() -> AsyncIterator[Battery]

Stream battery status updates.

ChargeLocationServiceClient

ChargeLocationServiceClient(connection: GrpcConnection, vin: str)

get_locations async

get_locations() -> list[ChargeLocation]

Get saved charge locations.

is_at_location async

is_at_location() -> dict

Check if car is at a saved charge location.

Returns dict with 'location_id' (str) and 'arrived_at' (int timestamp).

create_at_car_location async

create_at_car_location(alias: str, amp_limit: int = 0, minimum_soc: int = 0, optimised_charging: bool = False) -> ChargeLocation | None

Create a new charge location at the car's current position.

update_alias async

update_alias(location_id: str, alias: str) -> int

Update a charge location's alias. Returns status code.

update_amp_limit async

update_amp_limit(location_id: str, amp_limit: int) -> int

Update a charge location's amp limit. Returns status code.

update_minimum_soc async

update_minimum_soc(location_id: str, minimum_soc: int) -> int

Update a charge location's minimum SOC. Returns status code.

update_optimised_charging async

update_optimised_charging(location_id: str, enabled: bool) -> int

Enable or disable optimised charging at a location. Returns status code.

delete_location async

delete_location(location_id: str) -> int

Delete a saved charge location. Returns status code.

ChargeNowServiceClient

ChargeNowServiceClient(connection: GrpcConnection, vin: str)

start async

start() -> int

Start charging now (override timer). Returns status code.

stop async

stop() -> int

Stop charge now override. Returns status code.

ChargeTimerServiceClient

ChargeTimerServiceClient(connection: GrpcConnection, vin: str)

ClimateServiceClient

ClimateServiceClient(connection: GrpcConnection, vin: str)

Parking climatization status service.

stream async

stream() -> AsyncIterator[ClimatizationInfo]

Stream parking climatization status updates.

DashboardServiceClient

DashboardServiceClient(connection: GrpcConnection, vin: str)

Dashboard and connectivity status service.

ExteriorServiceClient

ExteriorServiceClient(connection: GrpcConnection, vin: str)

Exterior status service.

stream async

stream() -> AsyncIterator[ExteriorStatus]

Stream exterior status updates (server-push).

InvocationServiceClient

InvocationServiceClient(connection: GrpcConnection, vin: str)

Car command service — lock, unlock, climate, windows, pre-cleaning, honk/flash.

precleaning_start async

precleaning_start() -> bytes

Start pre-cleaning and return the raw invocation response bytes.

precleaning_stop async

precleaning_stop() -> bytes

Stop pre-cleaning and return the raw invocation response bytes.

LocationServiceClient

LocationServiceClient(connection: GrpcConnection, vin: str)

Vehicle location service.

OdometerServiceClient

OdometerServiceClient(connection: GrpcConnection, vin: str)

Odometer service.

OtaServiceClient

OtaServiceClient(connection: GrpcConnection, vin: str)

get_software_info async

get_software_info() -> CarSoftwareInfo | None

Get software update info from the first stream message, or None if missing.

get_schedule async

get_schedule() -> Scheduler | None

Get the current OTA schedule from the first stream message, or None if missing.

schedule async

schedule(software_id: str, relative_time: int = 0) -> Scheduler | None

Schedule an OTA install. relative_time is seconds from now.

ParkingClimateTimerServiceClient

ParkingClimateTimerServiceClient(connection: GrpcConnection, vin: str)

Parking climate timer management (chronos service).

get_timers async

get_timers() -> list[ParkingClimateTimer]

Get all parking climate timers.

set_timer async

set_timer(timer: ParkingClimateTimer) -> int

Create or update a parking climate timer.

delete_timer async

delete_timer(timer_id: str) -> int

Delete a parking climate timer. Returns status code.

get_timer_settings async

get_timer_settings() -> ParkingClimateTimerSettings

Get the default climate settings for parking climate timers.

set_timer_settings async

set_timer_settings(settings: ParkingClimateTimerSettings) -> int

Set the default climate settings for parking climate timers.

PreCleaningServiceClient

PreCleaningServiceClient(connection: GrpcConnection, vin: str)

Pre-cleaning air quality status (read-only).

stream async

stream() -> AsyncIterator[PreCleaningInfo]

Stream pre-cleaning status updates.