widewing / ha-toyota-na

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

Errors setting up toyota_na platform #10

Closed jlmaners closed 2 years ago

jlmaners commented 2 years ago

Tried to download and install via HACS today. Install process worked fine, and even the setup process via the UI - all seemed to go well with adding the account then started seeing the following errors in the logs and no entities/sensors/etc.

2022-01-18 17:02:53 ERROR (MainThread) [root] Error parsing response: {"status":"SUCCESS","code":200,"message":"Ok","errors":[]}
2022-01-18 17:02:53 WARNING (MainThread) [custom_components.toyota_na] Error fetching odometer detail
2022-01-18 17:02:53 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up toyota_na platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/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-01-18 17:02:53 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up toyota_na platform for device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/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'

Not sure if this is an issue with the Python package or some config issue on my end. I'll try to dig into this some more but thought I'd drop something here in case anyone had seen this before.

Update: I'm now also, getting emails triggered to me about Drive Pulse data privacy getting flipped back and forth between Opt-Out and Opt-In.

widewing commented 2 years ago

So it's currently only work with newer Toyota models (identified as 17CYPLUS, not work with 17CY). Can you try run python -m toyota_na.app get_user_vehicle_list and find what's in the generation section

jlmaners commented 2 years ago

That was the issue - thanks for the quick response.