Go to file
dependabot[bot] 0cb79567d4
Bump onstarjs from 2.0.11 to 2.0.12
Bumps [onstarjs](https://github.com/samrum/OnStarJS) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/samrum/OnStarJS/releases)
- [Commits](https://github.com/samrum/OnStarJS/compare/v2.0.11...v2.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-06 06:39:48 +00:00
.github Bump actions/setup-node from v2.1.3 to v2.1.4 2020-12-17 06:56:12 +00:00
images add documentation for running and lovelace 2020-12-02 15:21:01 -05:00
src only define attr topic if provided a template 2020-12-28 14:51:34 -05:00
test only define attr topic if provided a template 2020-12-28 14:51:34 -05:00
.dockerignore github action and metadata files 2020-12-02 14:13:11 -05:00
.gitignore npm ci requires package-lock.json 2020-12-02 14:27:43 -05:00
Dockerfile add device config and minor updates 2020-12-27 21:55:49 -05:00
HA-MQTT.md add documentation for running and lovelace 2020-12-02 15:21:01 -05:00
LICENSE Initial version that queries vehicles and its diagnostics then prints to console. 2020-11-30 16:26:14 -05:00
package-lock.json Bump onstarjs from 2.0.11 to 2.0.12 2021-01-06 06:39:48 +00:00
package.json Bump onstarjs from 2.0.11 to 2.0.12 2021-01-06 06:39:48 +00:00
README.md retain messages, configure only at start 2020-12-27 21:22:13 -05:00

onstar2mqtt

A service that utilizes the OnStarJS library to expose OnStar data to MQTT topics.

The functionality is mostly focused around EVs (specifically the Bolt EV), however PRs for other vehicle types are certainly welcome.

There is no affiliation with this project and GM, Chevrolet nor OnStar. In fact, it would be nice if they'd even respond to development requests so we wouldn't have to reverse engineer their API.

Running

Collect the following information:

  1. Generate a v4 uuid for the device ID
  2. OnStar login: username, password, PIN
  3. Your car's VIN. Easily found in the monthly OnStar diagnostic emails.
  4. MQTT server information: hostname, username, password
    1. If using TLS, define MQTT_PORT and MQTT_TLS=true

Supply these values to the ENV vars below.

Docker

docker run \
  --env ONSTAR_DEVICEID= \
  --env ONSTAR_VIN= \
  --env ONSTAR_USERNAME= \
  --env ONSTAR_PASSWORD= \
  --env ONSTAR_PIN= \
  --env MQTT_HOST= \
  --env MQTT_USERNAME \
  --env MQTT_PASSWORD \
  michaelwoods/onstar2mqtt:latest

docker-compose

  onstar2mqtt:
    container_name: onstar2mqtt
    image: michaelwoods/onstar2mqtt
    restart: unless-stopped
    env_file:
      - /srv/containers/secrets/onstar2mqtt.env
    environment:
    - ONSTAR_DEVICEID=
    - ONSTAR_VIN=
    - MQTT_HOST=

onstar2mqtt.env:

ONSTAR_USERNAME=
ONSTAR_PASSWORD=
ONSTAR_PIN=
MQTT_USERNAME=
MQTT_PASSWORD=

Node.js

It's a typical node.js application, define the same environment values as described in the docker sections and run with: npm run start. Currently, this is only tested with Node.js 12.x.

Home Assistant configuration templates

MQTT auto discovery is enabled. For further integrations and screenshots see HA-MQTT.md.

Development

Running

npm run start

Testing

npm run test

Coverage

rpm run coverage

Releases

npm version [major|minor|patch] -m "Version %s" && git push --follow-tags

Publish the release on GitHub to trigger a release build (ie, update 'latest' docker tag).

TODO

  1. Logging library
  2. Figure out metric->imperial unit handling
  3. Enable write actions to lock doors, flash lights, remote start, etc.