Idea
It would be great if the Tesla Fleet integration could provide vehicle images from different view angles as sensors.
Tesla has a special “compositor” URL that generates a view of any Tesla vehicle based on its specific set of options. You can also set the view you’d like (rear, interior, front, etc.). Such URLs are used by Tesla themselves on their website and in many places.
As an example (note the options
and view
params), https://static-assets.tesla.com/v1/compositor/?model=ms&view=STUD_REAR&size=3000&options=$MDLS,$MTS14,$PBSB,$WS12,$APBS,$SC04,$CPF1,$TW01,$IBC00,$ST1Y&bkba_opt=1 would be rendered like this:
You can fish your particular URL (front view) from the image that shows under “My products” on your account.
It would be very useful for the integration to expose all the possible views for your particular vehicle. I think there are 4-5 different ones. (I don’t know HA enough yet to say if the Tesla-hosted URL should be exposed by HA, or a copy of the image itself.)
To know the particular set of options of a given vehicle, that can probably be fetched using the access token. Not sure. Or let the user manually paste the URL cited above and extract the options
part to generate the different views.
Options documentation
There is no official documentation for the parameters (which would be awesome), however some people have been decoding them. Here are a few clues I found online:
- https://www.teslaownersonline.com/threads/teslas-image-compositor.7089/
- Tesla API values to image url - ish · GitHub
- tesla-api/docs/vehicle/optioncodes.md at c90d9950bfa58ec02b9ed716688a7e97b760f869 · timdorr/tesla-api · GitHub
- Model 3 Configurator / Evan | Observable
- Tesla Assets · GitHub
- GitHub - teslahunt/tesla-images: Generate Tesla Model S/3/X/Y 3D photo visualizations
- Tesla option codes
- GitHub - tdorssers/TeslaPy: A Python module to use the Tesla Motors Owner API