npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

iobroker.polestar

v1.0.1

Published

ioBroker Adapter for Polestar

Readme

Logo

ioBroker.polestar

NPM version Downloads Number of Installations Current version in stable repository

NPM

Tests: Test and Release

polestar adapter for ioBroker

ioBroker Adapter for Polestar vehicles.

Features

  • Vehicle information (model, VIN, battery capacity, etc.)
  • Battery status (charge level, charging status, estimated range)
  • Odometer data
  • Health status (service warnings, days to service)
  • Automatic token refresh
  • Manual refresh via remote control state

Configuration

| Setting | Description | |---------|-------------| | Email | Polestar account email | | Password | Polestar account password | | Interval | Update interval in seconds (minimum 60) |

States

Battery

  • batteryChargeLevelPercentage - Current charge level (%)
  • chargingStatus - Charging status (Idle, Charging, Done, etc.)
  • estimatedDistanceToEmptyKm - Estimated range (km)
  • estimatedFullChargeRangeKm - Calculated range at 100% (km)
  • estimatedChargingTimeToFullMinutes - Time to full charge (min)
  • estimatedFullyChargedTime - Estimated full charge timestamp

Odometer

  • odometerMeters - Odometer (m)
  • odometerKm - Odometer (km)

Health

  • daysToService - Days until next service
  • distanceToServiceKm - Distance until next service (km)
  • serviceWarning - Service warning status
  • brakeFluidLevelWarning - Brake fluid warning
  • engineCoolantLevelWarning - Coolant level warning
  • oilLevelWarning - Oil level warning

Remote

  • refresh - Trigger manual data refresh

State Paths

All states are located under polestar.0.<VIN>.*. Example paths:

polestar.0.YSMVSEGEXPL110548.battery.batteryChargeLevelPercentage
polestar.0.YSMVSEGEXPL110548.battery.chargingStatus
polestar.0.YSMVSEGEXPL110548.battery.estimatedDistanceToEmptyKm
polestar.0.YSMVSEGEXPL110548.odometer.odometerKm
polestar.0.YSMVSEGEXPL110548.health.daysToService
polestar.0.YSMVSEGEXPL110548.remote.refresh

State Values

chargingStatus

| Value | Description | |-------|-------------| | CHARGING_STATUS_IDLE | Not charging | | CHARGING_STATUS_CHARGING | Currently charging | | CHARGING_STATUS_DONE | Charging complete | | CHARGING_STATUS_SCHEDULED | Scheduled charging | | CHARGING_STATUS_SMART_CHARGING | Smart charging active | | CHARGING_STATUS_FAULT | Charging fault | | CHARGING_STATUS_ERROR | Charging error |

serviceWarning

| Value | Description | |-------|-------------| | SERVICE_WARNING_NO_WARNING | No service needed | | SERVICE_WARNING_SERVICE_REQUIRED | Service required | | SERVICE_WARNING_REGULAR_MAINTENANCE_ALMOST_TIME_FOR_SERVICE | Service soon | | SERVICE_WARNING_REGULAR_MAINTENANCE_TIME_FOR_SERVICE | Time for service | | SERVICE_WARNING_REGULAR_MAINTENANCE_OVERDUE_FOR_SERVICE | Service overdue |

Warning States (brakeFluidLevelWarning, engineCoolantLevelWarning, oilLevelWarning)

| Value | Description | |-------|-------------| | *_NO_WARNING | No warning | | *_TOO_LOW | Level too low | | *_TOO_HIGH | Level too high (oil only) |

Scripting Examples

JavaScript: Check Battery and Send Notification

// Check battery level every hour and notify if low
on({ id: 'polestar.0.*.battery.batteryChargeLevelPercentage', change: 'ne' }, function (obj) {
    if (obj.state.val < 20) {
        sendTo('telegram.0', {
            text: `Polestar Akku niedrig: ${obj.state.val}%`
        });
    }
});

JavaScript: Log Charging Status Changes

on({ id: 'polestar.0.*.battery.chargingStatus', change: 'ne' }, function (obj) {
    const statusMap = {
        'CHARGING_STATUS_IDLE': 'Nicht laden',
        'CHARGING_STATUS_CHARGING': 'Laden',
        'CHARGING_STATUS_DONE': 'Vollgeladen',
        'CHARGING_STATUS_SCHEDULED': 'Geplant'
    };
    log(`Polestar Ladestatus: ${statusMap[obj.state.val] || obj.state.val}`);
});

JavaScript: Calculate Daily Driving Distance

// Save odometer at midnight and calculate daily distance
schedule('0 0 * * *', function () {
    const odometer = getState('polestar.0.YSMVSEGEXPL110548.odometer.odometerKm').val;
    const yesterday = getState('0_userdata.0.polestar.lastOdometer').val || odometer;
    const distance = odometer - yesterday;

    setState('0_userdata.0.polestar.lastOdometer', odometer, true);
    setState('0_userdata.0.polestar.dailyDistance', distance, true);

    log(`Heute gefahren: ${distance} km`);
});

JavaScript: Charging Complete Notification with Time

on({ id: 'polestar.0.*.battery.chargingStatus', val: 'CHARGING_STATUS_DONE' }, function (obj) {
    const battery = getState(obj.id.replace('chargingStatus', 'batteryChargeLevelPercentage')).val;
    const range = getState(obj.id.replace('chargingStatus', 'estimatedDistanceToEmptyKm')).val;

    sendTo('pushover.0', {
        message: `Polestar vollgeladen!\nAkku: ${battery}%\nReichweite: ${range} km`,
        title: 'Ladevorgang beendet'
    });
});

JavaScript: Service Reminder

// Check service status daily
schedule('0 8 * * *', function () {
    const daysToService = getState('polestar.0.YSMVSEGEXPL110548.health.daysToService').val;
    const kmToService = getState('polestar.0.YSMVSEGEXPL110548.health.distanceToServiceKm').val;

    if (daysToService < 30 || kmToService < 1000) {
        sendTo('email.0', {
            to: '[email protected]',
            subject: 'Polestar Service bald faellig',
            text: `Service in ${daysToService} Tagen oder ${kmToService} km`
        });
    }
});

Blockly: Battery Low Warning

Use the following trigger in Blockly:

  • Trigger: polestar.0.*.battery.batteryChargeLevelPercentage
  • Condition: Value < 20
  • Action: Send notification

VIS Widget Binding

{polestar.0.YSMVSEGEXPL110548.battery.batteryChargeLevelPercentage} %
{polestar.0.YSMVSEGEXPL110548.battery.estimatedDistanceToEmptyKm} km

Changelog

1.0.1 (2026-03-13)

  • (TA2k) Adapt to Polestar API changes - remove unavailable fields (fixes #13)
  • (TA2k) Split vehicle fetch into minimal + full request for robustness
  • (TA2k) Add Terms & Conditions auto-acceptance in login flow
  • (TA2k) Detect GraphQL UNAUTHENTICATED errors in HTTP 200 responses

1.0.0 (2026-02-12)

  • (TA2k) initial release based on website data

License

MIT License

Copyright (c) 2026 TA2k [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.