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.
I don't think it's in the apiary yet. He has an issue open against it here: https://github.com/timdorr/model-s-api/issues/4

It works like this (from earlier in the thread):

/command/set_charge_limit?state=set&percent=(limit)

Where limit is 50-90. Anything outside this range will set the limit to 50. Not sure if "state" takes other values or what. Maybe there's a way to set range mode in there?

Anything above 90 will set the limit to 100.
 
I'm just getting started with logging via streaming.js, and thought I had it all working... then today I noticed some weird behavior. I have a bunch of lines that look like this:

4 Dec 09:21:28 - getting charge state Aux data14 Dec 09:21:28 - getting climate state Aux data
14 Dec 09:22:28 - getting

During a period where I know the car was in motion, and visualize.js seems to indicate that nothing was stored in the database for that period. I restarted streaming.js, and the car jumped to its new location. Any idea why logging got hung up and I had to restart? Is that common?
 
I'm just getting started with logging via streaming.js, and thought I had it all working... then today I noticed some weird behavior. I have a bunch of lines that look like this:



During a period where I know the car was in motion, and visualize.js seems to indicate that nothing was stored in the database for that period. I restarted streaming.js, and the car jumped to its new location. Any idea why logging got hung up and I had to restart? Is that common?

Definitely not common in my experience to have the data collection hang. The logging output is not unusual. Javascript is non-blocking and sometimes two different functions can be writing to the console at the same time. Let me know by PM or otherwise if the data collection hangs again. BTW, I just published Version 0.8.4 which has better sleep mode detection and fixes a very rare bug that may wake your car unnecessarily.
 
Sounds good. Thanks for the response. I'll update and keep an eye on it. I'd also like to investigate the MongoDB query syntax. Maybe the location was logged and for some reason visualize.js just can't pull it from the DB. If it happens again, that would be useful information. I did notice that when it appeared to stop logging/displaying GPS information, when on the map mode of visualize.js, the replay control bar wouldn't play past the a certain place in the timeline. I'd set it to a point I know I was moving, and it would skip several hours into the past when the car was still in the garage.
 
What's the easiest way to 'detect' the version that I have running ?
The easiest I found was:
Code:
npm list -g | grep teslams

Still having trouble tracking down my problem. I'm starting to think it's in visualize.js somewhere, as streaming.js *seems* to be logging data correctly (I can see GPS data flowing by, and it appears to be connected to the DB). I'm not sure how to tell for sure, though. Visualize.js often just sits there loading indefinitely until my browser times out if I select certain date ranges.

If I restart visualize.js I can usually get the map to load once. It will be responsive up to a certain time in the Replay Control slider. If you exceed that time, visualize.js stays in a state of semi-brokenness until it's restarted. For example, something appears to have happened at 6:02pm yesterday. If I make my date range a day before and a day after, the slider will operate until 12/14 @ 6:02pm. If I try to drag the slider past that, when I let go of the mouse it immediately jumps back to 12/14 6:02pm. If the streaming.js terminal is to be believed, I should have data flowing into the database, but I cannot view it.

Any suggestions for how to debug what's going on?
 
Has anyone ever seen battery_heater_on = true in the charge state response?

I am querying through many days worth of data including times I know I saw a battery heater notification on the dashboard and I see nothing.

Is there a verified way of knowing that the battery heater is actually on? I am trying to see if some of my vampire drain is from battery heating and/or 12V battery charging.
 
I wrote a script to monitor sleep mode on my car. I can tell you that it loses substantially more miles when it wakes up in < 40 F compared to when it wakes up during the day in 50+ temps. Whether this is due to some range calculation vs battery heating I'm not sure, but I suspect the latter.

I have not explored the battery heater api so cannot help you out there. However, please post whatever you find out here because I will be very interested.
 
Question:
Does the ReST Interface to the Model S report GPS Elevation?
If so this would be valuable information in factoring in elevation changes impact on range.

REST interface does not report GPS elevation (that I know of today) but the streaming interface does. Keep in mind that GPS elevation is notoriously inaccurate. I watch the data stream report that my car is moving up and down by several meters while it's parked the driveway. For larger elevation changes, like climbing in mountainous areas, it should be helpful.
 
REST interface does not report GPS elevation (that I know of today) but the streaming interface does. Keep in mind that GPS elevation is notoriously inaccurate. I watch the data stream report that my car is moving up and down by several meters while it's parked the driveway. For larger elevation changes, like climbing in mountainous areas, it should be helpful.

An alternative is to use the Google Elevation API to get elevation from latitude and longitude.

The Google Elevation API - Google Maps API Web Services Google Developers
 
REST interface does not report GPS elevation (that I know of today) but the streaming interface does. Keep in mind that GPS elevation is notoriously inaccurate. I watch the data stream report that my car is moving up and down by several meters while it's parked the driveway. For larger elevation changes, like climbing in mountainous areas, it should be helpful.

Good to know. For range planning/characterization 7m noise is in the noise.

An alternative is to use the Google Elevation API to get elevation from latitude and longitude.

The Google Elevation API - Google Maps API Web Services Google Developers

Excellent idea.

Thanks