niklasvieth / polestar-ios-lockscreen-widget

Polestar iOS lockscreen widget via Scriptable
MIT License
26 stars 3 forks source link
ios lockscreen-widget polestar polestar2 scriptable scriptable-widgets

Polestar SoC iOS Lockscreen Widget

An iOS lockscreen widget to display the current state of charge (SoC) of your Polestar.

Polestar Lockscreen Widget

Background

Since the official Polestar App does not support any kind of widgets for iOS, I developed my own with the help of Scriptable. It uses the official Polestar API which is also used to display the battery status in your profile at https://www.polestar.com.

This widget is a hobby project and the developed code is not affiliated with Polestar AB or any Volvo company or any subsidiary or affiliate of any of the aforementioned companies.

Prerequisites

  1. Polestar Account login credentials which should work at https://polestarid.eu.polestar.com/PolestarLogin/ and VIN of your car.
  2. Install Scriptable on your iPhone
  3. [Optional but recommended] Follow the ScriptDude installation steps

Installation

  1. Make sure you have followed all mandatory steps described in Prerequisites.

  2. There are two options to install the widget:

    • [Recommended] Click on the following button to install via ScriptDude (make sure that you have followed step 3 of Prerequisites). ScriptDude will automatically receive updates of new versions of this widget

      Download with ScriptDude

    • Copy the content of polestar-lockscreen-widget.js, create a new script in Scriptable, paste the content and rename it to Polestar Lockscreen SoC Widget.
  3. Replace the placeholder values for EMAIL_ADDRESS and PASSWORD with your Polestar login credentials and provide your VIN.

    // Config
    const POLESTAR_EMAIL = "EMAIL_ADDRESS";
    const POLESTAR_PASSWORD = "PASSWORD";
    const VIN = "VIN";
  4. Add the smallest Scriptable widget to your lockscreen. See Apple How-To guide.

  5. Tab on the widget to configure the widget. Select Polestar Lockscreen SoC Widget as script, leave everything else blank and save your lockscreen.

  6. You should now be able to see the :battery: SoC of your Polestar on you lockscreen. By clicking on the widget you will be navigated to the Polestar App.

Additional comments

There might be a minor lag or difference of the SoC compared to value displayed in the Polestar App because of the following reason:

The icon has 4 different states.

  1. Charging cable not connected. The polestar icon will be displayed.

  2. Charging cable is connected, but car is currently not charging e.g. charging has not yet started or charging has been interrupted.

    Polestar Lockscreen Widget Connected
  3. Charging cable is connected, car is currently charging.

    Polestar Lockscreen Widget Charging
  4. Charging cable is connected, charging is done.

    Polestar Lockscreen Widget Done

Appreciation

Support me

"Buy Me A Coffee"

Donate with PayPal