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.
Collect the following information:
MQTT_PORT
and MQTT_TLS=true
Supply these values to the ENV vars below. The default data refresh interval is 30 minutes and can be overridden with ONSTAR_REFRESH with values in milliseconds.
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
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=
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 18.x.
MQTT auto discovery is enabled. For further integrations and screenshots see HA-MQTT.md.
npm run start
npm run test
npm run coverage
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).