alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
591 stars 100 forks source link

3.0.0 Rear Heated seats missing #297

Closed freshfieldx closed 1 year ago

freshfieldx commented 2 years ago

I can't see this mentioned already, but the heated rear seats are missing in 3.0.0

freshfieldx commented 2 years ago

I wonder if this should have been 3.0.0_Beta?

shred86 commented 2 years ago

The support for rear seat heaters is there, it just sounds like it's having issues with the entities being created. Right now we're checking the "vehicle_config" section of the Tesla API for "rear_seat_heaters" which I assumed is returning 0 if the vehicle doesn't have them, and something other than 0 if it does.

If you're able to turn on debugging for teslajsonpy and share the "vehicle_config" section of when we make a get request to the vehicle_data endpoint, that would help us. Unfortunately there's. no official Tesla API documentation so everything is sort of trial and error, and the Tesla API changes frequently.

purcell-lab commented 2 years ago

I can confirm that I can see all 5 heated seats (including rear) with the V3 integration.

Can you show us what you have visible on your device tab?

Screenshot_20221024-050004

FalconUK commented 1 year ago

I can see the three rear seats, and should be able to control them (M3LR), but their states are all 'unavailable'.

bkr1969 commented 1 year ago

Everything is unavailable. Something majorly broke with this update.

TheDK commented 1 year ago

Try waking up the car and see if they come online. For me it took a bit.

I also believe this issue here is the same: https://github.com/alandtse/tesla/issues/293#issuecomment-1289134291

FalconUK commented 1 year ago

This issue is still present for me, after a couple of days of the car being in use, online, etc.

If it's any use for debugging, I do have heated rear seats, I don't have a heated steering wheel (2020 model M3 LR).

craigsbits commented 1 year ago

There for a day or 2 but now the rear seats have disappeared (unresponsive). Is it mistaking 3rd row seats for 2nd row?

rlippmann commented 1 year ago

So my rear seats were missing (2019 M3 SR+). I forced the car awake and restarted and they appeared.

Tl;dr version: there’s a climate object where the rear heaters appear, but they don’t if the car is asleep.

The first call for vehicle_id part didn’t have the correct information:

2022-11-18 01:13:56.500 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492931442798456,"user_id":xxxxxxx,"vehicle_id":xxxxxxx,"vin":"xxxxxxxxx","display_name":"Teslora","option_codes":"AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,MI00,CDM0","color":null,"access_type":"OWNER","tokens":["797fd8c3f04fbd29","4d8a92b0b1acf72c"],"state":"online","in_service":false,"id_s":"1492931442798456","calendar_enabled":true,"api_version":42,"backseat_token":null,"backseat_token_updated_at":null,"vehicle_config":{"aux_park_lamps":"NaBase","badge_version":0,"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"model3","charge_port_type":"US","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":false,"exterior_color":"PearlWhite","exterior_trim":"Chrome","exterior_trim_override":"","has_air_suspension":false,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Premium","interior_trim_type":"Black","key_version":2,"motorized_charge_port":true,"paint_color_override":"20,20,20,0.01,0.04","performance_package":"BasePlus","plg":false,"pws":false,"rear_drive_unit":"PM216MOSFET","rear_seat_heaters":1,"rear_seat_type":0,"rhd":false,"roof_color":"RoofColorGlass","seat_type":null,"spoiler_type":"None","sun_roof_installed":null,"supports_qr_pairing":false,"third_row_seats":"None","timestamp":1668751945592,"trim_badging":"50","use_range_badging":true,"utc_offset":-14400,"webcam_supported":false,"wheel_type":"Stiletto19"},"command_signing":"off"}],"count":1} 2022-11-18 01:13:56.501 DEBUG (MainThread) [teslajsonpy.controller] 36239: Changing car_online from {} to True 2022-11-18 01:13:56.501 DEBUG (MainThread) [teslajsonpy.controller] 36239: Resetting last_wake_up_time to: 1668752037 2022-11-18 01:13:56.501 DEBUG (MainThread) [teslajsonpy.controller] 36239: Resetting last_parked_timestamp to: 1668752034 shift_state None 2022-11-18 01:13:56.501 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 1:24:11 2022-11-18 01:13:56.502 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492931442798456/vehicle_data {}

That was the only call to teslajson.py when the car was asleep.

When I woke it up and restarted I got the above log message, and then it connected twice more:

2022-11-18 01:13:57.406 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492931442798456,"user_id":xxxxxxx,"vehicle_id":xxxxxxxx,"vin":"xxxxxxx","display_name":"Teslora","option_codes":"AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,MI00,CDM0","color":null,"access_type":"OWNER","tokens":["797fd8c3f04fbd29","4d8a92b0b1acf72c"],"state":"online","in_service":false,"id_s":"1492931442798456","calendar_enabled":true,"api_version":42,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":198.92,"charge_amps":32,"charge_current_request":32,"charge_current_request_max":32,"charge_enable_request":true,"charge_energy_added":18.54,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":84.5,"charge_miles_added_rated":84.5,"charge_port_cold_weather_mode":false,"charge_port_color":"","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":1,"charger_pilot_current":32,"charger_power":0,"charger_voltage":2,"charging_state":"Complete","conn_charge_cable":"SAE","est_battery_range":147.77,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"MCSingleWireCAN","ideal_battery_range":198.92,"managed_charging_active":false,"managed_charging_start_time":null,"managed_charging_user_canceled":false,"max_range_charge_counter":0,"minutes_to_full_charge":0,"not_enough_power_to_heat":null,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"all_week","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":15,"scheduled_departure_time":null,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1668752036177,"trip_charging":false,"usable_battery_level":89,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"auto_seat_climate_left":false,"auto_seat_climate_right":true,"battery_heater":false,"battery_heater_no_power":null,"cabin_overheat_protection":"On","cabin_overheat_protection_actively_cooling":false,"climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":20.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":12.6,"is_auto_conditioning_on":false,"is_climate_on":false,"is_front_defroster_on":false,"is_preconditioning":false,"is_rear_defroster_on":false,"left_temp_direction":781,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":12.0,"passenger_temp_setting":21.1,"remote_heater_control_enabled":false,"right_temp_direction":781,"seat_heater_left":0,"seat_heater_rear_center":0,"seat_heater_rear_left":0,"seat_heater_rear_right":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":true,"timestamp":1668752036177,"wiper_blade_heater":false},"drive_state":{"gps_as_of":1668662643,"heading":254,"latitude":38.809039,"longitude":-77.078578,"native_latitude":38.809039,"native_location_supported":1,"native_longitude":-77.078578,"native_type":"wgs","power":0,"shift_state":null,"speed":null,"timestamp":1668752036177},"gui_settings":{"gui_24_hour_time":false,"gui_charge_rate_units":"mi/hr","gui_distance_units":"mi/hr","gui_range_display":"Rated","gui_temperature_units":"F","show_range_units":false,"timestamp":1668752036177},"vehicle_config":{"aux_park_lamps":"NaBase","badge_version":0,"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"model3","charge_port_type":"US","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":false,"exterior_color":"PearlWhite","exterior_trim":"Chrome","exterior_trim_override":"","has_air_suspension":false,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Premium","interior_trim_type":"Black","key_version":2,"motorized_charge_port":true,"paint_color_override":"20,20,20,0.01,0.04","performance_package":"BasePlus","plg":false,"pws":false,"rear_drive_unit":"PM216MOSFET","rear_seat_heaters":1,"rear_seat_type":0,"rhd":false,"roof_color":"RoofColorGlass","seat_type":null,"spoiler_type":"None","sun_roof_installed":null,"supports_qr_pairing":false,"third_row_seats":"None","timestamp":1668752036178,"trim_badging":"50","use_range_badging":true,"utc_offset":-14400,"webcam_supported":false,"wheel_type":"Stiletto19"},"vehicle_state":{"api_version":42,"autopark_state_v3":"standby","autopark_style":"dead_man","calendar_supported":true,"car_version":"2022.20.19 8088dce3f2cd","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"9ff,0","fp_window":0,"ft":0,"is_user_present":false,"last_autopark_error":"no_error","locked":true,"media_state":{"remote_control_enabled":true},"notifications_supported":true,"odometer":20756.486858,"parsed_calendar_supported":true,"pf":0,"pr":0,"rd_window":0,"remote_start":false,"remote_start_enabled":true,"remote_start_supported":true,"rp_window":0,"rt":0,"santa_mode":0,"sentry_mode":false,"sentry_mode_available":true,"service_mode":false,"service_mode_plus":false,"smart_summon_available":true,"software_update":{"download_perc":0,"expected_duration_sec":2700,"install_perc":1,"status":"","version":" "},"speed_limit_mode":{"active":false,"current_limit_mph":85.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":true,"timestamp":1668752036177,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"valet_pin_needed":true,"vehicle_name":"Teslora","vehicle_self_test_progress":0,"vehicle_self_test_requested":false,"webcam_available":false}}} 2022-11-18 01:13:57.407 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 3 Interval 60 2022-11-18 01:13:57.407 DEBUG (MainThread) [teslajsonpy.controller] 36239: online. Polling policy: normal. Update state: normal. Since last park: 3. Since last wake_up: 0. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-11-18 01:13:57.438 DEBUG (MainThread) [teslajsonpy.controller] 36239: Updating VEHICLE_DATA 2022-11-18 01:13:57.438 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 1:24:10 2022-11-18 01:13:57.438 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492931442798456/vehicle_data {}

TheDK commented 1 year ago

Same here - I noticed the sensor for the Sentry mode to be missing - reloading the integration when the car was online solved that. Not sure if that's something that can be cached sensibly instead of reading from the Tesla API at that moment...