Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image of the car? #193

Closed
MikeBishop opened this issue May 31, 2020 · 18 comments
Closed

Image of the car? #193

MikeBishop opened this issue May 31, 2020 · 18 comments

Comments

@MikeBishop
Copy link

The app is clearly able to generate an image of the car. From some inspection on the Tesla web site, it looks like it's using a URL like....

https://static-assets.tesla.com/v1/compositor/?model=m3&view=STUD_3QTR&size=1440&options=DV4W,IN3PW,COL3-PPMR,W38B,MT303&bkba_opt=1&context=design_studio_2

However, since the options codes in the API have been frozen/deprecated, clearly they're getting the list of options from someplace else. It's possible they're just translating things off data_request/vehicle_config, in which case the translation database must be a pain to manage. Any chance to retrieve that translation code? Can you tell if the app using the same approach to get the vehicle image?

@davidhodge
Copy link

I don't know what the official Tesla app is doing, but for Nikola I decided that I have had to maintain a mapping from known vehicle_config varieties to option codes. Would love to know if there's a better way to do it, but have yet to find it.

@timdorr timdorr closed this as completed Jun 1, 2020
@kevinelliott
Copy link

@davidhodge How are you able to detect Model 3 Performance in Nikola from the vehicle_config? I'm not seeing anything obviously different than a standard Model 3.

@Urkman
Copy link

Urkman commented Nov 15, 2022

Why is this closed? I think this still a valid question...

@itsMeDavidV
Copy link

itsMeDavidV commented Nov 16, 2022

Yeah I also don't necessarily think this should be closed. There is a valid approach to getting vehicle option codes. We should work to figure this out.

See: tdorssers/TeslaPy#11 (comment)

@timdorr
Copy link
Owner

timdorr commented Nov 16, 2022

This isn't part of the API. The options codes haven't worked properly for years. However one gets a picture of their car using this image generation service isn't going to be done through this API, hence I closed this out.

@itsMeDavidV
Copy link

itsMeDavidV commented Nov 16, 2022

Hmm I don't think we can completely rule out that the API won't give us access to option codes or a vehicle image.

Just some from endpoints:

"VEHICLE_DETAILS_ASSETS_REQUEST_V2": { "TYPE": "GET", "URI": "bff/v2/mobile-app/ownership/vehicle-details-assets/v2", "AUTH": true }

"OWNERSHIP_VEHICLE_SPECS_REQUEST": { "TYPE": "GET", "URI": "bff/v2/mobile-app/ownership/vehicle-details", "AUTH": true }

"OWNERSHIP_RESERVATION_DETAILS_REQUEST": { "TYPE": "GET", "URI": "bff/v2/mobile-app/ownership/reservation-details/{rn}", "AUTH": true }

"VEHICLE_ORDER_LIST": { "TYPE": "GET", "URI": "api/1/users/orders", "AUTH": true }

There's something to be said for if a token intended for owner-api use will allow access to these, however I think this is def worth figuring out. Best case, it does.

@timdorr
Copy link
Owner

timdorr commented Nov 16, 2022

The API gives you option codes, but those have been the same option codes (regardless of the actual car configuration) for any vehicles produced in the last few years. They're not the same ones provided by the Tesla Account site where this image lives.

@itsMeDavidV
Copy link

Right, I'm thinking there's a possibility for a new source for correct option codes in the API.

@Urkman
Copy link

Urkman commented Nov 16, 2022

I also think, there is a valid way to get the option codes... Somewhere...
Tesla also needs them in their app...

@timdorr
Copy link
Owner

timdorr commented Nov 16, 2022

They get that from the data endpoints. Specifically, from vehicle_config, which uses more semantic descriptors than just option codes.

Options codes mostly came from Salesforce data. The website might be obtaining it directly as an option code list and the mobile app API might be translating that data to the semantic structure for the vehicle_config data/endpoint.

@Urkman
Copy link

Urkman commented Nov 16, 2022

@MikeBishop
Copy link
Author

Yes, that is one major piece of code I drew from to generate my own translation.

@Urkman
Copy link

Urkman commented Nov 16, 2022

Perhaps you can share the code?

@MikeBishop
Copy link
Author

https://github.com/MikeBishop/MMM-Powerwall/blob/master/MMM-Powerwall.js#L2283

@Urkman
Copy link

Urkman commented Nov 17, 2022

@timdorr Perhaps we should add these mappings somewhere to the Documentation. And enhance it, when there will be new mappings?
As for my MY(09/2022), the wheels are: "Induction20Black". That is currently not handled by the mapping...

@timdorr
Copy link
Owner

timdorr commented Nov 17, 2022

We have the option codes listed here: https://github.com/timdorr/tesla-api/blob/master/docs/vehicle/optioncodes.md

But how they're translated to the API data seems like a futile effort because they change so often and we don't know if Tesla will introduce further structural changes. That seems like a lot of work to map to just this one single image generation service 🤷

@Urkman
Copy link

Urkman commented Nov 17, 2022

I think it would be grate, to have a source of information for this...
btw, here are the codes for the two new colors and the wheels used in Germany:

    // Induction20Black: WY20P
    // Gemini19: WY19B

    // Quicksilver : PN00
    // MidnightCherryRed  : PR00

@MikeBishop
Copy link
Author

Added, thank you! I'll take any other updates here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants