Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluelink/Hyundai - Open & Close charging door #243

Closed
beanian opened this issue Jan 11, 2022 · 21 comments
Closed

Bluelink/Hyundai - Open & Close charging door #243

beanian opened this issue Jan 11, 2022 · 21 comments
Assignees
Labels
enhancement New feature or request EU Europe Region

Comments

@beanian
Copy link

beanian commented Jan 11, 2022

Is it possible to extend the functionality of this service to support the opening & closing of the charing port door? I can perform those actions from the Bluelink app. I have an EU Hyundai Ioniq 5.

@fuatakgun
Copy link
Member

Hey, normally it is doable BUT in EU region, i needed to reverse engineer all the mobile app calls via installing the app into my phone and directly executing the commands. If you have tech knowledge, follow our wiki page to do the similar, otherwise, i have to access your car to extract exact calls and functions.

@cdnninja cdnninja added enhancement New feature or request EU Europe Region labels Jan 12, 2022
@beanian
Copy link
Author

beanian commented Jan 13, 2022

Thanks, tried following the steps to capture the traffic, however upon launching the modified Bluelink app I get a message saying "This application has been forged" and it quits.
Any ideas?

@povlhp
Copy link

povlhp commented Feb 7, 2022

Opening/closing charge port (I5/EV6)is done by calling below URL - Note the api/v2 in the URL as opposed the the other stuff on v1.

https://prd.eu-ccapi.kia.com:8080/api/v2/spa/vehicles/a0...10/control/portdoor HTTP/1.1

with Json message:

{"action":"open"}
{"action":"close"}

@fuatakgun
Copy link
Member

thanks for this, we need to modify based on v1 vs v2, you are right.

@nrfribeiro
Copy link

Hi @fuatakgun ,
Great work on this. Any plans to ad this feature, "open/close charging port"?

@cdnninja
Copy link
Collaborator

@ZuinigeRijder with the above sniffed URL would you up to implement this in EU and give it a try? Once working in the API I can extend here in UVO.

@cdnninja
Copy link
Collaborator

FYI Initial work on this in the API is here: Hyundai-Kia-Connect/hyundai_kia_connect_api#153 and needs testing.

@cdnninja
Copy link
Collaborator

cdnninja commented Dec 2, 2022

I have created a PR with a service for this. If able to test it out before I merge that would be great!

@cdnninja cdnninja assigned cdnninja and unassigned fuatakgun Dec 2, 2022
@cdnninja
Copy link
Collaborator

This has since been released in the 2.X branch. If you could test that would be awesome. I will close this in a few days if I don't hear back.

@cdnninja
Copy link
Collaborator

Anyone had a chance to test this out?

@beanian
Copy link
Author

beanian commented Dec 17, 2022

Just tested this on my Hyundai Ioniq 5 in Ireland and it does not work. When I call the service it unlocks the car and the charging port door remains closed.

@cdnninja
Copy link
Collaborator

@cdnninja
Copy link
Collaborator

Could you update in HACS from "master" and try again?

@beanian
Copy link
Author

beanian commented Dec 20, 2022

So I tried again and got this
Logger: hyundai_kia_connect_api.KiaUvoApiEU
Source: /usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py:66
First occurred: 4:49:11 PM (1 occurrences)
Last logged: 4:49:11 PM

Unknown API response format: {'error': 'Access to this API has been disallowed'}

@cdnninja
Copy link
Collaborator

Could you enable debug logs and provide those?

@beanian
Copy link
Author

beanian commented Dec 21, 2022

2022-12-21 15:47:58.152 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Charge Port Action Request: {'action': 'open', 'deviceId': 'xxxxxx-a166-4504-83ec-xxxxxxxxx'} 2022-12-21 15:47:58.153 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - get_stamp 2022-12-21 13:02:53.523000+00:00 120000 82 998 82.53858847500001 2022-12-21 15:47:58.764 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Charge Port Action Response: {'error': 'Access to this API has been disallowed'} 2022-12-21 15:47:58.765 ERROR (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoApiEU] Unknown API response format: {'error': 'Access to this API has been disallowed'} 2022-12-21 15:47:58.777 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/config/custom_components/kia_uvo/services.py", line 90, in async_handle_open_charge_port await coordinator.async_open_charge_port(vehicle_id) File "/config/custom_components/kia_uvo/coordinator.py", line 174, in async_open_charge_port await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 126, in open_charge_port return self.api.charge_port_action(self.token, self.get_vehicle(vehicle_id), CHARGE_PORT_ACTION.OPEN) File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 565, in charge_port_action _check_response_for_errors(response) File "/usr/local/lib/python3.10/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 67, in _check_response_for_errors raise InvalidAPIResponseError() hyundai_kia_connect_api.exceptions.InvalidAPIResponseError

@cdnninja
Copy link
Collaborator

Unfortunately not alot for me to go on. Looks like we are sending the correct command but something isn't correct. I assume this works fine in your mobile app? @povlhp are you able to test it out and compare payloads?

@tmjo
Copy link

tmjo commented Mar 20, 2024

I came here to look for this feature. Any news or status? I notice that my Bluelink app asks for biometrics to allow opening the charging port, can that be related?

@cdnninja
Copy link
Collaborator

Code was created but no one has tested it. Hyundai-Kia-Connect/hyundai_kia_connect_api#506

Could you test?

@tmjo
Copy link

tmjo commented Mar 28, 2024

Code was created but no one has tested it. Hyundai-Kia-Connect/hyundai_kia_connect_api#506

Could you test?

Ah, cool! I'll test it. Currently away from home for some weeks, but I'll test it when I get back home!

@tmjo
Copy link

tmjo commented May 28, 2024

Code was created but no one has tested it. Hyundai-Kia-Connect/hyundai_kia_connect_api#506
Could you test?

Ah, cool! I'll test it. Currently away from home for some weeks, but I'll test it when I get back home!

Hi again! Sorry for the delay here, I was away for a month and then forgot it for another month :) Finally remembered to test this feature on my Hyundai Ioniq 5 (2023, EU-model if it matters) and can confirm that both opening and closing charge port works perfectly fine.

Thanks for this feature! It particularly comes in handy when I forget to plug in my car and later walk out to the garage just to realize I didn't grab the keys with me. Lot's of forgetting, I know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request EU Europe Region
Projects
None yet
Development

No branches or pull requests

6 participants