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 🙏

© 2024 – Pkg Stats / Ryan Hefner

npm-vwconnectidapi

v1.1.4

Published

Provides an API for We Connect ID

Downloads

71

Readme

npm-vwconnectidapi

NPM package for a We Connect ID API based on https://github.com/TA2k/ioBroker.vw-connect
and https://github.com/nightsha-de/npm-vwconnectapi

Clone this repository to $path and use

sudo npm install -g npm-vwconnectidapi

to install.

Example code:

const api = require('npm-vwconnectidapi');
const idStatusEmitter = api.idStatusEmitter;
var log = new api.Log();
var vwConn = new api.VwWeConnect();
vwConn.setLogLevel("INFO"); // optional, ERROR (default), INFO, WARN or DEBUG
vwConn.setCredentials("YourEmail", "YourPassword");

idStatusEmitter.on('currentSOC', (soc) =>  {
        console.log(soc);
});

vwConn.getData()
  .then(() => {
    
    vwConn.setActiveVin("the VIN of your ID"); // must exist in vwConn.vehicles
    //vwConn.startClimatisation().then(...)
    //vwConn.stopClimatisation().then(...)
    //vwConn.stopCharging().then(...)
    vwConn.startCharging()
      .then(() => {
        log.info("Charging started");
      })
      .catch(() => {
        log.error("Error while starting the charging");
      })
      .finally(() => {
        log.info("Exiting ...");
        vwConn.onUnload();
        process.exit(1);
      });
  })
  .catch(() => {
    log.error("something went wrong");
    process.exit(1);
  });

Methods supplied by the API:

All methods work with promises.

vwConn.setCredentials(user, password)

Login credentials. Pin is not needed for the ID cars.

vwConn.setLogLevel(logLevel)

Set/change the log level to "DEBUG", "INFO" or "ERROR" (default).

vwConn.getData()

Fills all data objects. If the process is not explicitly exited after getData (see example) it will regularly update the data in a given interval.

vwConn.setActiveVin(VIN)

Sets the VIN that is used for climatisation and charging. Setting is mandatory before clima or charging actions, VIN needs to exists in the vwConn.vehicles data.

vwConn.startClimatisation()

Start the air-conditioning.

vwConn.setClimatisation(temperature)

Set climatisation temperature.

vwConn.setClimatisationSetting(setting, value)

setting can be: climatizationAtUnlock climatisationWindowHeating climatisationWindowHeating climatisationFrontLeft climatisationFrontLeft climatisationFrontRight climatisationFrontRight. Set to true or false.

vwConn.stopClimatisation()

Stop the air-conditioning.

vwConn.setChargingSetting(setting, value)

setting can be: targetSOC: Target battery level in percent. chargeCurrent: "maximum" of "reduced". autoUnlockPlug: true or false, to automatically unlock plug when finished charging.

vwConn.setChargingSettings(targetSOC, maxChargeCurrent) -> soon to be deprecated in favor of vwConn.setChargingSetting

Change the target SOC and the maximum charge current ("maximum" or "reduced") for charging.

vwConn.startCharging()

Start charging.

vwConn.stopCharging()

Stop charging.

vwConn.setDestination(destination)

Sends a destination to the navigation system. 'destination' is a JS object with the following structure.

{
  destinations: [
    {
      poiProvider: "unknown",
      geoCoordinate: {
        longitude: 5.12345,
        latitude: 52.12345
      },
      destinationName: "Home",
      address: {
        country: "Nederland",
        street: "My Street 1",
        zipCode: "1234 AA",
        city: "My City"
      }
    }
  ]
}

Status changes emitted by the API:

'statusNotSafe' - car is parked and doors remain unlocked or windows opened for >5 minutes.
'parked' - Car is parked. Emits parking position as argument.
'notParked' - Car is on the move.
'chargePurposeReached' - Target state of charge reached.
'chargingStarted' - Charging started.
'chargingStopped' - Charging stopped.
'currentSOC' - Actuel state of charge changed. Emits SOC as argument.
'climatisationStopped' - Climatisation.
'climatisationStarted' - Climatisation started.
'climatisationCoolingStarted' - Climatisation started cooling.
'climatisationHeatingStarted' - Climatisation started heating.
'climatisationTemperatureUpdated' - Target climatisation temperature changed.

Objects supplied by the API:

vwConn.vehicles - List of vehicles

vwConn.idData - Car data for the IDs