widewing / ha-toyota-na

Home Assistant integration for Toyota Motor (North America) connected services
69 stars 12 forks source link

Failed to setup #25

Open cradcore opened 2 years ago

cradcore commented 2 years ago

After following the instructions and installing this integration, I am prompted to sign-in, which completes succesfully. Afterwards though, I get no new devices/entities in HA and the following in my log:

2022-02-06 10:51:01 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up toyota_na platform for sensor
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/toyota_na/sensor.py", line 31, in async_setup_entry
if sensor.available:
File "/config/custom_components/toyota_na/sensor.py", line 75, in available
return "fuelLevel" in self.vehicle_odometer_detail
File "/config/custom_components/toyota_na/base_entity.py", line 47, in vehicle_odometer_detail
return self.vehicle["odometer_detail"]
KeyError: 'odometer_detail'
2022-02-06 10:51:01 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up toyota_na platform for device_tracker
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/toyota_na/device_tracker.py", line 21, in async_setup_entry
if tracker.available:
File "/config/custom_components/toyota_na/device_tracker.py", line 47, in available
return "latitude" in self.vehicle_status
File "/config/custom_components/toyota_na/base_entity.py", line 35, in vehicle_status
return self.vehicle["status"]
KeyError: 'status'
2022-02-06 10:51:36 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up toyota_na platform for sensor
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/toyota_na/sensor.py", line 31, in async_setup_entry
if sensor.available:
File "/config/custom_components/toyota_na/sensor.py", line 75, in available
return "fuelLevel" in self.vehicle_odometer_detail
File "/config/custom_components/toyota_na/base_entity.py", line 47, in vehicle_odometer_detail
return self.vehicle["odometer_detail"]
KeyError: 'odometer_detail'
2022-02-06 10:51:36 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up toyota_na platform for device_tracker
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/toyota_na/device_tracker.py", line 21, in async_setup_entry
if tracker.available:
File "/config/custom_components/toyota_na/device_tracker.py", line 47, in available
return "latitude" in self.vehicle_status
File "/config/custom_components/toyota_na/base_entity.py", line 35, in vehicle_status
return self.vehicle["status"]
KeyError: 'status'

Running python -m toyota_na.app get_user_vehicle_list returns toyota_na.exceptions.TokenExpired, even after deleting and re-installing the add on

cradcore commented 2 years ago

Update: I ran python -m toyota_na.app authorize and the TokenExpired error went away. The generation is 17CYPLUS. Still no data showing up in HA though

widewing commented 2 years ago

Hmm do you have an active subscription?

cradcore commented 2 years ago

@widewing I do. Currently both Safety Connect and Wi-Fi Connect are active

widewing commented 2 years ago

How about remote connect? I think that's what does the job. Or can you see your vehicle status via Toyota app?

cradcore commented 2 years ago

@widewing I don't see that in my list of subscriptions. Actually don't even see the option to purchase it either. I do see my vehicle status in the toyota app, at least some of what looks like is implemented here. I see my odometer and fuel gauge, but not things like door lock status, tire pressure, etc.

vanstinator commented 2 years ago

Can you try this again? We fixed several bugs and added support for additional vehicles in the https://github.com/widewing/ha-toyota-na/releases/tag/v2.0.0

vanstinator commented 2 years ago

We just pushed a release that supports the diagnostic platform in HA. Navigate to the integrations page, select the menu on the Toyota integration, and click Download Diagnostics. The dump automatically redacts all sensitive information and will provide us with a lot more detail to help diagnose what's going on here.

cradcore commented 2 years ago

I apologize for the late response. Unfortunately something else seems to be broken after installing the integration, which doesn't let me even get to the Download Diagnostics option:

2022-05-18 11:12:05 ERROR (MainThread) [custom_components.toyota_na] Error fetching data
Traceback (most recent call last):
  File "/config/custom_components/toyota_na/__init__.py", line 104, in update_vehicles_status
    raw_vehicles = await get_vehicles(client)
  File "/config/.local/lib/python3.9/site-packages/toyota_na/vehicle/vehicle.py", line 36, in get_vehicles
    await vehicle.update()
  File "/config/.local/lib/python3.9/site-packages/toyota_na/vehicle/vehicle_generations/seventeen_cy_plus.py", line 77, in update
    vehicle_status = await self._client.get_vehicle_status(self._vin)
  File "/config/.local/lib/python3.9/site-packages/toyota_na/client.py", line 67, in get_vehicle_status
    return await self.get_vehicle_status_17cyplus(vin)
  File "/config/.local/lib/python3.9/site-packages/toyota_na/client.py", line 80, in get_vehicle_status_17cyplus
    return await self.api_get("v1/global/remote/status", {"VIN": vin})
  File "/config/.local/lib/python3.9/site-packages/toyota_na/client.py", line 41, in api_get
    return await self.api_request("GET", endpoint, header_params)
  File "/config/.local/lib/python3.9/site-packages/toyota_na/client.py", line 31, in api_request
    resp.raise_for_status()
  File "/usr/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('https://oneapi.telematicsct.com/v1/global/remote/status')

image

JmactheAttack commented 2 years ago

Seeing the same error when trying to set this up today. Home Assistant Core 2022.5.5 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.1

From the logs:

`This error originated from a custom integration.

Logger: custom_components.toyota_na Source: custom_components/toyota_na/init.py:104 Integration: Toyota (North America) (documentation, issues) First occurred: 8:56:44 PM (6 occurrences) Last logged: 8:59:30 PM

Error fetching data Traceback (most recent call last): File "/config/custom_components/toyota_na/init.py", line 104, in update_vehicles_status raw_vehicles = await get_vehicles(client) File "/usr/local/lib/python3.9/site-packages/toyota_na/vehicle/vehicle.py", line 36, in get_vehicles await vehicle.update() File "/usr/local/lib/python3.9/site-packages/toyota_na/vehicle/vehicle_generations/seventeen_cy_plus.py", line 77, in update vehicle_status = await self._client.get_vehicle_status(self._vin) File "/usr/local/lib/python3.9/site-packages/toyota_na/client.py", line 67, in get_vehicle_status return await self.get_vehicle_status_17cyplus(vin) File "/usr/local/lib/python3.9/site-packages/toyota_na/client.py", line 80, in get_vehicle_status_17cyplus return await self.api_get("v1/global/remote/status", {"VIN": vin}) File "/usr/local/lib/python3.9/site-packages/toyota_na/client.py", line 41, in api_get return await self.api_request("GET", endpoint, header_params) File "/usr/local/lib/python3.9/site-packages/toyota_na/client.py", line 31, in api_request resp.raise_for_status() File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 500, message='Internal Server Error', url=URL('https://oneapi.telematicsct.com/v1/global/remote/status')`