To track fuel level and refuels on a Toyota RAV4, call the DIMO Telemetry API: the signalsLatest query for the current reading and the segments query with the refuel mechanism for fill-ups. Use the DIMO LTE R1, which reports fuel level in liters (powertrainFuelSystemAbsoluteLevel) and supports refuel events.
The DIMO LTE R1 supports Toyota RAV4 model years 2007 and newer. The AutoPi also supports the RAV4, but it does not report fuel level or refuel events, so this guide uses the DIMO LTE R1. See the Toyota RAV4 vehicle page for the full signal list. 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. For any other vehicle, see how to detect refuels.
Steps
- Create a Developer License in the Developer Console and get a RAV4 shared with your app through DIMO Connect. You need a vehicle shared with you to fetch a Vehicle JWT.
- Get a Developer JWT. You need the Client ID, Redirect URI and API Key from your Developer License. The Developer JWT gives general API access but no vehicle data.
- Exchange the Developer JWT for a Vehicle JWT for that RAV4 using the Token Exchange API. Request both privilege 1 (all-time, non-location data), which covers fuel level, and privilege 4 (all-time location). The
segmentsquery requires the two together. - Send the Vehicle JWT in the
Authorizationheader of a Telemetry API request, in the formAuthorization: Bearer <Vehicle JWT>. - Query
signalsLatestforpowertrainFuelSystemAbsoluteLevelto read the current fuel level on a RAV4 with a DIMO LTE R1. It reports the value in liters. - Query
segmentswith therefueldetection mechanism to find periods where the fuel level rises significantly. Refuel segments include the level signal at the start and end by default. TuneminIncreasePercentinconfigif you need a different threshold; the default is 15. - Page through results with
limitandafter. A single segments query covers at most 31 days.
Code
Both queries use 12345 as a placeholder; replace 12345 with your vehicle's token ID.
Latest fuel level:
# Send your Vehicle JWT as a Bearer token in the Authorization header
query GetLatestFuelLevel {
signalsLatest(tokenId: 12345) {
powertrainFuelSystemAbsoluteLevel {
value
timestamp
}
}
}
Refuel segments over a date range:
# Maximum range: 31 days
query GetRefuels {
segments(
tokenId: 12345
from: "2026-11-01T00:00:00Z"
to: "2026-11-07T00:00:00Z"
mechanism: refuel
config: { minIncreasePercent: 15 }
limit: 50
) {
start {
timestamp
value { latitude longitude }
}
end {
timestamp
value { latitude longitude }
}
duration
isOngoing
signals { name agg value }
}
}
When you are ready to build, pick up a Developer License from the Developer Console and read the authentication guide.
FAQ
Which RAV4 connection reports fuel level?
The DIMO LTE R1 reports fuel level as powertrainFuelSystemAbsoluteLevel, in liters. The AutoPi does not report fuel level on the RAV4.
Which model years does this cover?
The DIMO LTE R1 supports Toyota RAV4 model years 2007 and newer.
How does DIMO detect a refuel?
The refuel segment mechanism detects where the fuel level rises significantly. The default minimum increase within a window is 15 percent, which you can change with minIncreasePercent.
Methodology: based on the DIMO documentation for Authentication, Building Your First App, and the Telemetry API Signals and Segments references, and on the Toyota RAV4 vehicle page.