Automatic


The automatic device tracker platform offers presence detection by retrieving your car’s information from the Automatic cloud service.

Setup

To use Automatic with Open Peer Power, first you must create a free development account. Automatic will generate a Client ID and Secret for you to use in your Open Peer Power configuration. You will need to update your Event Delivery preferences to ensure Open Peer Power can receive updates. On the developer page, under App Settings / Event Delivery, select “Websocket” for Event Delivery Preference. Next, specify the OAuth Redirect URL in the developer page. This should be configured to <open-peer-power-url>/api/automatic/callback. (Example: http://openpeerpower.local:8123/api/automatic/callback) Note that this URL only needs to be accessible from the browser you use to perform the authentication.

Open Peer Power can also take advantage of scope:current_location if available. This will allow Open Peer Power to receive periodic location updates during a trip. In order to use this functionality, you must request the scope for your application from Automatic. Once scope:current_location is available, change current_location to true in your configuration.yaml.

Configuration

Once your developer account is created, add the following to your configuration.yaml file:

# Example configuration.yaml entry
device_tracker:
  - platform: automatic
    client_id: 1234567
    secret: 0987654321
    devices:
      - 2007 Honda Element
      - 2004 Subaru Impreza
The device name must be the name given by Automatic automatically. This is typically the model year, make and model. This is *not* the nickname you have to give the vehicle in the `vehicles` section of the app's settings.

Open Peer Power will also fire events when an update is received from Automatic. These can be used to trigger automations, as shown in the example below. A list of available event types can be found in the Automatic Real-Time Events documentation.

# Example automatic event automation
automation:
  - trigger:
      - platform: event
        event_type: automatic_update
        event_data:
          type: "ignition:on"
          vehicle:
            id: "C_1234567890abcdefc"
    action:
      - service: light.turn_off
You can obtain the correct ID for your vehicle from your known_devices.yaml file. Be sure to lower-case any letters contained in your vehicle's ID when using it in an automation trigger.

See the device tracker integration page for instructions how to configure the cars to be tracked.