Guide

How to track Tesla Model Y charging sessions via API

· 4 min read

To track charging sessions on a Tesla Model Y, query recharge segments from the DIMO Telemetry API and read the charging signals for the same time range. On a Tesla Model Y (2020 and newer), the Tesla connection (OEM cloud, no hardware) reports charging status, session energy in kWh, charge limit and state of charge in %.

DIMO gives developers API access to vehicle-state data: diagnostics, fault codes, battery and fuel health, odometer, and maintenance signals. Vehicle owners consent to and control sharing, so builders get data with clear provenance.

See the full signal list on the Tesla Model Y vehicle page. For any other vehicle, see how to track EV charging sessions.

Steps​

  1. Create a Developer License in the Developer Console and generate an API Key. You need your Client ID, Redirect URI and API Key.
  2. Get a Developer JWT. You can use the system-generated one in the Developer Console, or generate one with your API Key through a server SDK.
  3. Get the Model Y shared with your app through DIMO Connect.
  4. Exchange your Developer JWT for a Vehicle JWT through the Token Exchange API. Request privilege 1 (all-time, non-location data) and privilege 4 (all-time location), because the segments query needs both.
  5. Send the Vehicle JWT in the Authorization header of a Telemetry API request, in the form Authorization: Bearer <Vehicle JWT>.
  6. Query segments with mechanism: recharge over a range of up to 31 days. Recharge detection is hybrid: it uses charging signals and state of charge. Each segment returns start and end times, duration, and whether it is ongoing.
  7. Request signal aggregates per segment with signalRequests. For the Model Y, powertrainTractionBatteryChargingAddedEnergy (Session Energy, kWh) and powertrainTractionBatteryStateOfChargeCurrent (Current Charge Level, %) are signals the Tesla connection reports. The MAX aggregation gives the highest session energy reading, and LAST gives the charge level at the end of each session.
  8. To see how the Model Y was charging, read powertrainTractionBatteryChargingChargeCurrentAC (AC Current Charge, amps) and powertrainTractionBatteryChargingChargeVoltageUnknownType (Charging Voltage, volts). The Tesla connection reports both on this car.
  9. To check the live state, call signalsLatest and read powertrainTractionBatteryChargingIsCharging and powertrainTractionBatteryChargingIsChargingCableConnected.

Code​

query GetRechargeSessions {
segments(
tokenId: 12345
from: "2026-11-01T00:00:00Z"
to: "2026-11-07T00:00:00Z"
mechanism: recharge
signalRequests: [
{ name: "powertrainTractionBatteryChargingAddedEnergy", agg: MAX }
{ name: "powertrainTractionBatteryStateOfChargeCurrent", agg: LAST }
]
limit: 50
) {
start {
timestamp
}
end {
timestamp
}
duration
isOngoing
startedBeforeRange
signals { name agg value }
}
}

Replace 12345 with your vehicle's token ID and send the Vehicle JWT as a Bearer token: { "Authorization": "Bearer <yourVehicleJwt>" }.

To run this against a real Model Y, sign in to the Developer Console for a Developer License, then work through the authentication guide.

FAQ​

Which Model Y connection reports charging data?​

On a Tesla Model Y, the Tesla connection reports charging status, cable connected, session energy (kWh), charge limit (%), charging voltage (volts) and AC charge current (amps). It covers model year 2020 and newer and needs no hardware.

How do I know if a charging session is still running?​

Each segment has an isOngoing field. It is true when the session extends beyond the end of your query range, and in that case end is not included.

How far back can I query sessions?​

The segments query supports a maximum date range of 31 days per request. Use limit (default 100, maximum 200) and after to page through results.

Can I read the current charge state without segments?​

Yes. Query signalsLatest for powertrainTractionBatteryChargingIsCharging and powertrainTractionBatteryStateOfChargeCurrent to get the most recent values.

Methodology: based on the DIMO documentation for Authentication, Building Your First App, and the Telemetry API Signals and Segments references, and on the Tesla Model Y vehicle page.

More guides · Browse vehicles