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
391 stars 81 forks source link

No device or entity error when trying to loggin #795

Open gustafssonpeter opened 6 months ago

gustafssonpeter commented 6 months ago

Please check Services, Known Bug / Issues and Troubleshooting over here first: https://github.com/fuatakgun/kia_uvo/blob/master/README.md EU and Kia Niro EV

Version of the integration 2.18.1

Describe the bug Can't connect to my car when i start the integration

Debug logs if an error occurred 2024-01-04 10:16:06.829 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: 'redirectUrl' Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 238, in login authorization_code = self._get_authorization_code_with_redirect_url( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1185, in _get_authorization_code_with_redirect_url parsed_url = urlparse(response["redirectUrl"])


KeyError: 'redirectUrl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/kia_uvo/coordinator.py", line 107, in _async_update_data
    await self.async_check_and_refresh_token()
  File "/config/custom_components/kia_uvo/coordinator.py", line 166, in async_check_and_refresh_token
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 124, in check_and_refresh_token
    self.initialize()
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 68, in initialize
    self.token: Token = self.api.login(self.username, self.password)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 243, in login
    authorization_code = self._get_authorization_code_with_form(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1283, in _get_authorization_code_with_form
    parsed_url = urlparse(response["redirectUrl"])
                          ~~~~~~~~^^^^^^^^^^^^^^^
Outlined here: https://github.com/fuatakgun/kia_uvo/blob/master/README.md

**To Reproduce**

**Expected behavior**

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

**Additional context**
cdnninja commented 6 months ago

Does your native app work? Please retry as well.

christoph-luebbe commented 6 months ago

I can confirm this bug. I can connect to my car with the native app. But Tibber integration and homeassistant integration show no car assigned to my account

gustafssonpeter commented 6 months ago

Does your native app work? Please retry as well.

Yes it works fine in my native KIA app

stefanuytterhoeven commented 5 months ago

I have the same error. My app works. Created the user in the beginning of January 2024. Europe. The integration worked before, but suddenly this error. Didn't change a thing. Removing and reinstalling didn't help.

Found the solution: I tried first to reinstall the integration, but I got the same error. Log out of the KIA APP. And log in again. Then I reinstalled the integration and it logged in. Hopefully it keeps working.