Closed bootc closed 11 months ago
I also still have non-working integration. Seems previous post has been closed prematurely.
after fixing the integration, you device IDs might have changed, can you try to remove and add back the integration.
If the issue persists, please generate logs while restarting your home assistant so we can see if the device id is matching with vehicles
response and your call.
It stopped working for me too, since I didn't know the reason I removed the application and tried to put it back on and it won't let me register, when I enter data I get the message "Unexpected error"
after fixing the integration, you device IDs might have changed, can you try to remove and add back the integration.
That seems to have fixed it for me. Interestingly the 32-character hex device_id
string generated by the web UI when selecting my vehicle from the popup hasn't changed.
If the issue persists, please generate logs while restarting your home assistant so we can see if the device id is matching with
vehicles
response and your call.
I suspect the internal vehicleId
field changed as you suggest. Perhaps it would be more useful to store the VIN as the permanent identifier and cache the vehicleId
at login time?
A mi también me dejo de funcionar, ya que no sabia el motivo eliminé la aplicación e intenté volver a ponerla y no me deja registrarme, cuando ingreso datos me sale el mensaje "Error inesperado"
I answer myself: I updated to 2.10.4 and it works now: Hyundai Tucson PHEV, Spain
I updated to 2.10.4 on 3rd July evening and everything worked. I also had correct numbers in EV remaining distance and fuel remaining distance sensors, which I never had correct (KIA sorento phev). However, today on 4th I forced update, locked car remotely and a couple of minutes later I got the same error as before:
Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/kia_uvo/coordinator.py:159 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 11:41:00 (3 occurrences) Last logged: 12:33:06
[140426700196496] Server returned: 'Invalid request body - Invalid deviceId. ' [140427499349968] Server returned: 'Invalid request body - Invalid deviceId. ' [140426702490192] Server returned: 'Invalid request body - Invalid deviceId. ' 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 159, in async_force_update_all 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 109, in force_refresh_all_vehicles_states self.force_refresh_vehicle_state(vehicle_id) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 114, in force_refresh_vehicle_state self.api.force_refresh_vehicle_state(self.token, vehicle) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 322, in force_refresh_vehicle_state state = self._get_forced_vehicle_state(token, vehicle) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 739, in _get_forced_vehicle_state _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 111, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid deviceId. '
I have also updated to 2.10.4 and then Integration works for some hours, and then i need to Reload integration.. If i keep reloading my integration, it keeps working..
Indeed, same as @RuneNyhuus - this stops working after a while. Reloading the integration brings it back to life for a finite amount of time before it starts failing again with the "Invalid request body - Invalid deviceId." error.
Thanks all, we were able to figure out the problem (not the solution) here.
While connecting to Hyundai/Kia EU servers, we have to supply a unique id to receive push notifications about commands sent to cars. Until last week, we were using a fixed id as we were not actually connecting with the push notifications servers, this week, we started to generate random numbers (following the expected pattern) but still not connected to respective servers.
Apparently, our registration mechanism with random id is invalidated after you receive your first push notification from your car. Next time, when integration tries to do an action, it generates an invalid device id
error.
I got a "Cant call service kia_uvo/update. Server returned: 'Invalid request body - Invalid deviceId. '. As already mentioned, it works the first time but then the error pops up
For me it works until i ask the integration to do something. Then it does it but must be reloaded afterwards.
With the latest update, integration in HA seems to be working fine again (including setting values, like the charging limit). Thanks! (Hyundai, Europe)
Set this up for my mate calling a service like start climate works once then stops working with device id unknown.
Removing the integration adding again allows one more go then after first service stops working again
+1 sharing debug logs on v2.10.4
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.'
Same problem stops working after some time error log below.
`. This error originated from a custom integration.
Logger: custom_components.kia_uvo.coordinator Source: custom_components/kia_uvo/coordinator.py:142 Integration: Hyundai / Kia Connect (documentation, issues) First occurred: July 7, 2023 at 10:14:36 PM (2 occurrences) Last logged: July 7, 2023 at 10:44:36 PM
Unexpected error fetching kia_uvo data: Server returned: 'Invalid request body - Invalid deviceId. ' 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 142, in _async_update_data 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 75, in update_all_vehicles_with_cached_state self.update_vehicle_with_cached_state(vehicle_id) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 80, in update_vehicle_with_cached_state self.api.update_vehicle_with_cached_state(self.token, vehicle) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 300, in update_vehicle_with_cached_state state = self._get_cached_vehicle_state(token, vehicle) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 714, in _get_cached_vehicle_state _check_response_for_errors(response) File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 111, in _check_response_for_errors raise APIError(f"Server returned: '{response['resMsg']}'") hyundai_kia_connect_api.exceptions.APIError: Server returned: 'Invalid request body - Invalid deviceId. ' `
I think I'm having this same issue. It seems that after some update from the service, the integration goes unavailable and needs reloading.
if it helps, as a workaround, i've added an extra step to my automation. after calling the service for my kia, i wait 5 seconds and call:
service: homeassistant.reload_config_entry
data: {}
target:
device_id: [device id for car]
seems to be keeping things working for now. but far from a solution
Try update your kia_uvo integration from "master" and please report back if improved. As a note the fix relogins when this error occurs consuming API calls. Not a perfect fix but helps for now.
I removed and re-added the integration (2.10.4) this afternoon and since then the integration has stayed up.
Try update your kia_uvo integration from "master" and please report back if improved. As a note the fix relogins when this error occurs consuming API calls. Not a perfect fix but helps for now.
Having updated from master a few days ago I eventually tried a force update. All values became unavailable and I will have to download again.
Try update your kia_uvo integration from "master" and please report back if improved. As a note the fix relogins when this error occurs consuming API calls. Not a perfect fix but helps for now.
Having updated from master a few days ago I eventually tried a force update. All values became unavailable and I will have to download again.
Could you provide logs? Also re-installing doesn't change anything.
Try update your kia_uvo integration from "master" and please report back if improved. As a note the fix relogins when this error occurs consuming API calls. Not a perfect fix but helps for now.
Having updated from master a few days ago I eventually tried a force update. All values became unavailable and I will have to download again.
Could you provide logs? Also re-installing doesn't change anything.
Interestingly I tried again (sorry, I don't have the log from the first time), and it has carried on working, with nothing in the log. Sorry for the false alarm - I will keep watching it and do better with the logs if there is another problem.
Try update your kia_uvo integration from "master" and please report back if improved. As a note the fix relogins when this error occurs consuming API calls. Not a perfect fix but helps for now.
Having updated from master a few days ago I eventually tried a force update. All values became unavailable and I will have to download again.
Could you provide logs? Also re-installing doesn't change anything.
Interestingly I tried again (sorry, I don't have the log from the first time), and it has carried on working, with nothing in the log. Sorry for the false alarm - I will keep watching it and do better with the logs if there is another problem.
I am on 2.10.5 and lost connection again. It hasn't recovered. Log is the same as usual:
This error originated from a custom integration.
Logger: custom_components.kia_uvo.coordinator
Source: custom_components/kia_uvo/coordinator.py:142
Integration: Kia Uvo / Hyundai Bluelink (documentation, issues)
First occurred: 12 July 2023 at 23:31:00 (13 occurrences)
Last logged: 05:31:01
Unexpected error fetching kia_uvo data: Invalid request body - Invalid deviceId.
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 142, in _async_update_data
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 75, in update_all_vehicles_with_cached_state
self.update_vehicle_with_cached_state(vehicle_id)
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 80, in update_vehicle_with_cached_state
self.api.update_vehicle_with_cached_state(self.token, vehicle)
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 304, in update_vehicle_with_cached_state
state = self._get_cached_vehicle_state(token, vehicle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 718, in _get_cached_vehicle_state
_check_response_for_errors(response)
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 111, in _check_response_for_errors
raise error_code_mapping[response["resCode"]](response["resMsg"])
hyundai_kia_connect_api.exceptions.DeviceIDError: Invalid request body - Invalid deviceId.
I have a same problem with 2.10.5 if i try to start or stop charging. After HA restart its works, but only ONE time. EU, Kia EV6.
Same here
Same issue here in EU on v2.10.5
if it helps, as a workaround, i've added an extra step to my automation. after calling the service for my kia, i wait 5 seconds and call:
service: homeassistant.reload_config_entry data: {} target: device_id: [device id for car]
seems to be keeping things working for now. but far from a solution
This workaround is still working for me.
if it helps, as a workaround, i've added an extra step to my automation. after calling the service for my kia, i wait 5 seconds and call:
service: homeassistant.reload_config_entry data: {} target: device_id: [device id for car]
seems to be keeping things working for now. but far from a solution
This workaround is still working for me.
Yup this works for me 👍
How can this help for a dashboard button ? Can we add this reload action after a button action?
How can this help for a dashboard button ? Can we add this reload action after a button action?
you could make a script that calls the service, then waits a few seconds, then calls the reload service. set the tap-action on your dashboard button to run the script instead of calling the service directly
Will do that, thanks @corvus2606 !
For those with this issue are you a Hyundai or Kia owner?
to add more, please get latest debug logs with error captured on it. we were expecting this to be fixed with latest changes, so we are not exactly sure how to fix it without you share your logs
i'm having the same issue, except that i'm unable to get it working by reloading the integration.
i own a Hyundai Kona EV
here are the logs:
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 213, 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 1154, 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 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 218, 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 1252, in _get_authorization_code_with_form
parsed_url = urlparse(response["redirectUrl"])
~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'redirectUrl'
but i also noticed, that i'm now unable to log into the BlueLink App on my phone 🫣 do you think it has something to do with the integration?
@JDkiwi: This is a different problem, not related to the "invalid device id" of this thread - so if you want this to be followed-up, please open a different thread. I also had the "redirectUrl" problem yesterday for several hours - now it works again; hopefully it was just a hick-up :) My BlueLink App worked fine all the time.
thanks for the heads up. it also works now for me again, so i guess it was just temporary.
@fuatakgun @cdnninja Find attached a full log of the issue after fresh HA restart. Vehicle: Hyundai Kona Electric Region EU (Germany)
Initial state: Vehicle is plugged in, not charging.
12:56 - calling start_charge (successfully)
13:00 - calling stop_charge unsuccessfully, receiving
hyundai_kia_connect_api.exceptions.DeviceIDError: Invalid request body - Invalid deviceId.
Any update on this? Anything else I can test or supply from the logs? Currently the integration is not usable for me. Any help is appreciated.
Regarding the workaround mentioned above, it is unclear to me how to retrieve the device id to make it part of my automations. A temporary solution with this would be better than nothing at the moment. Nevermind, I understand now that this is the static device id available in the integration if you call e.g. start_charge and not the device id from the logs.
For my 2023 European Hyundai Kona electric the integration works partly; I can lock or unlock the doors, home assistant can track the car, get the car statuses etc., but I can't for example set charging limits. If I try, it complains of the deviceId.
Integration is v 2.14.0
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 703, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 665, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/kia_uvo/services.py", line 114, in async_handle_set_charge_limit
await coordinator.set_charge_limits(vehicle_id, int(ac), int(dc))
File "/config/custom_components/kia_uvo/coordinator.py", line 226, in set_charge_limits
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 157, in set_charge_limits
return self.api.set_charge_limits(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1088, in set_charge_limits
_check_response_for_errors(response)
File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 113, in _check_response_for_errors
raise error_code_mapping[response["resCode"]](response["resMsg"])
hyundai_kia_connect_api.exceptions.DeviceIDError: Invalid request body - Invalid deviceId.
I've added the automation using visual editor, call service, set charging limits, selected my car from the dropdown-list (which probably becomes the deviceId).
I have looked through to the logs now to try and figure out what's happening.
The first request (even before login) the integration sends during startup is "get device id" to a /notifications/register
endpoint. I assume the deviceId
parameter fetched here denotes the notification-receiving device. This parameter is then sent as part of the request for commands like e.g. start/stop charge - presumably those which trigger a notification. This parameter is then invalidated on Hyundai's servers for some reason, making subsequent requests fail as they send the now invalidated deviceId
parameter, hence leading to the error response we are observing. Reloading the integration fixes this, as on (re-)start it will fetch a fresh deviceId
.
I probably didn't get it entirely right and it'll be obvious to many here, still wanted to write it down to help clarify to other users like myself.
I guess the naive fix would be to fetch a new deviceId
once the current one has been "used" but that's probably just a hack. Happy for some feedback and discussion to get this sorted.
I have looked through to the logs now to try and figure out what's happening.
The first request (even before login) the integration sends during startup is "get device id" to a
/notifications/register
endpoint. I assume thedeviceId
parameter fetched here denotes the notification-receiving device. This parameter is then sent as part of the request for commands like e.g. start/stop charge - presumably those which trigger a notification. This parameter is then invalidated on Hyundai's servers for some reason, making subsequent requests fail as they send the now invalidateddeviceId
parameter, hence leading to the error response we are observing. Reloading the integration fixes this, as on (re-)start it will fetch a freshdeviceId
.I probably didn't get it entirely right and it'll be obvious to many here, still wanted to write it down to help clarify to other users like myself.
I guess the naive fix would be to fetch a new
deviceId
once the current one has been "used" but that's probably just a hack. Happy for some feedback and discussion to get this sorted.
I think you are correct. This is new since the app ids changed a few months back.
The servers seem to pick up on the fact the push failed. I'm not in eu so can't test potential fixes. Someone will need to play with different push approaches to try make this not fail.
I have looked through to the logs now to try and figure out what's happening.
The first request (even before login) the integration sends during startup is "get device id" to a
/notifications/register
endpoint. I assume thedeviceId
parameter fetched here denotes the notification-receiving device. This parameter is then sent as part of the request for commands like e.g. start/stop charge - presumably those which trigger a notification. This parameter is then invalidated on Hyundai's servers for some reason, making subsequent requests fail as they send the now invalidateddeviceId
parameter, hence leading to the error response we are observing. Reloading the integration fixes this, as on (re-)start it will fetch a freshdeviceId
.I probably didn't get it entirely right and it'll be obvious to many here, still wanted to write it down to help clarify to other users like myself.
I guess the naive fix would be to fetch a new
deviceId
once the current one has been "used" but that's probably just a hack. Happy for some feedback and discussion to get this sorted.
You're probably right, as the call to set charge limits seems to succeed after reloading the integration, at least once :).
So how would you fix it @Sab44 ? Any clever ideas? Would the naive fix work? Is it too simplistic?
@Strauman the naive fix is basically what the current workaround does by reloading the integration. Fetching the deviceId
is done as part of the login (actually not in this repo but in the underlying library). So sure, you could change the code to relogin everytime the "invalid device id" is encountered and then repeat the previous command and maybe that's a temporary fix that could be implemented.
But to me it would feel like a band-aid solution that lacks proper understanding of what's happening rather than fixing the actual cause. Unfortunately as far as I know there is no documentation regarding the reverse engineered API so I personally don't know where to even begin to try and attempt a proper fix.
Hi all, I've just managed to install this integration, but have encountered the "Failed to call service kia_uvo/start_charge. Invalid request body - Invalid deviceId." error message after successfully starting the charge once.
Has anyone had an ideas of how to solve this issue?
Many thanks!
David
The only way I can make it work is to reload the config entry (see last part of this script) after I sent the start charge command.
alias: Ioniq 5 Start Charging sequence:
The only way I can make it work is to reload the config entry (see last part of this script) after I sent the start charge command.
alias: Ioniq 5 Start Charging sequence:
- service: kia_uvo.start_charge data: device_id: ff0ff7d8286b819xxxxxxxxxxxxxxx
- delay: hours: 0 minutes: 0 seconds: 30 milliseconds: 0
- service: homeassistant.reload_config_entry data: {} target: device_id: ff0ff7d8286b819xxxxxxxxxxxxxxxxxxxx mode: single
Thanks so much for sharing your solution phantomsforever ☺️
Do I understand correctly that the device ID changes each time you refresh the integration? Or is it just that the integration needs to be reloaded and that the device ID stays the same?
Also, please forgive the newbie question, but to use your code, would I just add it here where I’ve put the red arrow?
Thanks so much!
David
For some reason your approach did not work for me, so I actually wrote a script and the tap action only calls the script. The device ID is always the same - basically your KIA or Hyunday
Here is the Yaml version of the script:
YES it works! Thank you so much phantomsforever! 🤩🙏
Region and Brand of car
Europe (UK), Kia (e-Niro)
Version of the integration
2.10.4
Describe the bug I know there have been issues the last few days and a flurry up updates to fix it, but I'm running the latest release and still having issues.
Last night my charging automation didn't work; the start/stop charge service calls resulted in messages such as:
This morning I enabled debug logging in the integration and restarted Home Assistant, which resulted in it taking a very long time but I'm not sure if that's expected. The startup log complains about:
However it does manage to list the vehicles and obtain the cached data OK.
Debug logs if an error occurred
When calling the
stop_charge
service:To Reproduce Call the
kia_uvo.stop_charge
(with a validdevice_id
from the web ui popup).Expected behavior Car should stop charging etc...
Screenshots n/a
Additional context