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.
You need to set a password otherwise you get that result, I just tested it on my system.

The password needs to be passed like this.... { "on":true , "password":"1234" } but only the first time.
Once a password has been set you don't need to send it every time.

Great thanks. It worked on my car because I have a PIN set. But I had this problem with a different car, so that fully explains it.
 
Hi all....first post here :)

I've been using this thread to help me out with my own home automation system to send commands and receive data from the car.

I'm trying to unlock the charge port but can't get it to work. When I tested for the command it looks like it's using the open charge port command but I'm not sure if that's correct?

If your saying the command dosent do anything, I had a similar problem a while back. Try wake up the car first, then straight after that try to open the charge port.
 
g'day mate. Most likley either the app has a bunch of images stored in it with each possible color/wheel/sunroof/spoiler/nosecone combo.

The actual backend system that generates the images is called the tesla compositor...

All ya have to do is go to the tesla studio, play around with a config you like, and then open the image in a new tab... The URL that comes up has a bunch of parameters in it, those 'codes' are what tells the compositing system what the car looks like.

For a jump-start on how this system works, consult this thread: Tesla website compositor

cheers!
I have been playing with this. has anyone seen a way to get to the image just as a transparent png without the background?
 
Did a bunch of digging and found API stuff worth sharing and analyzing with you guys. Interesting bits are bolded.
  • Spoiler types are:
    • None
    • Passive
    • Active
  • Spoiler options are:
    • Carbon fiber or active spoiler (X019)
    • No spoiler or passive spoiler (X021)
  • Active spoiler states are:
    • Extended
    • Retracted
  • Estimated mileage is no longer used - Model 3 firmware simply don't have it and it may be removed from S/X models on future firmwares.

  • Model 3 wheel types are:
    • Pin wheel 18 (W38B)
    • Stiletto Square 19 (W39B)
  • Roof types are:
    • Body painted (RFBC)
    • Black painted (RFBK)
    • Fixed glass (RFFG)
    • Panoramic roof (RFPO)
    • Panoramic roof v2 (RFP2)
    • Model X roof (RFPX)
    • Model 3 fixed glass roof (RF3G)
  • Brake caliper types are:
    • Black brake calipers (BC0B)
    • Red brake calipers (BC0R)
    • Model 3 black brake calipers (BC3B)
  • Charge port latch states are:
    • <invalid>
    • Engaged
    • Disengaged
    • Blocking (curious what this means, perhaps engaged but without a cable connected thus blocking the port?)
  • Charge port types are:
    • US
    • EU
    • GB
  • Fast charger types are:
    • Tesla
    • Chademo
    • GB
  • Fast charger brands are:
    • <invalid>
    • Tesla
  • Charge cable types are:
    • <invalid>
    • SAE (US)
    • IEC (EU)
    • GB_AC
    • GB_DC
  • Sun roof vent is 4% open
-

And here's my analysis on some bits.

Good news, notice all the active spoiler configuration and state information available now. To me this confirms the existence of a future configuration option for an active spoiler made out of carbon fiber on at least one of the models - 3, S, X, or possibly the roadster 2.0 or semi (?).

I think it's reasonable to assume the new Roadster 2.0 would have an active spoiler option for their price tag, this combined with the new active spoiler config data available over the APIs may also confirm that the Roadster 2.0 will have mobile app access using the same APIs as the rest of the fleet! Summon, streaming, basic commands, etc.


Notice the Model 3 has its own fixed glass roof option which answers the question what the FG stood for in the option codes.

Again, notice the Model 3 has its own brake caliper type which implies the Model 3 uses different brake calipers than both the Model S and X.

Notice the fast charger brand, it only supports Tesla at the moment implying Tesla's supercharger network. The existence of this property could easily mean other brands of fast chargers are on the horizon as other EV manufactures start building charging infrastructure with Tesla vehicles supported.
 
Last edited:
Some more good news, climate state in the latest firmware (2018.4.1 ec044c8) is showing new properties: steering_wheel_heater, wiper_blade_heater, and side_mirror_heaters.

The ability to remotely control these should be coming soon.

I can't test this myself, but can anybody with the subzero package clarify whether these heaters in the car are on/off heaters, or do they have levels 0, 1, 2, 3 like the seat heaters?
 
  • Love
Reactions: lunitiks
Yes they are on/off and there are reports that the latest firmware release allows these settings, or at least the steering wheel heater, to be a persistent setting rather than resetting to off every time the car is turned off.

To bad rear defroster isn't also part of the API as it would be great to be able to turn that on remotely as well.
 
  • Like
Reactions: SG57 and lunitiks
Starting with car firmware 2018.4 there is more functionality added to the existing "Start HVAC" command:

Preconditioning will also turn on your seat heaters and defrosters automatically in cold weather for your comfort and convenience. Cold weather upgrades, such as the heated steering wheel and wiper blades, will also be activated. When you start your next drive, your climate settings will automatically revert to your previous settings.

NOTE: Requires vehicle software version 2018.4 or above.

I'm unsure what Tesla classifies as "cold weather", but until someone with the new firmware can test it we'll just have to speculate.
 
Last edited:
@wayner , yes after looking at the latest official app code the logic states if the side mirror heater, wiper blade heater, front defroster or rear defroster are on then the app will show the car as defrosting - no mention of seat heaters. Interestingly the app denotes the car as heating if any of the seat heaters or steering wheel heater is enabled, bit of a stretch that one.
 
This new heating mode is quite handy. We had a lot of snow here in Toronto last week and I was able to run my HVAC system all day and keep my car clear of snow. When I returned to the train station everyone else had snow, except for me. Of course it cost me $2 or so of electricity to do so.
 
  • Like
Reactions: SG57