{"id":13715626,"url":"https://github.com/niklasvieth/polestar-ios-medium-widget","last_synced_at":"2025-05-07T04:30:58.123Z","repository":{"id":206193182,"uuid":"715991535","full_name":"niklasvieth/polestar-ios-medium-widget","owner":"niklasvieth","description":"Polestar iOS medium widget via Scriptable","archived":false,"fork":false,"pushed_at":"2025-03-26T08:17:59.000Z","size":1748,"stargazers_count":40,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-26T09:27:38.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklasvieth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T08:53:06.000Z","updated_at":"2025-03-26T08:17:34.000Z","dependencies_parsed_at":"2023-11-08T12:26:53.916Z","dependency_job_id":"2864f427-ae24-4e40-a1b4-a84ed5d9428b","html_url":"https://github.com/niklasvieth/polestar-ios-medium-widget","commit_stats":null,"previous_names":["niklasvieth/polestar-ios-medium-widget"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasvieth%2Fpolestar-ios-medium-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasvieth%2Fpolestar-ios-medium-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasvieth%2Fpolestar-ios-medium-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasvieth%2Fpolestar-ios-medium-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklasvieth","download_url":"https://codeload.github.com/niklasvieth/polestar-ios-medium-widget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252813716,"owners_count":21808374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T00:01:01.275Z","updated_at":"2025-05-07T04:30:56.997Z","avatar_url":"https://github.com/niklasvieth.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/niklasvieth","https://www.paypal.me/niklasvieth"],"categories":["Cars"],"sub_categories":[],"readme":"# Polestar SoC iOS Medium Widget\n\nAn iOS medium widget to display the current state of charge (SoC) of your Polestar.\n\n\u003cimg src=\"./images/polestar_medium_widget_relative.png\" width=\"300\" alt=\"Polestar Medium Widget Relative Date\"/\u003e\n\n\u003cimg src=\"./images/polestar_medium_widget.png\" width=\"300\" alt=\"Polestar Medium Widget\"/\u003e\n\n\u003cimg src=\"./images/polestar_medium_widget_light.png\" width=\"300\" alt=\"Polestar Medium Widget Light Mode\"/\u003e\n\n\u003cimg src=\"./images/polestar_medium_widget_charging.png\" width=\"300\" alt=\"Polestar Medium Widget Charging\"/\u003e\n\n\u003cimg src=\"./images/polestar_medium_widget_charging_done.png\" width=\"300\" alt=\"Polestar Medium Widget Charging Done\"/\u003e\n\n## Background\n\nSince the official Polestar App does not support any kind of widgets for iOS, I developed my own with the help of [Scriptable](https://scriptable.app/). It uses the official Polestar API which is also used to display the battery status in your profile at https://www.polestar.com.\n\n\u003e 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.\n## Prerequisites\n\n1. 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).\n2. Install [Scriptable](https://apps.apple.com/de/app/scriptable/id1405459188) on your iPhone\n3. [Optional but recommended] Follow the [ScriptDude installation steps](https://scriptdu.de/#installation)\n\n## Installation\n\n1. Make sure you have followed all mandatory steps described in [Prerequisites](./README.md#Prerequisites).\n\n2. There are two options to install the widget:\n    - [Recommended] Click on the following button to install via `ScriptDude` (make sure that you have followed step 3 of [Prerequisites](./README.md#Prerequisites)). ScriptDude will automatically receive updates of new versions of this widget\n\n        [![Download with ScriptDude](https://scriptdu.de/download.svg)](https://scriptdu.de/?name=Polestar%20Medium%20SoC%20Widget\u0026source=https%3A%2F%2Fgist.githubusercontent.com%2Fniklasvieth%2F159c13dd7ef94bd608358ce964b66c7c%2Fraw%2Fe05830e0f1b572089b99e73344ac192e8d7f808d%2Fpolestar-medium-widget.js\u0026docs=https%3A%2F%2Fgithub.com%2Fniklasvieth%2Fpolestar-ios-medium-widget%2Fblob%2Fmain%2FREADME.md#generator)\n\n    - Copy the content of [polestar-medium-widget.js](https://gist.github.com/niklasvieth/159c13dd7ef94bd608358ce964b66c7c), create a new script in `Scriptable`, paste the content and rename it to `Polestar Medium SoC Widget`.\n\n3. Replace the placeholder values for `POLESTAR_EMAIL` and `POLESTAR_PASSWORD` with your Polestar login credentials.\n\n    ```js\n    // Mandatory Config\n    const POLESTAR_EMAIL = \"EMAIL\";\n    const POLESTAR_PASSWORD = \"PASSWORD\";\n    ```\n\n4. [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.  \n\n    ```js\n    const IMAGE_ANGLE = \"0\"; // Possible values 0,1,2,3,4,5\n    const RANGE_IN_MILES = false; // true\n    const LAST_SEEN_RELATIVE_DATE = false; // true\n\n    const MIN_SOC_GREEN = 60;\n    const MIN_SOC_ORANGE = 30;\n    ```\n    \n    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\n    ```js\n    let VEHICLE_NAME; // default name \n    let VEHICLE_NAME = \"Thor\"; // change the name to \"Thor\"\n    ``` \n\n5. Add the medium `Scriptable` widget to your homescreen. See [Apple How-To guide](https://support.apple.com/en-us/HT207122#:~:text=How%20to%20add%20widgets%20to%20your%20Home%20Screen).\n\n    \u003cimg src=\"./images/scriptable_medium_widget.jpeg\" width=\"200\" alt=\"Scriptable Medium Widget\"/\u003e\n\n6. Tab on the widget to configure the widget. Select `Polestar Medium SoC Widget` as script, leave everything else blank.\n\n7. You should now be able to see the :battery: SoC of your Polestar on you homescreen. By clicking on the widget you will be navigated to the Polestar App.\n\n8. [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](https://support.apple.com/en-al/guide/mac-help/mchl52be5da5/mac#:~:text=Use%20iPhone%20widgets%20on%20your%20Mac)).\n\n## Additional comments\n\nThere might be a minor lag or difference of the SoC compared to value displayed in the Polestar App because of the following reason:\n\n- The refresh interval of the widget is determined by iOS itself.\n\nThe widget supports light and dark mode. The mode is automatically fetched from your settings. If you want to enable or disable dark mode via\n\n```js\nconst DARK_MODE = true // false\n```\n\n### Appreciation\n\n- Thanks @simonbs for the awesome [Scriptable](https://scriptable.app/) app.\n\n### Support me\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/niklasvieth)\n\n\u003ca href=\"https://www.paypal.me/niklasvieth\" \u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png\" alt=\"Donate with PayPal\" width=\"200px\" /\u003e\n\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasvieth%2Fpolestar-ios-medium-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklasvieth%2Fpolestar-ios-medium-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasvieth%2Fpolestar-ios-medium-widget/lists"}