Closed Ramorous closed 2 years ago
Can you confirm your mobile app is working and has a car working in it?
On Apr 14, 2022, at 5:10 AM, Ramorous @.***> wrote:
Version:
Canada: Sorento
Unable To Integrate
This error originated from a custom integration.
Logger: homeassistant.config_entries Source: custom_components/kia_uvo/init.py:207 Integration: Kia Uvo / Hyundai Bluelink (documentation, issues) First occurred: 7:04:35 AM (1 occurrences) Last logged: 7:04:35 AM
Error setting up entry @.*** for kia_uvo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/kia_uvo/init.py", line 218, in async_setup_entry await update(dt_util.utcnow()) File "/config/custom_components/kia_uvo/init.py", line 207, in update datetime.now(local_timezone) - vehicle.last_updated TypeError: can't subtract offset-naive and offset-aware datetimes This error originated from a custom integration.
Logger: custom_components.kia_uvo.Vehicle Source: custom_components/kia_uvo/Vehicle.py:81 Integration: Kia Uvo / Hyundai Bluelink (documentation, issues) First occurred: 7:04:35 AM (1 occurrences) Last logged: 7:04:35 AM
kia_uvo - Exception in update : 'result' - traceback: Traceback (most recent call last): File "/config/custom_components/kia_uvo/Vehicle.py", line 56, in update self.vehicle_data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/kia_uvo/KiaUvoApiCA.py", line 133, in get_cached_vehicle_status response = response["result"]["status"] KeyError: 'result'
To Reproduce Steps to reproduce the behavior:
Go to Integrations Click on Add Integration Search Kia Login See error Expected behavior Integration
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
Yes, I can confirm that.
Please turn on the debug logging and post those logs. Debug is outlined on the read me.
On Apr 14, 2022, at 7:43 AM, Ramorous @.***> wrote:
Yes, I can confirm that.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
2022-04-14 10:16:05 DEBUG (MainThread) [custom_components.kia_uvo] kia_uvo - async_setup_entry started - <homeassistant.config_entries.ConfigEntry object at 0x7f755addd400> 2022-04-14 10:16:05 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - Received token into Vehicle Object {'valid_until': '2022-04-15 06:03:17.490740', 'access_token': 'xxx', 'refresh_token': 'xxx', 'device_id': None, 'vehicle_name': 'Sorento', 'vehicle_id': 'vehicle_id==', 'vehicle_regid': None, 'vehicle_model': 'Sorento', 'vehicle_registration_date': 'missing', 'stamp': 'NoStamp'} 2022-04-14 10:16:05 DEBUG (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - Refresh token started 2022-04-15 06:03:17.490740 2022-04-14 10:16:05.737804 False 2022-04-14 10:16:06 DEBUG (SyncWorker_4) [custom_components.kia_uvo.KiaUvoApiCA] kia_uvo - get_cached_vehicle_status response {'error': {'errorCode': '7101', 'errorDesc': "We're sorry, but your request could not be processed. Please try again. If the issue persists call Customer assistance at 1-877-542-2886."}, 'responseHeader': {'responseCode': 1}} 2022-04-14 10:16:08 ERROR (MainThread) [custom_components.kia_uvo.Vehicle] kia_uvo - Exception in update : 'result' - traceback: Traceback (most recent call last): File "/config/custom_components/kia_uvo/Vehicle.py", line 56, in update self.vehicle_data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/kia_uvo/KiaUvoApiCA.py", line 133, in get_cached_vehicle_status response = response["result"]["status"] KeyError: 'result' 2022-04-14 10:16:08 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry eb@mydomain.ca for kia_uvo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/kia_uvo/init.py", line 218, in async_setup_entry await update(dt_util.utcnow()) File "/config/custom_components/kia_uvo/init.py", line 207, in update datetime.now(local_timezone) - vehicle.last_updated TypeError: can't subtract offset-naive and offset-aware datetimes
I just removed and re-added on my 2019 Kia Sorento in Canada and it works. What year is the car? Can you check status such as doors in the app without issue? Is your UVO subscription active?
Also what version of HA are you running and on what OS?
Kia connect works for my 2020 Sorento without issue. This worked prior to me putting this in. I did fully remove the add-on and restart etc....
version | core-2022.4.4 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.9.9 |
os_name | Linux |
os_version | 5.10.108 |
arch | x86_64 |
timezone | America/Toronto |
Which worked prior to putting this in? Did it work previously and stopped? Which add on are you referencing? Kia_uvo is an integration not an add on.
It looks like Kia servers don't like our query to access the cars. I would think to debug this we would need you to watch what query they send to the servers via a web browser. This can be done via: https://github.com/fuatakgun/kia_uvo/wiki/How-to-sniff-API-via-MS-Edge
once we have that I can give you a line that will add something to the logs showing what we send. In theory it should be the same.
It's an integration, sorry for not using the right term. But it worked for about 5 days then stopped reporting. That's when I saw the errors and just tried to log back in, remove and re-add, all my usual troubleshooting steps for an infrastructure guy like me.
Gotcha. For some reason Kia doesn't like the request we are sending them. Please sniff the traffic using a web browser. You are looking for the payload hitting "lstvhclsts" which is the cached vehicle status.
Add_LOGGER.debug(f"{DOMAIN} - get_cached_vehicle_status headers {headers}")
to the kiauvoapica.py file on line 129. In theory our headers should roughly match your sniffed headers.
I was able to resolve the issue by removing the integration and leaving it out. Logged in and it failed (bad username/password) then it worked. Go figure.
Version:
Canada: Sorento
Unable To Integrate
This error originated from a custom integration.
Logger: homeassistant.config_entries Source: custom_components/kia_uvo/init.py:207 Integration: Kia Uvo / Hyundai Bluelink (documentation, issues) First occurred: 7:04:35 AM (1 occurrences) Last logged: 7:04:35 AM
Error setting up entry eb@bet....... for kia_uvo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/kia_uvo/init.py", line 218, in async_setup_entry await update(dt_util.utcnow()) File "/config/custom_components/kia_uvo/init.py", line 207, in update datetime.now(local_timezone) - vehicle.last_updated TypeError: can't subtract offset-naive and offset-aware datetimes This error originated from a custom integration.
Logger: custom_components.kia_uvo.Vehicle Source: custom_components/kia_uvo/Vehicle.py:81 Integration: Kia Uvo / Hyundai Bluelink (documentation, issues) First occurred: 7:04:35 AM (1 occurrences) Last logged: 7:04:35 AM
kia_uvo - Exception in update : 'result' - traceback: Traceback (most recent call last): File "/config/custom_components/kia_uvo/Vehicle.py", line 56, in update self.vehicle_data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/kia_uvo/KiaUvoApiCA.py", line 133, in get_cached_vehicle_status response = response["result"]["status"] KeyError: 'result'
To Reproduce Steps to reproduce the behavior:
Expected behavior Integration