Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • We just completed a significant update, but we still have some fixes and adjustments to make, so please bear with us for the time being. Cheers!

Model S REST API

f8K37Sq31

Former Vendor
Jan 1, 2017
398
450
california
We can speculate, but we'll never know for sure. Well, wk057 might know, but he's not talking.

BTW, to access the live supercharge info, it was just a simple HTTP GET call, but it was over the in-car Tesla VPN and not accessible elsewhere.
Yes, I saw traffic over OpenVPN, but such traffic is not visible by anyone (encrypted), so I'm not sure how wk057 could have accessed it. Oh well. Let's just see if Tesla makes it available.
 

HankLloydRight

No Roads
Jan 18, 2014
12,821
10,834
Connecticut
Yes, I saw traffic over OpenVPN, but such traffic is not visible by anyone (encrypted), so I'm not sure how wk057 could have accessed it. Oh well. Let's just see if Tesla makes it available.

wk057 (and a few other people) have root access to the car, so they can reverse engineer the calls, as well as make their own calls through the VPN and retrieve and export the data.
 

dpskipper

Developer
Aug 4, 2016
187
44
Australia
Has anyone here figured out the syntax for summon? I'm trying to make my own code to use summon (just for fun) but I'm hitting a brick wall. Can someone give me some pointers on what I need to send to the server using websockets and how to format it?
Thanks.
 

hjtinon

Member
Feb 27, 2017
8
1
Houston
Had to stop fiddling with this because of work so now just picking this back up. Does anyone know if AWS is still blocked? I messed with my code so much before I found the forum and saw others were having trouble that I'm not sure if my code timing out is my fault or it's just an AWS problem. Thanks!
 

tliving

Member
Mar 8, 2014
751
102
New England, USA
Had to stop fiddling with this because of work so now just picking this back up. Does anyone know if AWS is still blocked? I messed with my code so much before I found the forum and saw others were having trouble that I'm not sure if my code timing out is my fault or it's just an AWS problem. Thanks!
AWS is still blocking or blocked (not sure which end). Use a proxy or relocate the code.
 

f8K37Sq31

Former Vendor
Jan 1, 2017
398
450
california
Have you noticed that the API often reports incorrect heading? It's typically off by either 90 or 180 degrees. I noticed that Tesla app also initially shows the incorrect heading for the car (the same one that the API reports) and then corrects the heading. All 3rd party apps that I have tried are affected by this.

response = {

"gps_as_of" = 14906975;

heading = 191;

latitude = "xx.981397";

longitude = "-xx.238153";

power = 1;

"shift_state" = "<null>";

speed = "<null>";

timestamp = 1490056976311;

};
 
  • Like
Reactions: SG57

HankLloydRight

No Roads
Jan 18, 2014
12,821
10,834
Connecticut
If speed is zero, that's what I'd expect. It needs velocity before it can calculate heading. Even with accurate GPS, you can get an accurate fixed location, but no heading without movement.
 

AllenWong

Member
Dec 9, 2014
738
292
Orlando, FL
I actually tend to find the heading to be correct most of the time. It's usually the heading of the direction, and not where the front of the car is facing. I have a parking spot that I have to back into, and the heading is always correctly pointing towards the back of the car after I park, because that is the last known direction I was heading.
 
  • Like
Reactions: SG57

HankLloydRight

No Roads
Jan 18, 2014
12,821
10,834
Connecticut
But I think with subtle GPS drift while the car is parked (or say inside a garage with limited GPS signal), it could get the last correct heading confused if it thinks the car moved a little bit. Most of the time my car is parked in the garage, and that shows in the app. But once in a while it's parked in the back yard. ;)
 

f8K37Sq31

Former Vendor
Jan 1, 2017
398
450
california
If speed is zero, that's what I'd expect. It needs velocity before it can calculate heading. Even with accurate GPS, you can get an accurate fixed location, but no heading without movement.

That's true if the car doesn't have a magnetometer (as most phones do these days).
The fact that Tesla app gets the heading right every time, leads me to believe that Tesla computes the heading using a magnetometer sensor whose output is not available through the API.
It is still strange that the heading reported by the API when the car is stationary, is off by 90 or 180 degrees (when it's reported incorrectly) not by a random offset.
 
  • Like
Reactions: SG57

ACDriveMotor

Member
Aug 11, 2013
890
24
Seattle, WA
Yep, it was originally some MITM proxy watching. Then I just decompiled the Android APK. In the new React Native version, they actually have a JSON file with all the endpoints listed: Tesla API Endpoints · GitHub

BTW, that shows a new /data endpoint. That gets a combination of all the *_state endpoints so you can get all that info in one call instead of 5 :)

Handy Gist - but it looks to me like /oauth/revoke does not work. Has anyone successfully used it?
 
  • Love
Reactions: bmah

rv10driver

Member
Feb 7, 2017
16
6
Boston Area
Oh good. I'll try my Alexa skill tonight. BTW, is anyone else seeing this in climate_state:

is_front_defroster_on: 3

I see
"is_front_defroster_on":null

I don't think I've seen
"is_front_defroster_on":3

But I don't think I've tried it with the front defroster on. My car is currently in service, but when I get it back I check with different settings. I'm still hoping for a way to control the rear seat heat from the API. Having to ask the driver to adjust your seat heat is silly.
 
Last edited:

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