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
398 stars 84 forks source link

China Kia account cannot log in due to unknown error #757

Open woshixuantao opened 8 months ago

woshixuantao commented 8 months ago

Here is the error log

此错误来自自定义集成。

Logger: custom_components.kia_uvo.config_flow Source: custom_components/kia_uvo/config_flow.py:159 Integration: Hyundai / Kia Connect (documentation, issues) First occurred: 01:17:48 (1 occurrences) Last logged: 01:17:48

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/KiaUvoApiCN.py", line 145, in login device_id = self._get_device_id() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiCN.py", line 1018, in _get_device_id _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiCN.py", line 92, 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.' image

屏幕截图 2023-11-21 012334

cdnninja commented 8 months ago

Will need someone in China to debug this. @toraidl could you take a look?

woshixuantao commented 8 months ago

I hope if you have time, you can help troubleshoot the problem. Thank you very much!

15075550180 commented 7 months ago

Finally found someone who encountered the same problem. I hope the expert can help to solve it.Thank you very much!

LitchiCherry commented 6 months ago

The same problem. EV5 with Kia connect China version.

LitchiCherry commented 6 months ago

This error message is from kia server? Maybe they have updated the api or banned the integration?

cdnninja commented 6 months ago

More likely api changed. Someone needs to sniff the traffic and create a pull request with the fix.

woshixuantao commented 6 months ago

What do we need to do? I think I can help.

cdnninja commented 6 months ago

Sniff the traffic from the native app or website. Compare to our code in the api repo and make any corrections.

LitchiCherry commented 6 months ago

Sniff the traffic from the native app or website. Compare to our code in the api repo and make any corrections. Tried but failed. Once MitM on iOS, kia connect prevented me from logging in and returned error.

cdnninja commented 6 months ago

Sniff the traffic from the native app or website. Compare to our code in the api repo and make any corrections.

Tried but failed. Once MitM on iOS, kia connect prevented me from logging in and returned error

Knox player to run android with Charles proxy is my usual approach but each apps different.

If a website exists in China for Kia Hyundai can also just use browsers developer mode.

woshixuantao commented 6 months ago

I looked around and it looks like it was intercepted. 😟 ![Uploading Screenshot_2024-01-31-17-07-01-58_7fac49e5329bfa70bf0c1257a1a51d55.jpg…]()

LitchiCherry commented 5 months ago

图挂了

woshixuantao commented 5 months ago

Screenshot_2024-01-31-17-07-01-58_7fac49e5329bfa70bf0c1257a1a51d55

LitchiCherry commented 5 months ago

这个只是网络信息,数据包内容没有看到。

woshixuantao commented 5 months ago

这个只是网络信息,数据包内容没有看到。

我不知道他是不是拦截代理方式打开kia Connect 抓包里面就是没有数据 还是我的抓包方式有问题

LitchiCherry commented 5 months ago

这个只是网络信息,数据包内容没有看到。

我不知道他是不是拦截代理方式打开kia Connect 抓包里面就是没有数据 还是我的抓包方式有问题

是的,我在iOS上面一样的,应该是对SSL证书进行了校验