Integration fails to setup if site or car fails to respond during setup
See original GitHub issueIntegration doesn’t load - looks to be due to having 2 Gateways registered on the Tesla Account - (One working, and one thats failed and been replace)
–>
Version of the custom_component
3.0.1
–>
Configuration
Standard install - with Auth token - was working fine, until the failed gateway reappeared. (Is there a way to to set it to ignore anything thats failed?)
Describe the bug
Wont log with the below debug output.
Debug log
2022-10-28 14:42:08.611 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token
2022-10-28 14:42:08.622 DEBUG (MainThread) [teslajsonpy.controller] 399 endpoints loaded
2022-10-28 14:42:08.622 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 4:11:40
2022-10-28 14:42:08.623 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {}
2022-10-28 14:42:08.891 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"id":<removed>,"user_id":<userid>,"vehicle_id":<id>,"vin":"<vin>","display_name":"Teresita","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":"DRIVER","tokens":["36410ab4585a291e","c138f73f2bb8c2e8"],"state":"online","in_service":false,"id_s":"1492931233743874","calendar_enabled":true,"api_version":48,"backseat_token":null,"backseat_token_updated_at":null,"vehicle_config":{"aux_park_lamps":"Eu","badge_version":0,"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"model3","charge_port_type":"CCS","cop_user_set_temp_supported":true,"dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":true,"efficiency_package":"Default","eu_vehicle":true,"exterior_color":"MidnightSilver","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":"19,20,22,0.8,0.04","performance_package":"Performance","plg":false,"pws":false,"rear_drive_unit":"PM216MOSFET","rear_seat_heaters":1,"rear_seat_type":0,"rhd":true,"roof_color":"RoofColorGlass","seat_type":null,"spoiler_type":"Passive","sun_roof_installed":null,"supports_qr_pairing":false,"third_row_seats":"None","timestamp":1666963820090,"trim_badging":"p74d","use_range_badging":true,"utc_offset":3600,"webcam_supported":true,"wheel_type":"Stiletto20DarkSquare"},"command_signing":"allowed"},{"energy_site_id":1689201426503170,"resource_type":"battery","site_name":"REMOVE ME","id":"STExxx20509-00082","gateway_id":"1152100-13-J--CNxxx024G3J04I","asset_site_id":"0ec3445c-c026-470f-b0ad-b45dc8aa8198","energy_left":0,"total_pack_energy":0,"percentage_charged":0,"battery_type":"ac_powerwall","backup_capable":true,"battery_power":0,"storm_mode_enabled":true,"powerwall_onboarding_settings_set":true,"sync_grid_alert_enabled":true,"breaker_alert_enabled":false,"components":{"battery":false,"battery_type":"ac_powerwall","solar":true,"solar_type":"pv_panel","grid":true,"load_meter":true,"market_type":"residential"}},{"energy_site_id":1689204023389203,"resource_type":"battery","site_name":"My Home","id":"STExxx20921-00213","gateway_id":"1152100-13-J--CNxxx164G3J012","asset_site_id":"95a17427-d88a-491e-a777-75d38cde78a4","energy_left":11352.736842105263,"total_pack_energy":14918,"percentage_charged":76.10093070187199,"battery_type":"ac_powerwall","backup_capable":true,"battery_power":380,"storm_mode_enabled":true,"powerwall_onboarding_settings_set":true,"sync_grid_alert_enabled":true,"breaker_alert_enabled":false,"components":{"battery":true,"battery_type":"ac_powerwall","solar":true,"solar_type":"pv_panel","grid":true,"load_meter":true,"market_type":"residential"}}],"count":3}
2022-10-28 14:42:08.893 DEBUG (MainThread) [teslajsonpy.controller] 94876: Changing car_online from {} to True
2022-10-28 14:42:08.893 DEBUG (MainThread) [teslajsonpy.controller] 94876: Resetting last_wake_up_time to: 1666964529
2022-10-28 14:42:08.893 DEBUG (MainThread) [teslajsonpy.controller] 94876: Resetting last_parked_timestamp to: 1666964529 shift_state None
2022-10-28 14:42:08.894 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 4:11:40
2022-10-28 14:42:08.895 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/vehicles/1492931233743874/vehicle_data {}
2022-10-28 14:42:17.994 DEBUG (MainThread) [teslajsonpy.connection] 408: {"response":null,"error":"{\"error\": \"timeout\"}","error_description":""}
2022-10-28 14:42:17.994 DEBUG (MainThread) [teslajsonpy.controller] Exception: vehicle_unavailable
api(('VEHICLE_DATA',) {'path_vars': {'vehicle_id': '1492931233743874'}, 'wake_if_asleep': False})
2022-10-28 14:42:17.995 DEBUG (MainThread) [teslajsonpy.controller] 94876: Changing car_online from True to False
2022-10-28 14:42:17.995 DEBUG (MainThread) [teslajsonpy.controller] Vehicle asleep - data unavailable.
2022-10-28 14:42:17.995 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 4:11:31
2022-10-28 14:42:17.996 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/1689201426503170/site_info {}
2022-10-28 14:42:18.827 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":"1152100-13-J--CN322024G3J04I","site_name":"REMOVE ME","backup_reserve_percent":30,"default_real_mode":"self_consumption","installation_date":"2022-05-09T11:29:29+01:00","user_settings":{"storm_mode_enabled":true,"powerwall_onboarding_settings_set":true,"sync_grid_alert_enabled":true,"breaker_alert_enabled":false},"components":{"solar":true,"solar_type":"pv_panel","battery":true,"grid":true,"backup":true,"gateway":"teg","load_meter":true,"tou_capable":true,"storm_mode_capable":true,"flex_energy_request_capable":false,"car_charging_data_supported":false,"off_grid_vehicle_charging_reserve_supported":false,"vehicle_charging_performance_view_enabled":false,"vehicle_charging_solar_offset_view_enabled":false,"battery_solar_offset_view_enabled":true,"solar_value_enabled":true,"energy_value_header":"Energy Value","energy_value_subheader":"Estimated Value","energy_service_self_scheduling_enabled":true,"show_grid_import_battery_source_cards":true,"backup_time_remaining_enabled":true,"battery_type":"ac_powerwall","configurable":true,"grid_services_enabled":false},"battery_count":1,"tou_settings":{"optimization_strategy":"economics","schedule":[{"target":"off_peak","week_days":[1,0],"start_seconds":84600,"end_seconds":19800},{"target":"peak","week_days":[1,0],"start_seconds":19800,"end_seconds":84600}]},"installation_time_zone":"Europe/London","max_site_meter_power_ac":1000000000,"min_site_meter_power_ac":-1000000000,"geolocation <geo location removed>
2022-10-28 14:42:18.828 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 4:11:30
2022-10-28 14:42:18.829 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/powerwalls/STE20220509-00082 {}
2022-10-28 14:42:19.744 DEBUG (MainThread) [teslajsonpy.connection] 408: {"response":null,"error":https://powergate.prd.sn.tesla.services:443/api/powerwalls/1152100-13-J--CNxxx024G3J04I/fullstatus => Can't get recent status from the battery,"error_description":""}
2022-10-28 14:42:19.744 DEBUG (MainThread) [teslajsonpy.controller] Exception: vehicle_unavailable
api(('BATTERY_DATA',) {'path_vars': {'battery_id': 'STE20220509-00082'}})
Issue Analytics
- State:
- Created a year ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Troubleshoot agent connectivity issues - Operations Manager
The most likely cause of this error is that the agent is not authorized to communicate with the server, or the server has...
Read more >Use Crash Detection on iPhone or Apple Watch to call for help ...
If your iPhone or Apple Watch detects a severe car crash, your device can help connect you to emergency services.
Read more >Garmin Connect App: Pairing Failed Message When Adding a ...
A "Pairing Failed" message (sometimes followed by "Setup was not successful" or "Unable to pair your Garmin device") when trying to add your...
Read more >Crashes | Android Developers
If you need to reproduce a network exception, such as an UnknownHostException , then try turning on airplane mode while your application ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Completely agree - if anything the findings above confirm the bug (if theres a failed component on the tesla side)
I’m having this error now too. I think it’s because Tesla added a loaner to my app which is no longer there. Any fixes?
2022-11-14 12:39:18.586 ERROR (MainThread) [custom_components.tesla_custom] Unable to communicate with Tesla API: VEHICLE_UNAVAILABLE