Getting Started

Telemetry

Using the Tesla Fleet Telemetry

Teslemetry allows you to configure Tesla Fleet Telemetry for each supported vehicle. This data can be accessed using Server Sent Events (SSE) or Webhooks.

Setup

  • Login to the Teslemetry console
  • Follow the instructions to install the virtual key if its missing
  • Click the Telemetry button on a vehicle
  • Select a region
  • Select at least one field
  • Click Start / Update Streaming

Every time you make a change, you will need to click Start / Update Streaming to send the new configuration to your vehicle.

Limitations

Fleet Telemetry is a new capability, and there are a number of limitations imposed by Tesla:

  • Currently requires the OWNER permission. (Tesla has advised this will change in the future)
  • Is not supported on pre 2021 Model S/X vehicles with MCU 1 or MCU 2.
  • Can only be active on one third party service at a time.
  • Requires the vehicle to be running version 2023.20 or newer.
  • Is limited to 20 fields total, and 10 values per minute. (This should increase in the future)

Webhooks

Login to the Teslemetry console, and click the "Telemetry" button on a vehicle to config webhooks. You can add up to 10 webhook configurations, which require a URI, predefined format, and optionally an Authorization header. You must configure and start streaming before webhooks will be sent.

You do not need a subscription or access tokens to use Webhooks in Teslemetry.

The three formats available are:

Tesla / Raw format
{
 "data": [
  {
   "key": "Location",
   "value": {
    "locationValue": {
     "latitude": 30.2226645,
     "longitude": -97.6213806
    }
   }
  },{
   "key": "VehicleSpeed",
   "value": {
    "stringValue": "34.797"
   }
  }
 ],
 "createdAt": "2024-02-24T04:58:44.983607402Z",
 "vin": "LRW3..."
}
Teslemetry format
{
 "data": {
  "Location": {
   "latitude": 30.2226645,
   "longitude": -97.6213806
  },
  "VehicleSpeed": "34.797"
 },
 "createdAt": "2024-02-24T04:58:44.983607402Z",
 "vin": "LRW3..."
}
Splunk format
{
 "time": 1708737795.9836073,
 "host": "us-west.teslemetry.com",
 "source": "LRW3...",
 "event": {
  "Location": {
   "latitude": 30.2226645,
   "longitude": -97.6213806
  },
  "VehicleSpeed": "34.797"
 }
}

Server Sent Events

After streaming has been configured and started, you can connect to the Teslemetry server you selected using an access token, to stream telemetry events in realtime to your application. Optionally include a VIN to listen for a single vehicle, or leave it out to listen to all your vehicles. Server Side Events use the Teslemetry format shown above. Teslemetry provides an open source Python 3 library.

Curl Example
curl --header "Authorization: Bearer {token}" 'https://{server}.teslemetry.com/sse/{vin}'
Browser Example (less secure)
https://{server}.teslemetry.com/sse/{vin}?token={token}
Python Example
import asyncio, aiohttp, teslemetry_stream
async def main():
  async with aiohttp.ClientSession() as session:
    stream = teslemetry_stream.TeslemetryStream(
      access_token="{token}",
      vin="{vin}",
      server="{server}",
      session=session,
    )

    async def callback(event):
    print(event)

    asyncio.create_task(stream.listen(callback))

    await asyncio.sleep(60)
    await stream.close()
    
asyncio.run(main())