-
Notifications
You must be signed in to change notification settings - Fork 103
Share
Use the share function to send an address or media to your Tesla vehicle.
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 , 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](https://user-images.githubusercontent.com/97096/228144047-c4e85e7c-e2c7-412e-a2cf-ee72e84f1ea7.png)
Once you have your vehicle ID, you're ready to share.
The easiest way to test the share function is to go to Developer Tools > Services , 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
.
Following is an example Node-RED setup that shares an address with a vehicle. Simply replace the vehicle id with your own.
[
{
"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
}
]