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

Support setting additional climate options (steeringwheel warmer, sidemirrors/rearwindowheating) #230

Open
tsfuchs opened this issue Dec 11, 2022 · 14 comments
Labels
EU Using a European vehicle Hyundai Hyundai vehicle

Comments

@tsfuchs
Copy link

tsfuchs commented Dec 11, 2022

Hi there,

I own a Hyundai Ioniq 5 and I would like to be able to control the climate settings remotely. I have analyzed the payloads of the API calls in the Bluelink app, and I have noticed the following:

  • In contrast to the current version of bluelinky, the hvacType parameter always uses the value 1, instead of 0. I am not sure what this parameter signifies, and it may vary for different vehicle models.

  • For the heating1 parameter, the following values are used depending on the settings (0 = all deactivated, 2 = side mirrors/rear window is activated, 3 = steering wheel warmer is activated, 4 = side mirrors and steering wheel warmer are activated).

I would be happy to submit a PR with changes, but it would depend on how the VehicleClimateOptions are intended to be structured in the future.

  • OS: windows
  • Bluelinky Version 7.6.6
  • Region: EU
  • Brand: hyundai
@Hacksore
Copy link
Owner

There are plans to simplify the input options in 8.x which has not yet been released.

I guess we have been thinking they are boolean flags but maybe more like an enum depending on your vehicle?

Happy to accept a PR on this.

https://bluelinky.readme.io/reference/start

@arteck
Copy link

arteck commented Dec 13, 2022

grafik

this is a simple boolean

@tsfuchs
Copy link
Author

tsfuchs commented Dec 13, 2022

grafik

this is a simple boolean

Oh wow, you‘ve found the official Hyundai api documentation? This makes our lives so much easier.
Kidding aside, the Official Bluelink App sends 0, 2, 3 or 4 to the Hyundai ioniq 5. So you are unfortunately wrong, at least this is not boolean for all cars.

@arteck
Copy link

arteck commented Dec 14, 2022

show that I want to see..

RAW data plz

@cdnninja
Copy link

cdnninja commented Dec 16, 2022

From the python side we learned that anything returned as an int from the api that appears to be a Boolean isn't. So heating and seats are examples of that. Some items return a true or false. Anything else has additional meaning.

We are using enums to map this out.

This also differs by model.

@cdnninja
Copy link

cdnninja commented Dec 17, 2022

Since I am by a PC now here is our constant file that shows what we have learned so far: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/blob/master/hyundai_kia_connect_api/const.py

@arteck
Copy link

arteck commented Dec 19, 2022

in my opinion is it only the send status from car.. not setable status... on/off
grafik

we are talking here about "turn on/off"

@cdnninja
Copy link

I can confirm as fact that for at least Canada the above is used for setting. I have it functional and tested in recent days.

Other regions waiting to hear from users if the app supports setting and someone to capture that traffic.

@cdnninja
Copy link

@tsfuchs
Copy link
Author

tsfuchs commented Dec 20, 2022

As written above, I traced the API calls the Bluelink app makes when activating steering wheel warmer and/or side mirrors/rear window. So cdnninja is definitely right that these values are not only used when reading out the vehicle status.
And I can also confirm that sending 1 for heating1 works as well for activating both even though the app sent 4 in the europe region.

@cdnninja
Copy link

@tsfuchs Could you do me a huge favor and check if your app offers this same sort of thing for heated / cooled seats? I have that implemented in canada API but not sure if offered for EU. As well if you can post what 4 means compared to my above post that would be great. I have seen a few posts lately reference 4 so would like to get the description right for it.

@tsfuchs
Copy link
Author

tsfuchs commented Dec 20, 2022

@cdnninja In the European version of Bluelink, at least for the Ioniq 5, there is no control of seat heating and ventilation. However, it is possible that the API requirements may work, but I have not tested this. There is no difference in the effect between 1 and 4 for my Ioniq 5, but the app sends the 4. It's possible that the number "1" always means that all available systems are activated, or it may only function for compatibility purposes. From what I've found, the API seems quite "grown" and doesn't seem to have been well thought out from the start, but rather just started and then more and more functions were added in different regions. It's possible that the API has evolved over time as new features and capabilities were added.

@tsfuchs
Copy link
Author

tsfuchs commented Dec 20, 2022

@arteck @cdnninja
Here the extracted payload from the eu bluelink app (ioniq5), if arteck can't believe otherwise:

[ // only AC
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": false,
            "frontWindowHeating": 0,
            "heating1": 0
        },
        "tempCode": "10H",
        "unit": "C"
    } ,
    // defrost windscreen
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": true,
            "frontWindowHeating": 0,
            "heating1": 0
        },
        "tempCode": "10H",
        "unit": "C"
    },
    // side mirrors/rear window
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": false,
            "frontWindowHeating": 0,
            "heating1": 2
        },
        "tempCode": "10H",
        "unit": "C"
    },
    // steering wheel warmer
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": false,
            "frontWindowHeating": 0,
            "heating1": 3
        },
        "tempCode": "10H",
        "unit": "C"
    },
    // defrost windscreen + side mirrors/rear window
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": true,
            "frontWindowHeating": 0,
            "heating1": 2
        },
        "tempCode": "10H",
        "unit": "C"
    },
    // defrost windscreen + steering wheel warmer
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": true,
            "frontWindowHeating": 0,
            "heating1": 3
        },
        "tempCode": "10H",
        "unit": "C"
    },
    // defrost windscreen + side mirrors/rear windows + steering wheel warmer
    {
        "action": "start",
        "deviceId": "xxx",
        "hvacType": 1,
        "options": {
            "defrost": true,
            "frontWindowHeating": 0,
            "heating1": 4
        },
        "tempCode": "10H",
        "unit": "C"
    }
]

cdnninja added a commit to Hyundai-Kia-Connect/hyundai_kia_connect_api that referenced this issue Dec 20, 2022
@Hacksore Hacksore added Hyundai Hyundai vehicle EU Using a European vehicle labels Dec 29, 2022
@cdnninja
Copy link

What I found in Canada with seats, and I assuming heating1 is that older cars only offered "Off" and "On" in app. That mapped to 0 and 1, which created the confusion we saw above as that appears to be Boolean. Later some cars were released that supported setting the seats so they released 2-8 as options. Both 0 and 2 being off which messed with our sensors as we never thought 2 was valid.

I suspect heating1 is the same. Now knowing if the newer cars accept the old values is a gamble and isn't ideal. However we never hit issues sending the older start_climate commands to newer cars, just missed out on the additional functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EU Using a European vehicle Hyundai Hyundai vehicle
Projects
None yet
Development

No branches or pull requests

4 participants