See:
https://github.com/adriankumpf/teslamate/blob/5f3f7f70ccdbfa55c0acb7d3d3c733a51bf77762/lib/tesla_api/vehicle.ex#L44
https://github.com/adriankumpf/teslamate/blob/5f3f7f70ccdbfa55c0acb7d3d3c733a51bf77762/lib/tesla_api/vehicle.ex#L47
It would be good to store these in the database as well (cars table) so we can show a nice car image on the web interface (will do a PR for that when this is available in the DB).
If this is added, please also add the values to MQTT. Would be really useful for the MMM-TeslaMate MagicMirror plugin, currently the user has to enter their option codes manually for the correct vehicle to be displayed.
The option codes are deprecated: https://tesla-api.timdorr.com/vehicle/optioncodes
As of August 2019, Option Codes cannot be relied on. Vehicles now return a generic set of codes related to a Model 3.
They were replaced by vehicle_config. Could you please specify what information you need besides the color, trim_badging and car_type?
At least wheel type is necessary as well for the image compositor.
Hmm, I was not aware of that. I thought of adding an image like this to the web UI:
https://static-assets.tesla.com/v1/compositor/?model=m3&view=STUD_3QTR&size=500&options=DV2W,IN3B2,COL3-PPSW,W38B,MT308&bkba_opt=1
Maybe there's an alternative URL scheme?
In what format are the color and wheel type served by the API? I've found tinkering with that compositor URL (we use the same one for MMM-TeslaMate) that it doesn't need the full list - color + wheels is the minimal necessary pair of codes for generating a valid image.
Hmm yes, this seems to be the minimal options needed to generate a valid image:
https://static-assets.tesla.com/v1/compositor/?model=m3&view=STUD_3QTR&size=500&options=COL3-PPSW,W38B&bkba_opt=1 (color + wheels)
This is a sample API response: https://tesla-api.timdorr.com/vehicle/state/vehicleconfig#response
That's a cool idea! Okay, so two columns need to be added to the car table: exterior_color and wheel_type. And accordingly, the following MQTT topics would make sense:
teslamate/cars/$car_id/model (either "S", "X" or "3")teslamate/cars/$car_id/trim_badgingteslamate/cars/$car_id/exterior_colorteslamate/cars/$car_id/wheel_typeIt might be nice to add spoiler_type as well, as that changes the image in car at least...
Most helpful comment
That's a cool idea! Okay, so two columns need to be added to the car table:
exterior_colorandwheel_type. And accordingly, the following MQTT topics would make sense:teslamate/cars/$car_id/model(either "S", "X" or "3")teslamate/cars/$car_id/trim_badgingteslamate/cars/$car_id/exterior_colorteslamate/cars/$car_id/wheel_type