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.
The car has to be active/online. I think there is a wakeup-command. Or just enable/disable the AC, then you will get the values.

Thanks. I was able to get it to work. Does anyone know if there is a command to enable/disable seat heaters?

[seat_heater_left] = [1]
[seat_heater_right] = [0]
[seat_heater_rear_left] = [0]
[seat_heater_rear_right] = [0]
[seat_heater_rear_center] = [0]
[seat_heater_rear_right_back] = [0]
[seat_heater_rear_left_back] = [0]
 
Hi folks, are there any tricks to getting data for inside/outside temps? Below is what I am getting...

[inside_temp] = []
[outside_temp] = []
[driver_temp_setting] = [24.4]
[passenger_temp_setting] = [24.4]

In order for you to get the data from those sensors, the car must be "online". I found that those sensors go offline pretty quickly after having just awoken the car. You can wake them up and continue gathering data by turning on the AC system or moving the pano roof (if installed). However I'm not sure if trying to move a sun roof on a Tesla that does not have one installed will still wake up the temp sensors. Would be cool if it did.
 
Thanks. I was able to get it to work. Does anyone know if there is a command to enable/disable seat heaters?

[seat_heater_left] = [1]
[seat_heater_right] = [0]
[seat_heater_rear_left] = [0]
[seat_heater_rear_right] = [0]
[seat_heater_rear_center] = [0]
[seat_heater_rear_right_back] = [0]
[seat_heater_rear_left_back] = [0]
The rear_left_back etc are for people with the sub zero package and rear heated seats. There is currently no way to change the settings on any heated seats or steering wheel.
 
@Dylan Diamond , I can confirm the sun roof move command is failing for all states except vent and close, and it seems it has been failing for at least a few weeks based on the feedback from my users.

This is awful... It doesn't affect the official Tesla app as it never used any other state but vent and close, sad that Tesla would explicitly go out of their way to do more work to lock down existing functionality already working.
 
@Dylan Diamond , I can confirm the sun roof move command is failing for all states except vent and close, and it seems it has been failing for at least a few weeks based on the feedback from my users.

This is awful... It doesn't affect the official Tesla app as it never used any other state but vent and close, sad that Tesla would explicitly go out of their way to do more work to lock down existing functionality already working.
Thanks for the info. Elon tweeted that they are planning a big revamp of the default app soon, think it has to do with that? Not sure how third party apps will compare to update.
 
  • Like
Reactions: SG57
@Dylan Diamond , they intentionally reduced the functionality of their APIs. If that's any indicator of the what the new app will be capable of, I'd say we have nothing to worry about haha
Hope so...but it is annoying how some features are broken with these recent API deprecations...I would hate to see the API have everything removed from it except for what is in the default app.
 
  • Like
Reactions: SG57
@apacheguy & @wayner , currently there is no known exposed API for setting the charging amperage or setting the time for scheduled charging.

Depending on your needs though, you can control charging in conjunction with the scheduled charging - I'm about to release what I call Smart Charging in my app Dashboard for Tesla which allows binding charge locations with charge time restrictions, charge completion by a certain time, and/or some other cool stuff. We do what we can, you know?
 
  • Like
Reactions: cgiGuy
... charge completion by a certain time, and/or some other cool stuff. We do what we can, you know?
I wrote some Python code last year that I run as a cron job on a Raspberry Pi to schedule charge to complete as close to possible at a certain time - this is useful to help to have the battery warm when you leave for those of us who live in cold climates for part of the year. The biggest issue here is the charge rate, but you can get familiar with that after a while, although it can take a bit longer in very cold weather. The other main variable here is variable electricity pricing - here in Toronto electricity rates go up by $0.093/kWh at 7 am so I generally try to schedule charging to end at 7 am or earlier if I am leaving home very early from Nov - Apr.
 
  • Like
Reactions: SG57
@wayner , ah yes... I understand the charge rate is variable and thus the completion time is an estimate and a pain. I do what I can to make that as accurate as possible.

When available, I use the provided 'time_to_full_charge' (in hours) field from the charge state, else I calculate the time to full charge myself using a configured charge rate for that charging location. I've concluded the 'time_to_full_charge' is read straight from the car only when charging so it knows it's charging rate better than anyone else.
 
Do you kick off a test charge session and then read the time to full charge? That's one way to do it but it may be affected by low temperatures.

I personally only care about this when the car is charging at home and I know the charge rate for my HPWC at 240V and 80A which is roughly 1.5 km/min if I remember correctly.
 
  • Like
Reactions: SG57