Skip to content
Nathan edited this page Mar 12, 2024 · 4 revisions

Use the share function to send an address or media to your Tesla vehicle.

Getting Your Vehicle's ID

To share with a vehicle, you will need its ID. The vehicle's ID can be found by going to your vehicle's device page Open your Home Assistant instance and show your devices., then clicking the vehicle's "Online" sensor and expanding the Attributes section. It's the ID attribute (not to be confused with Vehicle ID).

picture of vehicle's online sensor's attributes showing the vehicle id

Once you have your vehicle ID, you're ready to share.

Example Address Service Call

The easiest way to test the share function is to go to Developer Tools > Services Open your Home Assistant instance and show your service developer tools., clicking "Go to YAML mode" and pasting in the following YAML, replacing vehicle_id with your ID and android.intent.extra.TEXT with any address you like.

service: tesla_custom.api
data:
  command: SEND_TO_VEHICLE
  parameters:
    path_vars:
      vehicle_id: 1234567890 # see the "Getting your Vehicle ID" section 
    type: "share_ext_content_raw"
    locale: "en-us"
    value:
      android.intent.extra.TEXT: "CA-2, Tujunga, CA 91042" # Address goes here
    timestamp_ms: >-
          {{ as_timestamp(now()) | int }}

The incorrect ID will result in the error Failed to call service tesla_custom.api. Unknown error.

Node-RED Example

Following is an example Node-RED setup that shares an address with a vehicle. Simply replace the vehicle id with your own.

image

[
  {
    "id": "57cf3849b924dc27",
    "type": "inject",
    "z": "b8e997033c755179",
    "name": "California 2",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "topic": "",
    "payload": "CA-2, Tujunga, CA 91042",
    "payloadType": "str",
    "x": 750,
    "y": 80,
    "wires": [
      [
        "343d73c3ec32460a"
      ]
    ]
  },
  {
    "id": "343d73c3ec32460a",
    "type": "api-call-service",
    "z": "b8e997033c755179",
    "name": "Share",
    "server": "3cc72cc1.340094",
    "version": 5,
    "debugenabled": false,
    "domain": "tesla_custom",
    "service": "api",
    "areaId": [],
    "deviceId": [],
    "entityId": [],
    "data": "{\t  \"command\": \"SEND_TO_VEHICLE\",\t  \"parameters\": {\t    \"path_vars\": {\t      \"vehicle_id\": 123456789\t    },\t    \"wake_if_asleep\": true,\t    \"type\": \"share_ext_content_raw\",\t    \"locale\": \"en-us\",\t    \"value\": {\t      \"android.intent.extra.TEXT\": payload\t    }\t  }\t}",
    "dataType": "jsonata",
    "mergeContext": "",
    "mustacheAltTags": false,
    "outputProperties": [],
    "queue": "none",
    "x": 950,
    "y": 80,
    "wires": [
      []
    ]
  },
  {
    "id": "3cc72cc1.340094",
    "type": "server",
    "name": "Home Assistant",
    "addon": true
  }
]