You can install our site as a web app on your iOS device by utilizing the Add to Home Screen feature in Safari. Please see this thread for more details on this.
Note: This feature may not be available in some browsers.
I'm not sure what that means. The apiary doc seems to have more commands and parameter settings than the official application. Was there just trial and error? Did someone set up a proxy to capture traffic?By pulling apart the official phone app
I can't answer that exact question, but I believe that Tim was able to get the client_id by de-compiling the phone app...I'm not sure what that means. The apiary doc seems to have more commands and parameter settings than the official application. Was there just trial and error? Did someone set up a proxy to capture traffic?
I can't answer that exact question, but I believe that Tim was able to get the client_id by de-compiling the phone app...
Thanks, Tim. Nice work. I'm looking forward to Tesla opening up new capabilities.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
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
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
I've noticed some new fields in the response to vehicle_state:
'pf = 0'
'pr = 0'
'rhd = 0'
'rt = 0'
Maybe they are not new and I've just noticed them. Does anyone know what they mean?
Fixed it. For those using Swift, its not a query parameter and its not in the body. use session uploadTask
I'm having this exact issue with it resetting to 50% no matter what charge I use. Can you possibly email or respond with he exact Swift Code you used for uploadTask. I can't get it to work on my app for the life of me. Thanks ahead from a grateful beginner!
Hope this helps.
In essence you can see I set the percent charge to 60% in this example
let intVal:Int = 60
let strVal:String = String(intVal)
var strURL:String = ""
strURL = "https://owner-api.teslamotors.com/api/1/vehicles/" + myTesla.id + "/command/set_charge_limit"
let url = URL(string: strURL)!
let request = NSMutableURLRequest(url: url)
request.httpMethod = "POST"
request.addValue("Bearer " + teslaMgr.myTesla.token + "", forHTTPHeaderField: "Authorization")
let json: String = "percent=" + strVal
let jsonData = json.data(using: String.Encoding.utf8)
let session = URLSession.shared
let task = session.uploadTask(with: request as URLRequest, from: jsonData!, completionHandler: { data, response, error in
if let response = response, let data = data {
print(response)
print(String(data: data, encoding: String.Encoding.utf8)!)
} else {
print(error)
}
DispatchQueue.main.async(execute: {
print("Done")
})
})
task.resume()
I did some MITM proxy-watching hoping to be able to see how the car gets information related to super-charger occupancy.
It turns out that most of the exchanges are done using TLS (encrypted), so they are not visible. There are some xml files that are downloaded to the car, but they seem to be related to traffic condition and map. Here is an excerpt:
<Inrix docType="GetSegmentSpeedInRadius" copyright="Copyright INRIX Inc." versionNumber="9.8" createdDate="2017-03-16T00:33:59Z" statusId="0" statusText="" responseId="ebab3053-3252-4717-98d4-3bad5cd70b71"><SegmentSpeedResultSet coverage="8"><SegmentSpeedResults timestamp="2017-03-16T00:33:59Z"><Segment code="106P05014" type="TMC" speed="29" reference="63" travelTimeMinutes="1.214" /><Segment code="106N05014" type="TMC" speed="73" reference="64" travelTimeMinutes="0.51" />
Thanks for pointing this out. It's a very long thread. Looks like someone has been able to get the SC live status, but was asked by Tesla to bring it down. I wonder why Tesla doesn't make that info available outside the car (e.g., through a web interface).Have you seen this thread yet? Supercharger Live Status
I wonder why Tesla doesn't make that info available outside the car (e.g., through a web interface).