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

Owners API basic display

dave4444

Member
Aug 12, 2017
72
95
NH USA
I've been messing with the Owner's API to create my own stats retrieval interface. It's pretty complete at this point and I've made it usable by anyone now.

My objective was to create basic output from what is available in the owner's API and display a simple summary that can be viewed on my phone, computer, or in-car browser. No fancy graphs or pretty pictures, just basic text. It loads as quick as the owner's API returns data and is simple enough to actually render correctly in the horrible in-car browser.

Basically, you can get the same data as on the phone app, plus some additional items that are in the API but not shown in the app (such as battery vs charger power rate (you can tell how much charging power is going to HVAC and battery heater vs into the actual battery, as well as how much power the HVAC is drawing from the battery when parked), battery SOC limiting due to temperature, fast charger type and data, homelink nearby, last charge kwh added after charge finishes, battery in/out power rate even while driving, etc...), all in one page without having to click through multiple views. You can also choose to not wake up your car if it is sleeping (something the Tesla App doesn't do).

Feel free to give it a try at Tesla Login.

Some example output:

Parked

Name: MyTesla
VIN: 5YJSxxxxxxxxxxxxx
State: online, idle
SW Version: 2017.50.2 3bd9f6d
Battery Heater: off, ready
Battery: 70%, 68% usable, 90% limit, rate 0 kw, 0 kwh added
Charging State: disconnected, door closed, lock engaged
Charge Rate: n/a
Doors Open: none
Locks: doors locked
Location: 40.568482,-69.523545, homelink nearby
Movement: odometer 12345.6789, heading 116, gear unknown, speed unknown
Temperature: outside 26F, inside 38F, target 72F/72F
Climate Control: off, fan 0, seat 1/0, defrost off/off


Driving

Name: MyTesla
VIN: 5YJSxxxxxxxxxxxxx
State: online, driving
SW Version: 2017.50.2 3bd9f6d
Battery Heater: off, ready
Battery: 77%, 77% usable, 90% limit, rate -26 kw, 0 kwh added
Charging State: disconnected, door closed, lock engaged
Charge Rate: n/a
Doors Open: none
Locks: doors locked
Location: 40.568482,-69.523545, homelink far away
Movement: odometer 12345.6789, heading 282, gear D, speed 68
Temperature: outside 16F, inside 74F, target 72F/72F
Climate Control: on, fan 5, seat 1/0, defrost off/off


Charging with a CHAdeMO adapter

Name: MyTesla
VIN: 5YJSxxxxxxxxxxxxx
State: online, charging
SW Version: 2017.50.2 3bd9f6d
Battery Heater: off, ready
Battery: 64%, 64% usable, 90% limit, rate 45 kw, 23.44 kwh added
Charging State: charging, door open, lock engaged
Charge Rate: fast charger (Chademo), 45KW, 116A @ 386V, 0.67 hr remain
Doors Open: none
Locks: doors locked
Location: 40.568482,-69.523545, homelink far away
Movement: odometer 12345.6789, heading 114, gear P, speed unknown
Temperature: outside 20F, inside 55F, target 71F/71F
Climate Control: off, fan 0, seat 1/0, defrost off/off


Heating the battery from wall power when it is too cold to charge

Name: MyTesla
VIN: 5YJSxxxxxxxxxxxxx
State: online, heating
SW Version: 2017.50.2 3bd9f6d
Battery Heater: heating, ready
Battery: 68%, 66% usable, 75% limit, rate 0 kw, 0 kwh added
Charging State: charging, door open, lock engaged
Charge Rate: slow charger, max 40A, 4503W, 19A @ 237V, 0 hr remain
Doors Open: none
Locks: doors unlocked
Location: 40.568482,-69.523545, homelink nearby
Movement: odometer 12345.6789, heading 116, gear unknown, speed unknown
Temperature: outside 21F, inside 29F, target 72F/72F
Climate Control: off, fan 0, seat 1/0, defrost off/off


Charging with a L2 EVSE

Name: MyTesla
VIN: 5YJSxxxxxxxxxxxxx
State: online, charging
SW Version: 2017.50.2 3bd9f6d
Battery Heater: off, ready
Battery: 42%, 41% usable, 70% limit, rate 8 kw, 0.63 kwh added
Charging State: charging, door open, lock engaged
Charge Rate: slow charger, max 40A, 9440W, 40A @ 236V, 2.67 hr remain
Doors Open: none
Locks: doors locked
Location: 40.568482,-69.523545, homelink nearby
Movement: odometer 12345.6789, heading 117, gear unknown, speed unknown
Temperature: outside 23F, inside 35F, target 72F/72F
Climate Control: off, fan 0, seat 1/0, defrost off/off


Limitations at this point: I've only tested it on my car, so it works with that. It may work for X and 3 as well. Both LHD and RHD should be ok (the door status needed special handling), and only tested with NA car (single phase), EU 3 phase cars will probably display wrong (send me data if you have one). Also when fast charging the owner's API seems to be returning incorrect data for battery power vs charger power (normally there would be a difference when using HVAC), this seems be an issue on Tesla's end and only for fast chargers (L1/L2 is ok). The Owner's API tends to return "unknown" for some data occasionally (especially after just waking up), I just pass that through for now.

Feedback welcome.
 

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top