Hyundai-Kia-Connect / kia_uvo

A Home Assistant HACS integration that supports Kia Connect(Uvo) and Hyundai Bluelink. The integration supports the EU, Canada and the USA.
MIT License
390 stars 80 forks source link

Hyundai All New Kona 2024 API Error 2 #855

Closed matknowles closed 3 months ago

matknowles commented 3 months ago

Please check Services, Known Bug / Issues and Troubleshooting over here first: https://github.com/fuatakgun/kia_uvo/blob/master/README.md Region and Brand of car UK Hyundai All New Kona EV 2024 Version of the integration 2.22.0

Describe the bug Adding a new car shows failed setup: API failed (2). I have tried both my existing bluelink account and also tried setting up a new one, same result. Seems like the car isn't supported yet perhaps or maybe the API has been updated?

Debug logs if an error occurred `Logger: custom_components.kia_uvo.coordinator Source: helpers/update_coordinator.py:318 integration: Kia Uvo / Hyundai Bluelink (documentation, issues) First occurred: 20 March 2024 at 22:00:44 (341 occurrences) Last logged: 06:15:06 Unexpected error fetching kia_uvo data: 2

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/kia_uvo/coordinator.py", line 142, in _async_update_data await self.hass.async_add_executor_job( File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 80, in update_all_vehicles_with_cached_state self.update_vehicle_with_cached_state(vehicle_id) File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 85, in update_vehicle_with_cached_state self.api.update_vehicle_with_cached_state(self.token, vehicle) File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 350, in update_vehicle_with_cached_state self._update_vehicle_properties_ccs2(vehicle, state) File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 545, in _update_vehicle_properties_ccs2 DISTANCE_UNITS[ KeyError: 2

Logger: hyundai_kia_connect_api.KiaUvoApiEU Source: /usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py:362 First occurred: 08:14:43 (1 occurrences) Last logged: 08:14:43 Failed to parse driving info. Possible reasons: - incompatible vehicle (ICE) - new API format - API outage

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 357, in update_vehicle_with_cached_state state = self._get_driving_info(token, vehicle) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1347, in _get_driving_info _check_response_for_errors(responseAlltime) File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 119, in _check_response_for_errors raise error_code_mappingresponse["resCode"] hyundai_kia_connect_api.exceptions.RequestTimeoutError: Undefined Error - Response timeout `

To Reproduce

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

Additional context This is my 2nd Hyundai car, the first one (a Kona EV 2023) works fine. I tried deleting it to just add the new one, but it still doesn't work, only the old one does. Both cars are on separate bluelink accounts. I've been rate limited for the new car for today as well (341 retries, haha)

Ricks88 commented 3 months ago

I have sort of the same error with the 'old' Sportage 2023 PHEV:


Logger: hyundai_kia_connect_api.KiaUvoApiEU
Bron: /usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py:362
First occurred: 17:34:45 (1 gebeurtenissen)
Laatst gelogd: 17:34:45

Failed to parse driving info. Possible reasons: - incompatible vehicle (ICE) - new API format - API outage
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 357, in update_vehicle_with_cached_state
    state = self._get_driving_info(token, vehicle)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1382, in _get_driving_info
    and drivingInfoItem["calculativeOdo"] > 0
        ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'calculativeOdo'
cdnninja commented 3 months ago

Ricks88 your error is separate and has a thread on it. Should be solved now. @matknowles your error is unique. What units is your car set to? You have a 2 coming back but as per:

DISTANCE_UNITS = {None: None, 0: None, 1: LENGTH_KILOMETERS, 3: LENGTH_MILES}

We have 1 and 3 define.

matknowles commented 3 months ago

Thanks for taking a look. I pretty much rushed through the setup when we got the car initially and I don't remember setting any units at all. Looking in the app, they're set to C for temperature and mil for distance and speed. I've had a look in the car and confirmed that's how they're set and can't see any other issues. I did change those settings and reapplied them in both the car and the app and then tried to re-enable the integration and it's still giving that error. I can share the detailed log if it would help, but it seems to contain a lot of sensitive information, so would rather try factory resets/different bluelink accounts first. Screenshot 2024-03-26 093818

cdnninja commented 3 months ago

Could you redownload in hacs and select version as "master" and let me know the result?

matknowles commented 3 months ago

That worked! Thanks very much.

matknowles commented 1 month ago

Sorry to drag this up again, but I've seen a new update has been available for a while (2.24.2). Am I ok to update or will it break my setup? Thanks.