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

service.kia_uvo.start_climate fails on 2024 Sportave PHEV #884

Open jayscovill opened 1 month ago

jayscovill commented 1 month ago

Region and Brand of car Canada/2024 Kia Sportage PHEV

Version of the integration 2.24.4

Describe the bug When I call the service.kia_uvo.start_climate, even with minimal settings such as setting the temperature, it fails with "Failed to call service kia_uvo.start_climate. Unknown error"

All climate features appear to be there that are valid for my vehicle but don't work.

Debug logs if an error occurred

2024-05-28 19:32:39.802 DEBUG (SyncWorker_60) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - Received Pin validation response {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'pAuth': 'mBMEEvspshpGKvbcpayTmfLfGljfJJEQ'}}
2024-05-28 19:32:39.803 DEBUG (SyncWorker_60) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - Planned start_climate payload {'setting': {'airCtrl': 1, 'defrost': False, 'heating1': False, 'igniOnDuration': 1, 'ims': 0, 'airTemp': {'value': '06H', 'unit': 0, 'hvacTempType': 0}, 'seatHeaterVentCMD': {'drvSeatOptCmd': 0, 'astSeatOptCmd': 0, 'rlSeatOptCmd': 0, 'rrSeatOptCmd': 0}}, 'pin': '****'}
2024-05-28 19:32:39.931 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Expecting value: line 10 column 1 (char 9)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 10 column 1 (char 9)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/kia_uvo/services.py", line 90, in async_handle_start_climate
await coordinator.async_start_climate(vehicle_id, climate_request_options)
File "/config/custom_components/kia_uvo/coordinator.py", line 198, in async_start_climate
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 140, in start_climate
return self.api.start_climate(self.token, self.get_vehicle(vehicle_id), options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiCA.py", line 608, in start_climate
response = response.json()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 10 column 1 (char 9)
2024-05-28 19:32:39.936 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140573709048384] Error handling message: Unknown error (unknown_error) Jay from 192.168.12.68 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 10 column 1 (char 9)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/kia_uvo/services.py", line 90, in async_handle_start_climate
await coordinator.async_start_climate(vehicle_id, climate_request_options)
File "/config/custom_components/kia_uvo/coordinator.py", line 198, in async_start_climate
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 140, in start_climate
return self.api.start_climate(self.token, self.get_vehicle(vehicle_id), options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiCA.py", line 608, in start_climate
response = response.json()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 10 column 1 (char 9)

To Reproduce Call service.kia_uvo.start_climate with any parameters

cdnninja commented 1 month ago

Compare to your native app and try pass those settings.