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

Remote Climate Start Not Functional for IONIQ BEVs #369

Closed
kermitageo opened this issue Jul 27, 2023 · 13 comments
Closed

Remote Climate Start Not Functional for IONIQ BEVs #369

kermitageo opened this issue Jul 27, 2023 · 13 comments

Comments

@kermitageo
Copy link

Hi, I am unable to get remote climate start to function with an IONIQ 5/6 vehicle.

climateOpts = ClimateRequestOptions(set_temp="72")
vm.start_climate(vehicle_id="XYZ",options=climateOpts)

Response:

hyundai_kia_connect_api - Start engine response: {"errorSubCode":"GEN","systemName":"BLODS","errorSubMessage":"Feature Status is OFF","errorMessage":"Your vehicle does not support this feature.","errorCode":502}

It seems that these vehicles may use a different API endpoint for remote starting vs. those seen in HyundaiBlueLinkAPIUSA.py

# this URL is not correct - what is it?
url = self.API_URL + "rcs/rsc/start"

Has there been any research done into which endpoints these vehicles use so they can be supported here? Thanks!

@cdnninja
Copy link
Collaborator

Not so far. Someone in the USA with one of these cars will need to sniff the traffic.

We don't have any regular devs in the USA. Just in Canada and eu.

@kermitageo
Copy link
Author

Whoops, accidental close.

Looks like this is the same issue as

Hyundai-Kia-Connect/kia_uvo#400
&&
Hacksore/bluelinky#221

@TaiPhamD
Copy link

Not so far. Someone in the USA with one of these cars will need to sniff the traffic.

We don't have any regular devs in the USA. Just in Canada and eu.

I have this car and would like a suggestion on how to snoop the traffic. Previously, I had my own api working against this endpoint: https://owners.hyundaiusa.com/bin/common/remoteAction. however , the ability to get the auth token for that endpoint is not working anymore as their web login requires passing google captcha: https://owners.hyundaiusa.com/us/en/login.html

I would love to see if we can use the Oauth login from: https://api.telematics.hyundaiusa.com/ac/v2/rcs/rsc/start to make it work with Ioniq5 and newer vehicles.

@cdnninja
Copy link
Collaborator

nox plus charles web proxy works for the android app. The android app I think is a different API in the US than the website.

Once your sniff that endpoint it is most likely quick to update the code to support both ICE and the EV approach.

@TaiPhamD
Copy link

TaiPhamD commented Oct 17, 2023

@cdnninja did you have to do anything special with the NOX and charles proxy setup? I can't get the MyHyundai app to go through my charles ssl proxy since the ssl chain keeps on breaking. I enabled root in NOX android 12 and added charles CA cert into the android's system CA (/system/etc/security/cacerts/) but it's still not happy. I even tried to decompile the APK and edited res/xml/network-security-config .xml to allow trusting both user and system CA but that didn't help either. Thanks.

@cdnninja
Copy link
Collaborator

Each region is different. Sounds like you did the steps I have done for other regions. You could try Android 6. Some don't like rooted devices as well.

@cdnninja
Copy link
Collaborator

To confirm the web browser in nox is working for ssl sites? Just to prove your config out.

@TaiPhamD
Copy link

To confirm the web browser in nox is working for ssl sites? Just to prove your config out.

yes see here:
image

@zphaze
Copy link
Contributor

zphaze commented Oct 22, 2023

Unsure if it’s helpful but I was able to sniff traffic from the iOS app last month and could do more if necessary. The information is posted in this issue Hyundai-Kia-Connect/kia_uvo#400

@TaiPhamD
Copy link

Unsure if it’s helpful but I was able to sniff traffic from the iOS app last month and could do more if necessary. The information is posted in this issue Hyundai-Kia-Connect/kia_uvo#400

This is exactly what I needed. The endpoint is simply different for ioniq 5: /ac/v2/evc/fatc/start and using this I was able to start the climate control. Do you have payload for stopping climate control as well?

@cdnninja
Copy link
Collaborator

cdnninja commented Oct 22, 2023

@zphaze oops I missed you response. This part will need a PR generated.

def start_climate(
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
) -> str:
_LOGGER.debug(f"{DOMAIN} - Start engine..")
url = self.API_URL + "rcs/rsc/start"
headers = self._get_vehicle_headers(token, vehicle)
_LOGGER.debug(f"{DOMAIN} - Start engine headers: {headers}")
if options.climate is None:
options.climate = True
if options.set_temp is None:
options.set_temp = 70
if options.duration is None:
options.duration = 5
if options.heating is None:
options.heating = 0
if options.defrost is None:
options.defrost = False
if options.front_left_seat is None:
options.front_left_seat = 0
if options.front_right_seat is None:
options.front_right_seat = 0
if options.rear_left_seat is None:
options.rear_left_seat = 0
if options.rear_right_seat is None:
options.rear_right_seat = 0
data = {
"Ims": 0,
"airCtrl": int(options.climate),
"airTemp": {"unit": 1, "value": options.set_temp},
"defrost": options.defrost,
"heating1": int(options.heating),
"igniOnDuration": options.duration,
"seatHeaterVentInfo": {
"drvSeatHeatState": options.front_left_seat,
"astSeatHeatState": options.front_right_seat,
"rlSeatHeatState": options.rear_left_seat,
"rrSeatHeatState": options.rear_right_seat,
},
"username": token.username,
"vin": vehicle.id,
}
_LOGGER.debug(f"{DOMAIN} - Start engine data: {data}")
response = self.sessions.post(url, json=data, headers=headers)
_LOGGER.debug(
f"{DOMAIN} - Start engine response status code: {response.status_code}"
)
_LOGGER.debug(f"{DOMAIN} - Start engine response: {response.text}")

Assuming that code still works for non electric vehicles if statements are key for any changed portion such as the endpoint. I don't own a Kia anymore so can't say I keep up with this repo like I used to.

@zphaze
Copy link
Contributor

zphaze commented Oct 22, 2023

@TaiPhamD Here is the Stop Command

POST /ac/v2/evc/fatc/stop HTTP/1.1
Host: [api.telematics.hyundaiusa.com](http://api.telematics.hyundaiusa.com/)
deviceId: …
Accept: */*
deviceMeid: …
Accept-Encoding: gzip, deflate, br
Location: ..
Content-Length: 2
User-Agent: MyHyundai/5.1.5 (iPhone; iOS 17.0.3; Scale/3.00)
deviceName: iPhone
gen: 2
Cookie: …
Version: 1.4.7
registrationId: …
osVersion: 17.0.3
from: SPA
access_token: …
brandIndicator: H
Accept-Language: en-US;q=1
NADID: …
requestId: 60
username: …
Featureusage_time: 2023-10-22T14:26:57Z
Client_Id: …
vin: …
Offset: -7
Connection: keep-alive
Content-Type: application/json
osType: iOS
APPCLOUD-VIN: …
appVersion: 5.1.5
Language: 0
To: ISS
appType: MyHyundai
{}

@TaiPhamD
Copy link

@zphaze thank you. I finally managed to do the SSL proxy decoding myself on iOS and its much easier. For some reason my android emulator did not work well at all compare to iOS. I can get all the api myself now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants