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
438 stars 88 forks source link

Yesterday: OK, Today: Error and then "unexpected error" and in log "unexpected exception when adding integration" when re-adding integration #661

Closed MYG63 closed 1 year ago

MYG63 commented 1 year 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 EU, Kia, Soul EV, MY 2020 Version of the integration 2.10.2

Describe the bug A clear and concise description of what the bug is.

Yesterday the integration worked. Today the integration stopped working and car-device was unavailable. Then I tried to re-add the integration in HA. This is not possible.

Debug logs if an error occurred

2023-06-29 09:36:44.964 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - get_stamp 2023-06-29 05:02:58.607000+00:00 120000 76 998 76.88631513333333 2023-06-29 09:37:00.123 ERROR (MainThread) [custom_components.kia_uvo.config_flow] Unexpected exception Traceback (most recent call last): File "/config/custom_components/kia_uvo/config_flow.py", line 159, in async_step_user await validate_input(self.hass, user_input) File "/config/custom_components/kia_uvo/config_flow.py", line 63, in validate_input token: Token = await 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/KiaUvoApiEU.py", line 198, in login device_id = self._get_device_id(stamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 108, in _check_response_for_errors raise error_code_mappingresponse["resCode"] hyundai_kia_connect_api.exceptions.RequestTimeoutError: Undefined Error - notNull Violation: devices.device_id cannot be null

To Reproduce YES, just go to "add integration" and enter the credentials. These error again occurs.

Expected behavior Just install integration

2xdehelft commented 1 year ago

Same problem here...

Matze-aaa commented 1 year ago

Same problem, thanks for opening an issue and the description Kia connect server via kia app is working.

arjanhs commented 1 year ago

Having the same issue today also

snieuwen commented 1 year ago

Same here, suddenly stopped working overnight with same error.

kletsah commented 1 year ago

Same here, stopped working @ 4 am West-European time zone

TazUk commented 1 year ago

With the integration previously configured and working I now see all sensors as unavailable and get the following logged error:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/kia_uvo/coordinator.py:166
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:01:01 (1 occurrences)
Last logged: 14:01:01

[140240714115600] Server returned: 'Invalid request body - Invalid parameter.'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/config/custom_components/kia_uvo/services.py", line 49, in async_handle_force_update
    await coordinator.async_force_update_all()
  File "/config/custom_components/kia_uvo/coordinator.py", line 158, in async_force_update_all
    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 123, in check_and_refresh_token
    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 198, in login
    device_id = self._get_device_id(stamp)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id
    _check_response_for_errors(response)
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 110, in _check_response_for_errors
    raise APIError(f"Server returned: '{response['resMsg']}'")
hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid parameter.'
mjmeierhoefer commented 1 year ago

The integration stopped working after upgrade to Home Assistant Supervisor 2023.06.4. This update required a restart for changing configuration structure of homeassistant.

2023-06-29 16:22:14.275 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Hyundai Europe myemailaddress' for kia_uvo integration not ready yet: Config Not Ready: Server returned: 'Invalid request body - Invalid parameter.'; Retrying in background 2023-06-29 16:22:20.036 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: Server returned: 'Invalid request body - Invalid parameter.' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, 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 120, in check_and_refresh_token self.initialize() File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 64, 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 198, in login device_id = self._get_device_id(stamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 110, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid parameter.' 2023-06-29 16:22:30.672 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: Server returned: 'Invalid request body - Invalid parameter.' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, 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 120, in check_and_refresh_token self.initialize() File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 64, 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 198, in login device_id = self._get_device_id(stamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 110, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid parameter.'

kletsah commented 1 year ago

The integration stopped working after upgrade to Home Assistant Supervisor 2023.06.4. This update required a restart for changing configuration structure of homeassistant.

2023-06-29 16:22:14.275 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Hyundai Europe myemailaddress' for kia_uvo integration not ready yet: Config Not Ready: Server returned: 'Invalid request body - Invalid parameter.'; Retrying in background 2023-06-29 16:22:20.036 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: Server returned: 'Invalid request body - Invalid parameter.' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, 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 120, in check_and_refresh_token self.initialize() File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 64, 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 198, in login device_id = self._get_device_id(stamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 110, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid parameter.' 2023-06-29 16:22:30.672 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Unexpected error fetching kia_uvo data: Server returned: 'Invalid request body - Invalid parameter.' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, 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 120, in check_and_refresh_token self.initialize() File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 64, 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 198, in login device_id = self._get_device_id(stamp) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1104, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 110, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid parameter.'

Mine already stopped before I did the upgrade, so that might be the wrong conclusion that it broke after the upgrade.

TazUk commented 1 year ago

@kletsah I'm confident this isn't upgrade related as my system was last restarted / upgraded 2 days prior to the failure.

kletsah commented 1 year ago

@TazUk Yes, that was also my conclusion responding to @mjmeierhoefer :)

fuatakgun commented 1 year ago

Kia probably had changed or added a new security layer on their servers and we need to work it backwards.

rolandsteinmeyer commented 1 year ago

Also stopped working here today. Have not made any changes to HA recently. UVO App still works. I have also tried with bluelinky CLI mode (https://github.com/Hacksore/bluelinky) which I used before finding this integration.

This also does no longer work and throws this error

error: @EuropeController.login: sign in with EuropeanBrandAuthStrategy failed with error Error: @EuropeanBrandAuthStrategy.login: Cannot find the argument userId in https://prd.eu-ccapi.kia.com:8080/web/v1/user/integration/auth?&locale=en (...) Just as a hint that there may have been changes at kia.

Maaxion commented 1 year ago

This seems related https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/issues/348

Fair to say everyone in EU at least is affected.

Also if you have the same error, please just tag the original issue with a reaction. Replying I have the same issue just clutters the actual discussion around resolvng the issue. This makes it harder and take longer to fix the actual problem. Having dozens of people say "Me too, same error" is not productive, it is already known that the error affects or will affect most users.

Zaphod360 commented 1 year ago

A little bit of potentially useful info. My UVO app is not working however the Kia Connect app is working? Don't know if that is relevant?

mariadumitruiulian commented 1 year ago

same here

bbeijl commented 1 year ago

Same problem here.

finnok commented 1 year ago

'Unexpected Error' problem here too .. removed and tried to re-add integration

McMoobud commented 1 year ago

Same, tried removing and restarting and now can't re-add the add on

fuatakgun commented 1 year ago

resolving here, check open issues first. https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/660

coditmarc commented 1 year ago

UVO Connect is no longer working and confirmed by KIA Netherlands. KIA Connect is the new Android App. Which might mean that the API that is being used might have changed as well.

fuatakgun commented 1 year ago

Please let's keep the comment stream clean as much as possible so in case something important pops up, we don't miss it.

I am working on this and trying to figure out what has changed in the login flow.

Also checking other repositories if they have a solution in place.

Me too style comments are not helpful, while i understand the frustration here, let's be patient.

dkwabek commented 1 year ago

same problem here since 2 days

MYG63 commented 1 year ago

Problem seems to be fixed in the new version v2.10.4 Thank you