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

Upgrade 3.0 Tesla Location tracker not work (China Server) #282

Closed BlueBenson closed 1 year ago

BlueBenson commented 2 years ago

Version of the custom_component

3.0

Configuration

Add your logs here.

Describe the bug

Upgrade 3.0 Tesla Location tracker not work (China Server) Wendy's TeslaX Location tracker was detected at unknown

Debug log


Add your logs here.
alandtse commented 2 years ago

Please enable debug logs for tesla and teslajsonpy and check for any errors.

alandtse commented 2 years ago

Please also confirm:

  1. You've removed and readded the component.
  2. You've used the Chinese auth server to login.
  3. Other features work.
BlueBenson commented 2 years ago

Yes I confirm. I deleted the old component and reinstalled. I used the china auth. Except the GPS other functions all good. Sent from my iPhoneOn Oct 22, 2022, at 18:51, Alan Tse @.***> wrote: Please also confirm:

You've removed and readded the component. You've used the Chinese auth server to login. Other features work.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

goxofy commented 2 years ago

same problem

China server(tesla.cn)

BlueBenson commented 2 years ago

2022-10-22 22:40:01.772 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token 2022-10-22 22:40:01.774 DEBUG (MainThread) [teslajsonpy.controller] 399 endpoints loaded 2022-10-22 22:40:01.776 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:55:13 2022-10-22 22:40:01.776 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {} 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449466021,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"command_signing":"off"}],"count":1} 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.controller] 37400: Changing car_online from {} to True 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_wake_up_time to: 1666449605 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_parked_timestamp to: 1666449602 shift_state None 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:55:10 2022-10-22 22:40:04.884 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:40:06.169 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":247.01,"charge_amps":24,"charge_current_request":24,"charge_current_request_max":24,"charge_enable_request":true,"charge_energy_added":45.83,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":133.5,"charge_miles_added_rated":167.5,"charge_port_cold_weather_mode":null,"charge_port_color":"Off","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":null,"charger_pilot_current":24,"charger_power":0,"charger_voltage":0,"charging_state":"Complete","conn_charge_cable":"IEC","est_battery_range":150.79,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":197.15,"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":false,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"weekdays","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1637191800,"scheduled_departure_time_minutes":450,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1666449605920,"trip_charging":false,"usable_battery_level":90,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"battery_heater":false,"battery_heater_no_power":false,"bioweapon_mode":false,"cabin_overheat_protection":"On","climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":22.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":23.7,"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":-272,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":20.5,"passenger_temp_setting":22.0,"remote_heater_control_enabled":false,"right_temp_direction":-272,"seat_heater_left":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":false,"timestamp":1666449605919,"wiper_blade_heater":false},"drive_state":{"corrected_latitude":24.980499,"corrected_longitude":102.666374,"gps_as_of":1666449532,"heading":5,"latitude":24.983561,"longitude":102.665039,"native_latitude":24.980501,"native_location_supported":1,"native_longitude":102.666374,"native_type":"gcj","power":0,"shift_state":null,"speed":null,"timestamp":1666449605920},"gui_settings":{"gui_24_hour_time":true,"gui_charge_rate_units":"km/hr","gui_distance_units":"km/hr","gui_range_display":"Ideal","gui_temperature_units":"C","show_range_units":true,"timestamp":1666449605920},"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449605920,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"vehicle_state":{"api_version":36,"autopark_state_v2":"standby","autopark_style":"standard","calendar_supported":true,"car_version":"2022.8.10.5 b94e08b2c3be","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"5,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":54072.467432,"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,"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":50.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":false,"timestamp":1666449605919,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"vehicle_name":"Wendy's TeslaX"}}} 2022-10-22 22:40:06.169 DEBUG (MainThread) [custom_components.tesla_custom] Connected to the Tesla API 2022-10-22 22:40:06.169 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:06.170 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 4 Interval 60 2022-10-22 22:40:06.170 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 4. Since last wake_up: 1. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:06.173 DEBUG (MainThread) [teslajsonpy.controller] 37400: Updating VEHICLE_DATA 2022-10-22 22:40:06.173 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:55:08 2022-10-22 22:40:06.173 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:40:06.792 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":247.01,"charge_amps":24,"charge_current_request":24,"charge_current_request_max":24,"charge_enable_request":true,"charge_energy_added":45.83,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":133.5,"charge_miles_added_rated":167.5,"charge_port_cold_weather_mode":null,"charge_port_color":"Off","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":null,"charger_pilot_current":24,"charger_power":0,"charger_voltage":0,"charging_state":"Complete","conn_charge_cable":"IEC","est_battery_range":150.79,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":197.15,"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":false,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"weekdays","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1637191800,"scheduled_departure_time_minutes":450,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1666449606413,"trip_charging":false,"usable_battery_level":90,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"battery_heater":false,"battery_heater_no_power":false,"bioweapon_mode":false,"cabin_overheat_protection":"On","climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":22.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":23.7,"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":-272,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":20.5,"passenger_temp_setting":22.0,"remote_heater_control_enabled":false,"right_temp_direction":-272,"seat_heater_left":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":false,"timestamp":1666449606412,"wiper_blade_heater":false},"drive_state":{"corrected_latitude":24.980499,"corrected_longitude":102.666374,"gps_as_of":1666449532,"heading":5,"latitude":24.983561,"longitude":102.665039,"native_latitude":24.980501,"native_location_supported":1,"native_longitude":102.666374,"native_type":"gcj","power":0,"shift_state":null,"speed":null,"timestamp":1666449606413},"gui_settings":{"gui_24_hour_time":true,"gui_charge_rate_units":"km/hr","gui_distance_units":"km/hr","gui_range_display":"Ideal","gui_temperature_units":"C","show_range_units":true,"timestamp":1666449606413},"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449606415,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"vehicle_state":{"api_version":36,"autopark_state_v2":"standby","autopark_style":"standard","calendar_supported":true,"car_version":"2022.8.10.5 b94e08b2c3be","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"5,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":54072.467432,"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,"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":50.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":false,"timestamp":1666449606412,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"vehicle_name":"Wendy's TeslaX"}}} 2022-10-22 22:40:06.795 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.626 seconds (success: True) 2022-10-22 22:40:06.846 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:06.846 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 5 Interval 60 2022-10-22 22:40:06.846 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 5. Since last wake_up: 2. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:06.846 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 0 ago. Last parked: 5 ago. Last wake_up 2 ago. 2022-10-22 22:40:06.846 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:40:16.000 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:16.000 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 14 Interval 60 2022-10-22 22:40:16.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 14. Since last wake_up: 11. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:16.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 9 ago. Last parked: 14 ago. Last wake_up 11 ago. 2022-10-22 22:40:16.001 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.001 seconds (success: True) 2022-10-22 22:40:26.001 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:26.001 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 24 Interval 60 2022-10-22 22:40:26.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 24. Since last wake_up: 21. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:26.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 19 ago. Last parked: 24 ago. Last wake_up 21 ago. 2022-10-22 22:40:26.001 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.001 seconds (success: True) 2022-10-22 22:40:36.000 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:36.000 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 34 Interval 60 2022-10-22 22:40:36.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 34. Since last wake_up: 31. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:36.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 29 ago. Last parked: 34 ago. Last wake_up 31 ago. 2022-10-22 22:40:36.000 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:40:46.000 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:46.000 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 44 Interval 60 2022-10-22 22:40:46.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 44. Since last wake_up: 41. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:46.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 39 ago. Last parked: 44 ago. Last wake_up 41 ago. 2022-10-22 22:40:46.000 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:40:56.001 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:40:56.001 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 54 Interval 60 2022-10-22 22:40:56.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 54. Since last wake_up: 51. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:40:56.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 49 ago. Last parked: 54 ago. Last wake_up 51 ago. 2022-10-22 22:40:56.001 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:06.001 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:06.001 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 64 Interval 60 2022-10-22 22:41:06.001 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:54:08 2022-10-22 22:41:06.001 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles {} 2022-10-22 22:41:06.229 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492930982760013,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null}],"count":1} 2022-10-22 22:41:06.229 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 64. Since last wake_up: 61. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:06.229 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 59 ago. Last parked: 64 ago. Last wake_up 61 ago. 2022-10-22 22:41:06.229 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.229 seconds (success: True) 2022-10-22 22:41:16.000 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:16.000 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 10 Interval 60 2022-10-22 22:41:16.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 74. Since last wake_up: 71. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:16.000 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 69 ago. Last parked: 74 ago. Last wake_up 71 ago. 2022-10-22 22:41:16.000 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:16.113 DEBUG (MainThread) [teslajsonpy.controller] Disconnecting controller. 2022-10-22 22:41:16.113 DEBUG (MainThread) [teslajsonpy.connection] Connection closed. 2022-10-22 22:41:16.113 DEBUG (MainThread) [custom_components.tesla_custom] Unloaded entry for Tesla 2022-10-22 22:41:16.125 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token 2022-10-22 22:41:16.126 DEBUG (MainThread) [teslajsonpy.controller] 399 endpoints loaded 2022-10-22 22:41:16.128 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:58 2022-10-22 22:41:16.128 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {} 2022-10-22 22:41:16.377 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449606415,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"command_signing":"off"}],"count":1} 2022-10-22 22:41:16.377 DEBUG (MainThread) [teslajsonpy.controller] 37400: Changing car_online from {} to True 2022-10-22 22:41:16.378 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_wake_up_time to: 1666449676 2022-10-22 22:41:16.378 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_parked_timestamp to: 1666449676 shift_state None 2022-10-22 22:41:16.378 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:58 2022-10-22 22:41:16.378 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:41:25.527 DEBUG (MainThread) [teslajsonpy.connection] 408: {"response":null,"error":"{\"error\": \"timeout\"}","error_description":""} 2022-10-22 22:41:25.528 DEBUG (MainThread) [teslajsonpy.controller] Exception: vehicle_unavailable api(('VEHICLE_DATA',) {'path_vars': {'vehicle_id': '1492930982760013'}, 'wake_if_asleep': False}) 2022-10-22 22:41:25.528 DEBUG (MainThread) [teslajsonpy.controller] 37400: Changing car_online from True to False 2022-10-22 22:41:25.528 DEBUG (MainThread) [teslajsonpy.controller] Vehicle asleep - data unavailable. 2022-10-22 22:41:25.528 DEBUG (MainThread) [custom_components.tesla_custom] Connected to the Tesla API 2022-10-22 22:41:25.528 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:25.528 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 10 Interval 60 2022-10-22 22:41:25.528 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 1666449686 ago. Last parked: 10 ago. Last wake_up 10 ago. 2022-10-22 22:41:25.528 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:25.539 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:25.539 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 10 Interval 60 2022-10-22 22:41:25.539 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 1666449686 ago. Last parked: 10 ago. Last wake_up 10 ago. 2022-10-22 22:41:25.539 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:35.001 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:35.001 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 19 Interval 60 2022-10-22 22:41:35.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 1666449695 ago. Last parked: 19 ago. Last wake_up 19 ago. 2022-10-22 22:41:35.001 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:37.990 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: True Time: 22 Interval 60 2022-10-22 22:41:37.990 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:37 2022-10-22 22:41:37.990 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles {} 2022-10-22 22:41:38.221 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492930982760013,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null}],"count":1} 2022-10-22 22:41:38.221 DEBUG (MainThread) [teslajsonpy.controller] 37400: Changing car_online from False to True 2022-10-22 22:41:38.221 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_wake_up_time to: 1666449698 2022-10-22 22:41:38.221 DEBUG (MainThread) [teslajsonpy.controller] 37400: Updating VEHICLE_DATA 2022-10-22 22:41:38.221 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:36 2022-10-22 22:41:38.222 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:41:38.686 DEBUG (MainThread) [teslajsonpy.car] Sending command: WAKE_UP 2022-10-22 22:41:38.686 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:36 2022-10-22 22:41:38.687 DEBUG (MainThread) [teslajsonpy.connection] post: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/wake_up {} 2022-10-22 22:41:38.949 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null}} 2022-10-22 22:41:38.949 DEBUG (MainThread) [teslajsonpy.car] Response from command WAKE_UP: {'response': {'id': 1492930982760013, 'user_id': 234431, 'vehicle_id': 1886836044, 'vin': '5YJXCCE23HF037400', 'display_name': "Wendy's TeslaX", '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': None, 'access_type': 'OWNER', 'tokens': ['9b1895bb5ff1f09b', '1e0a9fb7b838d667'], 'state': 'online', 'in_service': False, 'id_s': '1492930982760013', 'calendar_enabled': True, 'api_version': 36, 'backseat_token': None, 'backseat_token_updated_at': None}} 2022-10-22 22:41:43.130 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":247.01,"charge_amps":24,"charge_current_request":24,"charge_current_request_max":24,"charge_enable_request":true,"charge_energy_added":45.83,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":133.5,"charge_miles_added_rated":167.5,"charge_port_cold_weather_mode":null,"charge_port_color":"Off","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":null,"charger_pilot_current":24,"charger_power":0,"charger_voltage":0,"charging_state":"Complete","conn_charge_cable":"IEC","est_battery_range":150.79,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":197.15,"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":false,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"weekdays","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1637191800,"scheduled_departure_time_minutes":450,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1666449700353,"trip_charging":false,"usable_battery_level":90,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"battery_heater":false,"battery_heater_no_power":false,"bioweapon_mode":false,"cabin_overheat_protection":"On","climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":22.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":23.5,"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":-272,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":20.5,"passenger_temp_setting":22.0,"remote_heater_control_enabled":false,"right_temp_direction":-272,"seat_heater_left":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":false,"timestamp":1666449700352,"wiper_blade_heater":false},"drive_state":{"corrected_latitude":24.980499,"corrected_longitude":102.666374,"gps_as_of":1666449682,"heading":5,"latitude":24.983561,"longitude":102.665039,"native_latitude":24.980501,"native_location_supported":1,"native_longitude":102.666374,"native_type":"gcj","power":0,"shift_state":null,"speed":null,"timestamp":1666449700353},"gui_settings":{"gui_24_hour_time":true,"gui_charge_rate_units":"km/hr","gui_distance_units":"km/hr","gui_range_display":"Ideal","gui_temperature_units":"C","show_range_units":true,"timestamp":1666449700353},"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449700353,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"vehicle_state":{"api_version":36,"autopark_state_v2":"standby","autopark_style":"standard","calendar_supported":true,"car_version":"2022.8.10.5 b94e08b2c3be","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"5,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":54072.467432,"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,"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":50.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":false,"timestamp":1666449700352,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"vehicle_name":"Wendy's TeslaX"}}} 2022-10-22 22:41:43.131 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:43.131 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 5 Interval 60 2022-10-22 22:41:43.131 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 27. Since last wake_up: 5. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:43.131 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 0 ago. Last parked: 27 ago. Last wake_up 5 ago. 2022-10-22 22:41:43.131 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:43.610 DEBUG (MainThread) [teslajsonpy.controller] Disconnecting controller. 2022-10-22 22:41:43.610 DEBUG (MainThread) [teslajsonpy.connection] Connection closed. 2022-10-22 22:41:43.610 DEBUG (MainThread) [custom_components.tesla_custom] Unloaded entry for Tesla 2022-10-22 22:41:43.620 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token 2022-10-22 22:41:43.621 DEBUG (MainThread) [teslajsonpy.controller] 399 endpoints loaded 2022-10-22 22:41:43.622 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:31 2022-10-22 22:41:43.622 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {} 2022-10-22 22:41:43.868 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449700353,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"command_signing":"off"}],"count":1} 2022-10-22 22:41:43.869 DEBUG (MainThread) [teslajsonpy.controller] 37400: Changing car_online from {} to True 2022-10-22 22:41:43.869 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_wake_up_time to: 1666449704 2022-10-22 22:41:43.869 DEBUG (MainThread) [teslajsonpy.controller] 37400: Resetting last_parked_timestamp to: 1666449704 shift_state None 2022-10-22 22:41:43.869 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:31 2022-10-22 22:41:43.869 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:41:44.608 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":247.01,"charge_amps":24,"charge_current_request":24,"charge_current_request_max":24,"charge_enable_request":true,"charge_energy_added":45.83,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":133.5,"charge_miles_added_rated":167.5,"charge_port_cold_weather_mode":null,"charge_port_color":"Off","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":null,"charger_pilot_current":24,"charger_power":0,"charger_voltage":0,"charging_state":"Complete","conn_charge_cable":"IEC","est_battery_range":150.79,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":197.15,"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":false,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"weekdays","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1637191800,"scheduled_departure_time_minutes":450,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1666449704213,"trip_charging":false,"usable_battery_level":90,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"battery_heater":false,"battery_heater_no_power":false,"bioweapon_mode":false,"cabin_overheat_protection":"On","climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":22.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":23.5,"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":-272,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":20.5,"passenger_temp_setting":22.0,"remote_heater_control_enabled":false,"right_temp_direction":-272,"seat_heater_left":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":false,"timestamp":1666449704213,"wiper_blade_heater":false},"drive_state":{"corrected_latitude":24.980499,"corrected_longitude":102.666374,"gps_as_of":1666449682,"heading":5,"latitude":24.983561,"longitude":102.665039,"native_latitude":24.980501,"native_location_supported":1,"native_longitude":102.666374,"native_type":"gcj","power":0,"shift_state":null,"speed":null,"timestamp":1666449704213},"gui_settings":{"gui_24_hour_time":true,"gui_charge_rate_units":"km/hr","gui_distance_units":"km/hr","gui_range_display":"Ideal","gui_temperature_units":"C","show_range_units":true,"timestamp":1666449704213},"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449704214,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"vehicle_state":{"api_version":36,"autopark_state_v2":"standby","autopark_style":"standard","calendar_supported":true,"car_version":"2022.8.10.5 b94e08b2c3be","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"5,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":54072.467432,"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,"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":50.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":false,"timestamp":1666449704213,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"vehicle_name":"Wendy's TeslaX"}}} 2022-10-22 22:41:44.609 DEBUG (MainThread) [custom_components.tesla_custom] Connected to the Tesla API 2022-10-22 22:41:44.609 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:44.609 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 1 Interval 60 2022-10-22 22:41:44.609 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 1. Since last wake_up: 1. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:44.609 DEBUG (MainThread) [teslajsonpy.controller] 37400: Updating VEHICLE_DATA 2022-10-22 22:41:44.609 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 6:53:30 2022-10-22 22:41:44.609 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492930982760013/vehicle_data {} 2022-10-22 22:41:45.019 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":1492930982760013,"user_id":234431,"vehicle_id":1886836044,"vin":"5YJXCCE23HF037400","display_name":"Wendy's TeslaX","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":["9b1895bb5ff1f09b","1e0a9fb7b838d667"],"state":"online","in_service":false,"id_s":"1492930982760013","calendar_enabled":true,"api_version":36,"backseat_token":null,"backseat_token_updated_at":null,"charge_state":{"battery_heater_on":false,"battery_level":90,"battery_range":247.01,"charge_amps":24,"charge_current_request":24,"charge_current_request_max":24,"charge_enable_request":true,"charge_energy_added":45.83,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":90,"charge_miles_added_ideal":133.5,"charge_miles_added_rated":167.5,"charge_port_cold_weather_mode":null,"charge_port_color":"Off","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":0.0,"charge_to_max_range":false,"charger_actual_current":0,"charger_phases":null,"charger_pilot_current":24,"charger_power":0,"charger_voltage":0,"charging_state":"Complete","conn_charge_cable":"IEC","est_battery_range":150.79,"fast_charger_brand":"","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":197.15,"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":false,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"weekdays","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1637191800,"scheduled_departure_time_minutes":450,"supercharger_session_trip_planner":false,"time_to_full_charge":0.0,"timestamp":1666449704835,"trip_charging":false,"usable_battery_level":90,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"battery_heater":false,"battery_heater_no_power":false,"bioweapon_mode":false,"cabin_overheat_protection":"On","climate_keeper_mode":"off","defrost_mode":0,"driver_temp_setting":22.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":23.5,"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":-272,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":20.5,"passenger_temp_setting":22.0,"remote_heater_control_enabled":false,"right_temp_direction":-272,"seat_heater_left":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":false,"timestamp":1666449704835,"wiper_blade_heater":false},"drive_state":{"corrected_latitude":24.980499,"corrected_longitude":102.666374,"gps_as_of":1666449682,"heading":5,"latitude":24.983561,"longitude":102.665039,"native_latitude":24.980501,"native_location_supported":1,"native_longitude":102.666374,"native_type":"gcj","power":0,"shift_state":null,"speed":null,"timestamp":1666449704835},"gui_settings":{"gui_24_hour_time":true,"gui_charge_rate_units":"km/hr","gui_distance_units":"km/hr","gui_range_display":"Ideal","gui_temperature_units":"C","show_range_units":true,"timestamp":1666449704835},"vehicle_config":{"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"modelx","charge_port_type":"EU","dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"Pearl","front_drive_unit":"NoneOrSmall","has_air_suspension":true,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Led","interior_trim_type":"AllBlack","motorized_charge_port":true,"plg":true,"pws":false,"rear_drive_unit":"Small","rear_seat_heaters":0,"rear_seat_type":3,"rhd":false,"roof_color":"None","seat_type":0,"spoiler_type":"Passive","sun_roof_installed":0,"third_row_seats":"FuturisFoldFlat","timestamp":1666449704835,"trim_badging":"90d","use_range_badging":false,"utc_offset":28800,"wheel_type":"AeroTurbine20"},"vehicle_state":{"api_version":36,"autopark_state_v2":"standby","autopark_style":"standard","calendar_supported":true,"car_version":"2022.8.10.5 b94e08b2c3be","center_display_state":0,"dashcam_clip_save_available":false,"dashcam_state":"Unavailable","df":0,"dr":0,"fd_window":0,"feature_bitmask":"5,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":54072.467432,"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,"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":50.0,"max_limit_mph":90,"min_limit_mph":50.0,"pin_code_set":false},"summon_standby_mode_enabled":false,"timestamp":1666449704834,"tpms_pressure_fl":null,"tpms_pressure_fr":null,"tpms_pressure_rl":null,"tpms_pressure_rr":null,"valet_mode":false,"vehicle_name":"Wendy's TeslaX"}}} 2022-10-22 22:41:45.019 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.411 seconds (success: True) 2022-10-22 22:41:45.025 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:45.025 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 1 Interval 60 2022-10-22 22:41:45.026 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 1. Since last wake_up: 1. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:45.026 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 0 ago. Last parked: 1 ago. Last wake_up 1 ago. 2022-10-22 22:41:45.026 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.000 seconds (success: True) 2022-10-22 22:41:55.001 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2022-10-22 22:41:55.001 DEBUG (MainThread) [teslajsonpy.controller] Get vehicles. Force: False Time: 11 Interval 60 2022-10-22 22:41:55.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: online. Polling policy: normal. Update state: normal. Since last park: 11. Since last wake_up: 11. Idle interval: 600. shift_state: None sentry: False climate: False, charging: Complete 2022-10-22 22:41:55.001 DEBUG (MainThread) [teslajsonpy.controller] 37400: Skipping update with state online. Polling: True. Last update: 10 ago. Last parked: 11 ago. Last wake_up 11 ago. 2022-10-22 22:41:55.001 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.001 seconds (success: True)

shred86 commented 2 years ago

Looking at the logs above, this is what's listed in the "drive_state" key:

"drive_state": {
    "corrected_latitude": 24.980499,
    "corrected_longitude": 102.666374,
    "gps_as_of": 1666449682,
    "heading": 5,
    "latitude": 24.983561,
    "longitude": 102.665039,
    "native_latitude": 24.980501,
    "native_location_supported": 1,
    "native_longitude": 102.666374,
    "native_type": "gcj",
    "power": 0,
    "shift_state": null,
    "speed": null,
    "timestamp": 1666449700353
}

I'm not too familiar with GCJ-02 but it appears to be based on WGS-84 and is adding offsets to the latitude and longitude.

Looking at what the Tesla API is returning, there's three different possible values, corrected_latitude, latitude and native_latitude, none of which values match. It also passes the native_type of gcj.

Are we sure latitude or corrected_latitude isn't already the converted GCJ-02 coordinates to WGS-84? If so, this would greatly simplify our problem. Additionally, I think we could just check the native_type field here instead of checking the auth_domain the user is using.

Edit: Looking at my "drive_state" key (I'm in the U.S.), native_latitude and latitude are identical (same with longitude) and native_type is gps, which makes sense. I'm pretty sure the Tesla API returns the GCJ-02 coordinates as native_latitude and native_longitude, and is doing the conversion which is then passed in WGS-84 as either latitude or corrected_latitude.

I just ran the native_latitude and native_longitude values above through the gcj02towgs84 function we're using to convert the values and these are the values I got:

This appears to almost match the values the Tesla API is passing for latitude and longitude.

alandtse commented 2 years ago

This is in dev and can be tested there.

BlueBenson commented 2 years ago

Hi @alandtse @shred86 ,thank you guys so much. I replace the const.py&device_tracker.py from https://github.com/shred86/tesla/tree/china-coords. it works now.

shred86 commented 1 year ago

Should be fixed in v3.0.1.