Code Monkey home page Code Monkey logo

polestar-ios-lockscreen-widget's Introduction

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.