niklasvieth / polestar-ios-medium-widget

Polestar iOS medium widget via Scriptable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polestar SoC iOS Medium Widget

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

Polestar Medium Widget Relative Date

Polestar Medium Widget

Polestar Medium Widget Light Mode

Polestar Medium Widget Charging

Polestar Medium Widget Charging Done

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/ (optionally the VIN of your car if more than one car is linked to the account).
  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-medium-widget.js, create a new script in Scriptable, paste the content and rename it to Polestar Medium SoC Widget.

  3. Replace the placeholder values for POLESTAR_EMAIL and POLESTAR_PASSWORD with your Polestar login credentials.

    // Mandatory Config
    const POLESTAR_EMAIL = "EMAIL";
    const POLESTAR_PASSWORD = "PASSWORD";
  4. [Optional Configuration] You can decide if you prefer the relative live counter or the absolute timestamp for the last seen date in the widget footer. Default is the relative format. Change the value to false if you prefer the absolute date. You can additionally choose the angle of the image to be shown in the widget, change the battery color threshold values and enable miles instead of kilometer values.

    const IMAGE_ANGLE = "0"; // Possible values 0,1,2,3,4,5
    const RANGE_IN_MILES = false; // true
    const LAST_SEEN_RELATIVE_DATE = false; // true
    
    const MIN_SOC_GREEN = 60;
    const MIN_SOC_ORANGE = 30;

    Using the setting below you can override the default vehicle name (Polestar 1/2/3) to a name of your choice, similar to the app functionality

    let VEHICLE_NAME; // default name 
    let VEHICLE_NAME = "Thor"; // change the name to "Thor"
  5. Add the medium Scriptable widget to your homescreen. See Apple How-To guide.

    Scriptable Medium Widget
  6. Tab on the widget to configure the widget. Select Polestar Medium SoC Widget as script, leave everything else blank.

  7. You should now be able to see the 🔋 SoC of your Polestar on you homescreen. By clicking on the widget you will be navigated to the Polestar App.

  8. [Optional] Mac users: You can even add the widget to you your Desktop or Notification Center if you have followed the above steps on you iPhone (see Apple How-To Guide).

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 refresh interval of the widget is determined by iOS itself.

The widget supports light and dark mode. The mode is automatically fetched from your settings. If you want to enable or disable dark mode via

const DARK_MODE = true // false

Appreciation

Support me

"Buy Me A Coffee"

Donate with PayPal

About

Polestar iOS medium widget via Scriptable

License:MIT License


Languages

Language:JavaScript 100.0%