GMC Vehicle / Onstar Integration

Hello, has there been any activity here? It’s the only integration I have in Alexa because there is no other alternative. I just want it to auto-lock each night.

Been using this for a few months

1 Like

Thank you, I will absolutely look into this. This looks a lot better than the one I found.

Hello,

I finally got around to trying this and I’ve gotten pretty far but there seems to be something missing. I got it set up in docker. It’s definitely communicating with GM and its confirming the connection to my MQTT but I have no new devices or entities in MQTT. MQTT is setup to receive newly discovered everything and I’ve seen that work with my other integrations. It feels like I’m just missing a silly final step to bring this all home. Can you tell me what I’m missing?

I have restarted HA a few times with no new results. Also forced some commands to my truck from the native app.

Google “MQTT Explorer”. It’s a free app that lets you read your MQTT messages. Confirm they are being written to MQTT server

1 Like

I will try that. Thanks for the direction pointing!

I see the last update on this was 1-26 and I was wondering if there has been any other updates. I just got Onstar back on my vehicle ('17 Silverado) because it will sit during the day and I would like to remote start before I get back to it.

My primary reason for wanting something like this is to make sure the doors are locked at night.

I don’t know much about MQTT and haven’t been able to dive into HA too deep but I would love to learn more about it.

I haven’t heard anything and if I’m being honest, you’ll get it a faster by doing the MQTT version above. It’s a little bit technical but I think if I was able to fumble my way through it, you could too. Unfortunately, within the last couple days I realized it wasn’t working and I went to research it and I’m receiving the same error somebody else is reporting and it may require dev work (I suspect a recent API change borked it): https://github.com/michaelwoods/onstar2mqtt/issues/190

I can let you know when it’s working again and help walk you through it. I use mine for the sole purpose of what you mentioned. To hit the locks each night.

You can do this with alexa but it requires you to give a voice code each night (you can trigger it to prompt you at bedtime)

There’s now a different docker image that’s resolved the errors people were receiving: https://github.com/michaelwoods/onstar2mqtt/issues/190#issuecomment-1216899585

@Sergeantpup You might have an easier time installing the Homebridge version as well as the Homebridge Alexa plugin and you’d be set.

I know this is several months old but I was hoping you could help me get this going on HA OS. I’ve looked all over for info on where to add the code for MQTT but have thus far been unsuccessful. If you have any tutorials or can point me in the right direction it would be greatly appreciated.

I decided to try the Homebridge as it seems very easy and was. I’ll try the MQTT later on as it seems more complex. Thanks for the info!

1 Like

The MQTT install wasn’t bad after watching a youtube on how to add it to HA.
For the location issue I posted a solution here: Suggested Fix for device tracker location · Issue #75 · BigThunderSR/homeassistant-addons-onstar2mqtt · GitHub

In case it gets lost:

configuration.yaml

mqtt:
  device_tracker:
  - name: "Location"
    state_topic: "homeassistant/device_tracker/ONSTAR_VIN/getlocation/state"
    value_template: "{% set ns = namespace(loc=[]) %}{% if (distance(value_json.latitude | float, value_json.longitude | float)*1000) <= state_attr('zone.home','radius') %}{% set ns.loc = ns.loc + [ 'home' ] %}{% else %}{% for zone in states.zone %}{% if distance(value_json.latitude | float, value_json.longitude | float, zone) * 1000 <= state_attr(zone.entity_id,'radius') %}{% set ns.loc = ns.loc + [ zone.name ] %}{% break %}{% endif %}{% endfor %}{% endif %}{% if ns.loc | length > 0 %}{{- ns.loc[0] }}{%else%}not_home{% endif %}"
    json_attributes_topic: "homeassistant/device_tracker/ONSTAR_VIN/getlocation/state"
    json_attributes_template: "{{ {'latitude': value_json.latitude | float, 'longitude': value_json.longitude | float } |tojson }}"
    device:
      identifiers:
      - ONSTAR_VIN
      manufacturer: *****
      model: '****'
      name: *****
    unique_id: ONSTAR_VIN-location
    source_type: gps
    payload_home: "home"
    payload_not_home: "not_home"
1 Like

I’m using the Onstar2 package in NodeRed. Works pretty well so far…

1 Like

@Audreth, per our discussion in your issue report, I tried adding quotes to the state_topic and even then, the vehicle status works without any issues just using the default configuration that is shown in the HA-MQTT.md file. I’m guessing something is amiss on what is being read back to HA via MQTT for your location topic, so would need to see the raw data to troubleshoot the issue which I know you are not interested in because you have your workaround.

@BigThunderSR Any idea what might be happening here?

EDIT: Nevermind, found your response here: "ONS-216" after running for a while - rate limiting? · Issue #291 · michaelwoods/onstar2mqtt · GitHub

Feel like this should be added to the readme as I tried implementing this when the family went to bed, hours after the vehicle had been turned off. Might help someone else.

@Maverick0984, I added a “Helpful Usage Notes” section in the README. Hope this works for what you were expecting, but LMK if not.