Skip to content

BigThunderSR/homeassistant-addons-onstar2mqtt

Repository files navigation

OnStar2MQTT Home Assistant Add-on Repository

Home Assistant Add-on Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture CodeQL Lint Builder

Home Assistant Add-on combining my fork of michaelwoods/onstar2mqtt at BigThunderSR/onstar2mqtt and modifications to dannysporea/onstar2mqtt-addon's HA add-on config which provides the ability to run two independent instances if you have two vehicles that you would like to connect to.

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

Add-ons

This repository contains the following add-ons

If you prefer to use the OG build of onstar2mqtt 😎

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
  • NEW! - Provide MQTT topic (MQTT_ONSTAR_POLLING_STATUS_TOPIC) for Onstar Data Polling Status to monitor success/failure when OnStar is polled for data

    • MQTT_ONSTAR_POLLING_STATUS_TOPIC/lastpollsuccessful - "true" or "false" depending on status of last poll
    • MQTT_ONSTAR_POLLING_STATUS_TOPIC/state - Polling Status and Detailed Error Messages in JSON
    • NEW! - Automatic creation of pollingStatusTopic starting at v1.11.0
      • No longer need to specify MQTT_ONSTAR_POLLING_STATUS_TOPIC as this is now created automatically
      • Format is "homeassistant/(VIN)/polling_status/"
      • If it is explicitly specified, will use the specified value, so does not break backwards compatibility
  • NEW - Ability to dynamically change polling frequency using MQTT

    • Uses the value from "ONSTAR_REFRESH" on initial startup
    • Change the value dynamically by publishing the new refresh value in milliseconds (ms) as an INT to: "homeassistant/(VIN)/refresh_interval"
  • NEW - Command Response Status is now published to MQTT topics!

    • Topic format: MQTT_PREFIX/{VIN}/command/{commandName}/state
      • Note: Unless defined, default MQTT_PREFIX=homeassistant
  • NEW - Sensor specific messages are now published to MQTT as sensor attributes which are visible in HA

  • NEW - Most non-binary sensors have a state_class assigned to allow collection of long-term statistics in HA

  • NEW - Manual diagnostic refresh command and manual engine RPM refresh command are working

  • NEW - OnStar password/pin and MQTT password are masked by default in the console log output. To see these values in the console log output, set "LOG_LEVEL" to "debug"

  • NEW - New options for securing connectivity for MQTTS using TLS

    • MQTT_REJECT_UNAUTHORIZED (Default: "true", set to "false" only for testing.)
    • MQTT_CA_FILE
    • MQTT_CERT_FILE
    • MQTT_KEY_FILE
  • NEW - Ability to send commands with options using MQTT now works

    • Send commands to the command topic in the format:
      • {"command": "diagnostics","options": "OIL LIFE,VEHICLE RANGE"}
      • {"command": "setChargingProfile","options": {"chargeMode": "RATE_BASED","rateType": "OFFPEAK"}}
      • {"command": "alert","options": {"action": "Flash"}}
  • NEW - MQTT Button Auto-Discovery for HA Added Starting at v1.14.0
    • Buttons are added disabled by default because it's easy to accidentally press the wrong button and trigger an action at an inopportune time. Enable at your own risk and you assume all responsibility for your actions.
    • All available buttons for all vehicles are included for now, so only enable the buttons you need and/or work for your vehicle.

Helpful Usage Notes

  • The OnStar API has rate limiting, so they will block excessive requests over a short period of time.
    • Reducing the polling timeout to less than the default set by the add-on (30 minutes/1800000 ms) is likely to get you rate limited (Error 429).
  • The OnStar API can be very temperamental, so you may see numerous errors every now and then where you cannot get any data from your vehicle. These tend to be very sporadic and usually go away on their own.
    • A common example of this is: "Request Failed with status 504 - Gateway Timeout"
  • After your engine is turned off, the vehicle will respond to about 4 - 5 requests before going into a type of hibernation mode and will not respond to requests or commands until the engine is started up again. If your engine has been off for a while, you may still not be able to get any data from the vehicle or run commands even if it is your first attempt at trying to pull data from your vehicle after the engine was turned off.
    • Note: You will see an error of "Unable to establish packet session to the vehicle" when this occurs.

My other related project which provides additional capabilities through Node-RED

About

OnStarJS wrapper for MQTT as a Home Assistant Add-on

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •