Kia Uvo Integration

I have baked a custom integration for EU Kia Uvo, this will be working for new account types. Thanks for your hard work @wcomartin

Warning ahead; this is pre-alpha phase, please do not expect something fully functional, I will improve the integration by time.

You can install this either manually copying files or using HACS. Configuration can be done on UI, you need to enter your username and password, (I know, translations are missing!).

  • it will only fetch values for the first car, I am not sure if there are people outside using Kia Uvo with multiple cars :slight_smile:
  • update - It will fetch the cached information every 30 minutes from Kia Servers.
  • force update - It will ask your car for the latest data every 2 hours.
  • It will not force update between 10PM to 6AM. I am trying to be cautious here.

UPDATE: I have been tinkering about what is the best way to find out if I had parked the car and left away. I know that while my car is working, it is constantly updating its data on the cloud, so no need to force update, BUT when I stop the engine, car is not updating itself if I do not call force update. My solution to this problem: whenever my phone disconnected to car’s bluetooth system, I am triggering a force update.

To do this;

  • enable bluetooth connected devices sensor in your mobile app for home assistant
  • get the MAC id of car’s bluetooth receiver
  • create a text helper input to store this MAC id (i had named it as kia_bt_mac)
  • create a template sensor in home assistant if phone is connected to car’s bluetooth receiver by searching MAC id
    {{ state_attr("sensor.fuat_mi_8_bluetooth_connection", "connected_paired_devices") is search(states('input_text.kia_bt_mac'), ignorecase=True)}}
  • if it gets from True to False, call service force update using automation

If you are having log in (old account type and migration) issues; please check this: https://github.com/fuatakgun/kia_uvo/issues/56

9 Likes

Thanks for creating this.
I can’t seem to find this integration in HACS when searching though, is this as expected?

try this steps;

  • go to hacs - integrations
  • click on three dots and click on custom repositories
  • put url as https://github.com/fuatakgun/kia_uvo and click on Add
  • now you can install the integration
1 Like

Yepp, worked like a charm.

No luck adding my account though…
ERROR (MainThread) [custom_components.kia_uvo.config_flow] kia_uvo Exception in kia_uvo login : 'redirectUrl'

If you are in EU, have you migrated you KIA account ?

1 Like

No, seems I had not done that. Now
I have though, but I still get the same error message.
Restarted core, still same. Rebooted HA still same

I am in EU

Then please follow these steps to enable extensive logging for the integration and you can share them over here. I remember that there was no critical data stored in the logs other than coordinates but you have not reached that point, so no critical data logged.

Here goes, I masked most values in the responses to be sure to not share anything inappropriate, how I did not mask too much…

2021-04-26 20:23:46 DEBUG (SyncWorker_1) [custom_components.kia_uvo.KiaUvoApi] kia_uvo - Get Device ID response {'retCode': 'S', 'resCode': '0000', 'resMsg': {'deviceId': '**MASKED**'}, 'msgId': '**MASKED**'}
2021-04-26 20:23:46 DEBUG (SyncWorker_1) [custom_components.kia_uvo.KiaUvoApi] kia_uvo - Get cookies {'TS012b00dd': '**MASKED**', 'account': '**MASKED**'}
2021-04-26 20:23:46 DEBUG (SyncWorker_1) [custom_components.kia_uvo.KiaUvoApi] kia_uvo - Sign In Response {'errId': '**MASKED**', 'errCode': '4003', 'errMsg': 'Invalid values', 'errBody': {'userId': '', 'remainCount': 4, 'remainTime': 300}}
2021-04-26 20:23:46 ERROR (MainThread) [custom_components.kia_uvo.config_flow] kia_uvo Exception in kia_uvo login : 'redirectUrl'

I suspect that your login credentials are invalid, please double check them. You can see the response below.

That should be next improvement to return better messages to the user.

In Response {'errId': '**MASKED**', 'errCode': '4003', 'errMsg': 'Invalid values', 'errBody': {'userId': '', 'remainCount': 4, 'remainTime': 300

Yes, could be. I purposely tried another password and got the same error which would indicate that.
However, my credentials are correctly entered, I have tripple checked then via notepad in between, and also resetted my password again just to be sure.
Thinking… Perhaps it could be a nightly sync between some internal systems or something that needs to happen, as I just migrated my account a few hours ago. In that case I guess it should work tomorrow.
Or… grasping…, the password I have is quite complex 19 characters, I don’t suppose there is a variable that only deals with lesser characters in play in your code?

It is some sort of backend sync issue. When I tried to logon using my old password before I migrated my account it worked for me…

happy to learn this

@fuatakgun thank you, working first time!

Can the distance be set to miles for the odometer and the fuel range?

G.

For me, the range comes in in miles but the odometer comes in in km. I just use a template sensor to create an odometer in miles

Yes, it was strange that kia uvo servers returns values in different units. Can one of you create an issue in github? My proposal is to render all units using home assistant metric configuration, makes sense you guys?

What about a config parameter on integration install ? Is that possible ? In the UK we still use miles…

I believe your home assistant setup is configured to use imperial which should default to miles, right? You can check them through configuration - general section

Na, I’m set to metric. All other things are metric apart from miles.in the UK

please track over here: Support configurable distance unit (km vs miles) · Issue #33 · fuatakgun/kia_uvo · GitHub