Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Tesla API and battery data.

This site may earn commission on affiliate links.
So this is pretty cool. Tesla API

I can ask Tesla all sorts of information about my car via their REST API.

I have a brand new Model 3 SR+ and I'm wondering how it computes batter_range and ideal_battery_range, which in this case are the same at 212.62, and which are 3.38 miles off of the advertised range of 90% of 240.

When picking up the car I mentioned to the sales agent that I had actually wanted the aero wheels because of efficiency (I have the 19s) and he mentioned that there was headroom in the battery to compensate. Not sure I believe that, but I'd think it would be prudent for Tesla to actually ship a battery that, when brand new has a few percentage points of extra capacity. (Under promise, over deliver)


$ ./getcharge.sh
{
"response": {
"battery_heater_on": false,
"battery_level": 90,
"battery_range": 212.62,
"charge_current_request": 12,
"charge_current_request_max": 12,
"charge_enable_request": true,
"charge_energy_added": 0.0,
"charge_limit_soc": 90,
"charge_limit_soc_max": 100,
"charge_limit_soc_min": 50,
"charge_limit_soc_std": 90,
"charge_miles_added_ideal": 0.0,
"charge_miles_added_rated": 0.0,
"charge_port_cold_weather_mode": false,
"charge_port_door_open": true,
"charge_port_latch": "Engaged",
"charge_rate": 0.0,
"charge_to_max_range": false,
"charger_actual_current": 0,
"charger_phases": null,
"charger_pilot_current": 12,
"charger_power": 0,
"charger_voltage": 2,
"charging_state": "Complete",
"conn_charge_cable": "SAE",
"est_battery_range": 208.62,
"fast_charger_brand": "<invalid>",
"fast_charger_present": false,
"fast_charger_type": "MCSingleWireCAN",
"ideal_battery_range": 212.62,
"managed_charging_active": false,
"managed_charging_start_time": null,
"managed_charging_user_canceled": false,
"max_range_charge_counter": 0,
"minutes_to_full_charge": 0,
"not_enough_power_to_heat": null,
"scheduled_charging_pending": false,
"scheduled_charging_start_time": null,
"time_to_full_charge": 0.0,
"timestamp": 1569964713193,
"trip_charging": false,
"usable_battery_level": 90,
"user_charge_enable_request": null
}
}​
 
I'm curious about the timestamp returned. Does everyone receive the time as Pacific time? I took a road trip from So. Ca. to Louisville, Ky and recorded the vehicle data when I supercharged. The timestamp is not based on car location. Again, just curious.
Jim
 
I'm curious about the timestamp returned. Does everyone receive the time as Pacific time? I took a road trip from So. Ca. to Louisville, Ky and recorded the vehicle data when I supercharged. The timestamp is not based on car location. Again, just curious.
Jim

It is a Unix timestamp, the amount of time since Jan 1 1970 00:00:00 UTC. In this case, it is in milliseconds. Then you offset to your own timezone.