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

Model S REST API

This site may earn commission on affiliate links.
Very cool!

Couple of notes:
1. Show heading?
2. sunroof is misspelled, but is there a way to detect the presence? Mine doesn't have one.

I fixed the misspelling.
I'll get rid of the sunroof stuff when it's not present soon. In terms of heading, I can list it with the rest of the telemetry, but I don't think the way I'm using the URL-Google Maps API allows me to actually depict the heading.
 
The built-in marker shapes on google maps are pretty good and really convenient to orient if you're using javascript to place the marker:

var marker = new google.maps.Marker({
position: latlng,
map: map,
title: date.toLocaleString(),
icon: {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
scale: 5,
fillColor: 'blue',
fillOpacity: 80,
rotation: x['heading'],
strokeWeight: 3,
}
});

(edited to un-table-ize the code I pasted in)
 
The built-in marker shapes on google maps are pretty good and really convenient to orient if you're using javascript to place the marker:

var marker = new google.maps.Marker({
position: latlng,
map: map,
title: date.toLocaleString(),
icon: {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
scale: 5,
fillColor: 'blue',
fillOpacity: 80,
rotation: x['heading'],
strokeWeight: 3,
}
});

(edited to un-table-ize the code I pasted in)

Right now I'm just putting the map in an iFrame, as follows:
<iframe width="600" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=xxx,yyy&output=embed&t=k">
 
Okay, I put it in there, but it does not work if the car is not in motion. I'm not using the streaming portal, and that is the only way to get the "est_heading".
I also made it so that the sunroof shouldn't show up if you don't have one, but can't test it :)
Tried it and it looks good to me.

- - - Updated - - -

Tried it and it looks good to me.
I just noticed that there is a pointer and marker "A". The pointer is where the car is, what does the "A" represent?

Maybe it shows on this link: https://maps.google.com/maps?q=30.25965,-97.808482&output=embed&t=k

JAK
 
My car is in service while I am away (mostly for an alignment). Just went to check on it and mobile access is disabled! It was on at 5:45pm.
I'm trying not to think what that's about.

But at least I got to test that code path.

I think it's standard procedure to turn off mobile access while the car is in the Tesla service center. Did you at least remember to hide a camera to capture the secret service password ;-)
 
Figures that I would get my command line charge timer working on the very same day that Tesla is rolling out 4.3 firmware updates. Oh well, at least I can still use the charge stop timer.

It took a while for an old Unix hack to migrate from cron over to launchd and to figure out how to get Mac OSX to wake up from it's sleep in order to run the commands to start/stop the charger.
 
Figures that I would get my command line charge timer working on the very same day that Tesla is rolling out 4.3 firmware updates. Oh well, at least I can still use the charge stop timer.

It took a while for an old Unix hack to migrate from cron over to launchd and to figure out how to get Mac OSX to wake up from it's sleep in order to run the commands to start/stop the charger.

Well, it was a good exercise for all of us. :)
 
The car returns charge time remaining in the charge status command, so you could just let it charge for a bit to stabilize, get the time, then turn off charging and schedule for that number of hours before the target completion time (plus slop).

I've considered doing that, but I'm not on TOU yet until I get a little more data on my usage patterns, so it wouldn't gain me anything yet. Voltage monitor is probably more important for me - I inevitably show in the low 230s even with minimum charge current during evening prime time.
 
I've also been wanting to track/control my MS from the computer, but I share the concern of sending my credentials over a third-party site, so I've created a bookmarklet which will dress up the api endpoint. It is bare minimum right now, but I am planning to put jquerymobile on it for more eye candy:

TeslaTime

This way, you are working directly with teslamotors.com and injecting code directly from github so everything's verifiable. Enjoy!