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
427 stars 85 forks source link

2019 Hyundai Kona EV calling wrong start_climate method #214

Closed Kevr0n228 closed 2 years ago

Kevr0n228 commented 2 years ago

I just updated to v1.26 after working with @cdnninja to get climate working in Hyundai EVs and it working after taking the update. I did some poking around in the code and was able to determine that it was calling start_climate instead of start_climate_ev as a result of this check on line 195 of Vehicle.py not evaluating to true:

if self.engine_type == VEHICLE_ENGINE_TYPE.EV and self.region == REGION_CANADA:

it seems that self.region does not equal REGION_CANADA ("Canada"), and from what I could tell it isn't even a string. Printing it out with _LOGGER.debug errored out saying it was an int, and when cast to a string it evaluated to '2' - possibly related to REGION_CANADA's position in the REGIONS dictionary? I solved it for myself by commenting out part of the condition that checks the region, but I couldn't come up with a proper fix for everyone else.

cdnninja commented 2 years ago

What region are you in? Assuming not Canada you should have it running start_climate and never start_climate_ev. Currently only Canada needs a separate EV command. This is probably something we could clean up to make more clear.

You are correct in that neither of those values are a string but rather a number.

cdnninja commented 2 years ago

Before commenting out what error or issue were you seeing?

Kevr0n228 commented 2 years ago

I am in Canada - sorry for not including that in the first post.

zadigre commented 2 years ago

I have a 2021 Kona Electric. Climate is not starting with the climate_start service. all other sensors/services (like door unlock/lock) seem to work fine. I'm also in Canada.

I'm not confortable editing the python file directly. So I guess I'll wait for the next update that may include a fix.

cdnninja commented 2 years ago

@Kevr0n228 are you able to test out #216?

Kevr0n228 commented 2 years ago

@cdnninja - tested #216, start_climate_ev and stop_climate worked as expected. Thanks for the fix!

cdnninja commented 2 years ago

@zadigre if you reload in HACS from "master" it will work now. Other option is a new release number will come out Wednesday.

zadigre commented 2 years ago

@cdnninja confirmed working fine on "master".

thank you!

zadigre commented 2 years ago

@cdnninja although it's working fine to start climate, when I use the "stop climate" service, it doesn't stop the defrost (yes confirmed in my car... front defrost still enabled and running)... but Air Conditionner, Steering Wheel Heater and Back Window Heater are stopped properly.

is this a bug in the integration or it's just the way it is for my car/Bluelink?

to make the defroster stop, I had to run start climate with "Defroster: False" and then run stop climate service.

cdnninja commented 2 years ago

@zadigre could you test with the app to see if you get the same thing? The command we currently send doesn't specify what to turn off just a general off command. Maybe we can specify though.

zadigre commented 2 years ago

@cdnninja I saw the other thread that said 1 out of 10 times, front defrost does not disable itself in the app when stopping climate. And yes I see the same behaviour in the app (I never experienced this before because I never had to turn off climate.

that said, starting climate is a little bit buggy with my car/Bluelink... I have to enable defrost to get it to start without any error in the app. Others on Reddit have said they experienced the exact same thing. So I guess the stop problem might be related to this same issue.

cdnninja commented 2 years ago

@zadigre good to know this isn't our implementation.

cdnninja commented 2 years ago

I am going to close this again as it looks like the OP's issue is solved.