Automatic ODB II Issue

How many vehicles do you have on your account?

Two, but only one is tracked (i.e. track: false in known_devices.yaml for the unused vehicle)

Doesn’t the below fire when either vehicle is started?

- alias: "AutoPro Real-Time Event: ignition on"
  hide_entity: true
  trigger:
    platform: event
    event_type: automatic_update
    event_data:
      type: "ignition:on"

Got the following events working so far.

Can someone help me understand how one retrieves the websocket object data once the event is triggered? For example, in the case of trip:finished, how do I access vehicle id, started_at, ended_at, etc fields? In other words, the items listed in this example:

EXAMPLE TRIP FINISHED OBJECT WEBSOCKET
{
  "id": "f61ba3d5-a68e-43eb-a731-0db871b4d3a3",
  "user": {
    "id": "U_ffd955ba63db5c25",
    "url": "https://api.automatic.com/user/U_ffd955ba63db5c25/"
  },
  "type": "trip:finished",
  "created_at": "2015-04-12T17:45:18.123Z",
  "time_zone": "America/Los_Angeles",
  "location": {
    "lat": 37.757076,
    "lon": -122.448120,
    "accuracy_m": 10,
    "created_at": "2015-04-12T17:45:01.123Z"
  },
  "vehicle": {
    "id": "C_507d6f1bd6d9b855",
    "url": "https://api.automatic.com/vehicle/C_507d6f1bd6d9b855/"
  },
  "device" : {
    "id": "021ac91c826b12eca99e685c"
  },
  "trip" {
    // Trip Object (matches REST API)
  }
}

@Coolie1101 Knowing that, one could then simply check the vehicle_id token in a condition to make sure it’s the vehicle of interest.

Yeah I have the exact same scopes as you but not getting real time location …

this is my setup

- platform: automatic
  client_id: !secret automatic_client_id
  secret: !secret automatic_secret
  current_location: true

How do you enable / install Websocket in HA for Heartbeat functionality ?

Here’s my configuration:

device_tracker:
  - platform: automatic
    client_id: !secret automatic_client_id
    secret: !secret automatic_secret
    current_location: true

… and of course I have the Event Delivery Preference set to WEBSOCKET at Automatic Developer site.

Client type ?

Cofidential / Web or Public / Native ???

I am getting an error don’t know why

2017-09-17 19:59:54 INFO (Thread-6) [homeassistant.components.device_tracker.netgear] Scanning
2017-09-17 19:59:54 INFO (Thread-6) [pynetgear] Get attached devices
2017-09-17 19:59:54 INFO (MainThread) [aioautomatic.client] Creating session from oauth code.
2017-09-17 19:59:56 INFO (MainThread) [aioautomatic.session] Fetching vehicles.
2017-09-17 19:59:56 INFO (MainThread) [aioautomatic.session] Fetching trips.
2017-09-17 19:59:56 INFO (MainThread) [aioautomatic.session] Fetching trips.
2017-09-17 19:59:56 INFO (MainThread) [aioautomatic.client] Opening websocket connection.
2017-09-17 19:59:57 INFO (MainThread) [homeassistant.components.device_tracker.automatic] Websocket connected.
2017-09-17 20:00:02 ERROR (MainThread) [homeassistant.components.device_tracker.automatic]

Client Type: Confidential/Web

Thanks !!

Did you request to switch to production mode ?

No I did not

Thanks Tomy !! @tggman

NEW PROBLEM:
While real time location tracking/events work fine right after an HASS restart, they stop working after about 12 hours. Best I can tell this problem surfaced at the same time the OAuth2 updates were made, but I can’t be sure (lots of reboots since then).

From the LOG:
2017-09-17 14:38:31 ERROR (MainThread) [homeassistant.components.device_tracker.automatic] err_invalid_refresh_token

**Typical (and expected) error at restart but OAuth2 authentication goes thru without issue + real time events work fine

14 Hours Later:
2017-09-18 04:59:11 ERROR (MainThread) [homeassistant.components.device_tracker.automatic] Websocket error detected. Connection closed.
2017-09-18 04:59:17 ERROR (MainThread) [homeassistant.components.device_tracker.automatic] Error opening websocket connection:

**ALL real time events stop (ignition:on/off, heartbeat location tracking, etc )…

ANYBODY ELSE having this issue?

Yes I am having the same issue after the fix in 0.52. Works fine after restart/reauth, but then stops working after sometime. I just restarted again this morning, so I will try to see exactly when it happens again.

I have two automatic pros…

Oh finally , Tommy this is what I was talking about … same problem here …

I just noticed that today it started updating again, even though I haven’t rebooted in 2-3 days.

However, I’m still getting the following error sporadically:
2017-09-19 11:01:17 ERROR (MainThread) [homeassistant.components.device_tracker.automatic] Websocket error detected. Connection closed.

Do you know how I can apply the above to the Automations below?

  • alias: Vehicle Started
    trigger:

    • platform: event
      event_type: automatic_update
      event_data:
      type: “ignition:on”
      action:
  • service: notify.telegram
    data:
    message: Vehicle has Started.

  • alias: Vehicle Speeding
    trigger:

    • platform: event
      event_type: automatic_update
      event_data:
      type: “notification:speeding”
      action:
    • service: notify.telegram
      data:
      message: Vehicle is speeding.

I currently have Automations setup for the following which fires when the event is updated, but I have no Idea how to get the additional info like which vehicle or if possible the vehicle location.

Getting :

err_internal_error

Any ideas

Starting getting this today too after upgrading to 0.54