kia_uvo icon indicating copy to clipboard operation
kia_uvo copied to clipboard

Missing controls in ioniq 5 in Europe

Open rahulpdev opened this issue 2 years ago • 31 comments

Recently installed the integration and cannot see the start climate or open charging door controls in HA. Screenshot_2022-12-20-02-51-06-34

rahulpdev avatar Dec 20 '22 02:12 rahulpdev

These are in the developer menu under service.

cdnninja avatar Dec 20 '22 03:12 cdnninja

That's one of my open questions too @cdnninja. Is the reason for this the programming effort to show these services here depending on the vehicle functions?

4homeassistant avatar Dec 20 '22 13:12 4homeassistant

That's one of my open questions too @cdnninja. Is the reason for this the programming effort to show these services here depending on the vehicle functions?

I must have missed that. Home assistant offers only select entities. Many of those entities don't allow control. Only ones with control are items like "lock". Remote start isn't one of them. As such services are how we expose this.

You can add a button to the dashboard manually that calls the service but I don't know of a way to do it on my side.

cdnninja avatar Dec 20 '22 14:12 cdnninja

There must be a way to archieve this somehow in HA. Look at the device defaults from Volvo V60 Recharge and Fiat 500e: image image

4homeassistant avatar Dec 20 '22 14:12 4homeassistant

Thanks for posting! I will look at that code.

Switch entities are an option for sure. However I haven't seen anything that prompts for all the options start_climate needs.

cdnninja avatar Dec 20 '22 14:12 cdnninja

Could I get more details on which integrations these are? The native home assistant volvo one doesn't seem to have this atleast not easily seen in the code, documentation also makes no reference to it.

As for fiat https://github.com/wubbl0rz/FiatChamp isn't an integration but rather a add on.

cdnninja avatar Dec 20 '22 16:12 cdnninja

@cdnninja you closed my post and tagged me here but I can't still find the answer. Why can I see all the controls of Kia Seltos 2023?

MrPresident2 avatar Dec 21 '22 10:12 MrPresident2

Have you looked in the developer services menu?

cdnninja avatar Dec 21 '22 15:12 cdnninja

Sorry it's German but open the developer tools menu, go to 'services' and type 'hyundai'. You will see a list of all available services. If you don't know how to call a service, Google for it. That's what I did so far to at least enable a button in Lovelace to call that service.

image

4homeassistant avatar Dec 21 '22 22:12 4homeassistant

I do have it under services but the call service option is blacked and I can't call the service image

MrPresident2 avatar Dec 21 '22 22:12 MrPresident2

Right now "heating" is required. I have seen it where home assistant knows this but doesn't bother to put it in even though off is selected. Check the yaml to see if heating is so to 0 or not. Call service button may still work even though grey.

cdnninja avatar Dec 21 '22 23:12 cdnninja

@cdnninja is right. Just tried it and 'Call Service' was grey in my HA too but it works anyway. Heating in the car started.

4homeassistant avatar Dec 21 '22 23:12 4homeassistant

It is still gray and I'm getting failed to call Kia climate unknown error

MrPresident2 avatar Dec 22 '22 06:12 MrPresident2

What do the logs say?

cdnninja avatar Dec 22 '22 14:12 cdnninja

I see some issues: service "unlock" ist working, service "open_charge_port" not. The corresponding log entry is

2022-12-22 20:01:13.141 ERROR (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoApiEU] Unknown API response format: {'error': 'Access to this API has been disallowed'}

4homeassistant avatar Dec 22 '22 19:12 4homeassistant

We have an open issue for charge port as that is a brand new feature: https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/243. I think we are close on it but unfortunately I can't proceed without more detailed comparison.

For unlock I am not sure if typo but if not working can you open an issue for this? As a reminder unlock typically relocks the car shortly after so please watch the car to confirm it didn't work.

cdnninja avatar Dec 22 '22 19:12 cdnninja

We have an open issue for charge port as that is a brand new feature: #243. I think we are close on it but unfortunately I can't proceed without more detailed comparison.

For unlock I am not sure if typo but if not working can you open an issue for this? As a reminder unlock typically relocks the car shortly after so please watch the car to confirm it didn't work.

Unlock is working. Just wanted to compare the behaviour of both services before I post. Is there anything else I can check for you on the Ioniq 5 oder Kona EV?

4homeassistant avatar Dec 22 '22 22:12 4homeassistant

Not that I am aware of. Let me know if you see any data in the "Data" sensors attributes that you would like to see as a sensor but otherwise I will keep plugging away on other issues. New issues are ideal for new items so I can track them.

cdnninja avatar Dec 22 '22 22:12 cdnninja

I am fine @cdnninja. If you see any chance to get the services as "controls" as the thread starter mentioned that would be great but I assume there are a lot other relevant things to do.

Just tried to write a service button in the entities card that performs an action depending on the state but honestly I am not talented enough...

  - service: >
      {% if is_state('binary_sensor.ioniq_5_air_conditioner', 'off') %}
        kia_uvo.start_climate
      {% else %}
        kia_uvo.stop_climate
      {% endif %}
    data:
      device_id: 60843a78a5a7856d1c1dc8f14dc79d39

4homeassistant avatar Dec 23 '22 13:12 4homeassistant

The only ones I would consider exposing as buttons within the integration are ones we can truly do justice to. start_climate requires settings which I don't know of a way to offer easily in the main screen.

Our key options for interaction are: Button: https://developers.home-assistant.io/docs/core/entity/button Select: https://developers.home-assistant.io/docs/core/entity/select Number: https://developers.home-assistant.io/docs/core/entity/number (used for charge limits) Cover: https://developers.home-assistant.io/docs/core/entity/cover Lock: https://developers.home-assistant.io/docs/core/entity/lock (already used) Switch; https://developers.home-assistant.io/docs/core/entity/switch

Lock and number already implemented. Button not having the functionality for start_climate. I could use it for force update or cached update, or potentially start/stop charge. Cover making sense for open close of the charge port but I don't think that feature works yet. Switch may be a good use for charging?

Thoughts on what would be useful? I am also trying to be careful on how much we add to this integration as our list is getting long already and seems to grow by the month so want to make sure we don't bloat it too much.

cdnninja avatar Dec 28 '22 17:12 cdnninja

Sorry for annoying questions but can you only use ONE key option per integration? Charge port may be a good idea but to be honest: if I want to plug/unplug the car I have to get to the car physically and can open it with the key or close it with the button in the charge port. Given that and considering that it only works with Ioniq 5 and EV6 I'd rather focus on stability. Start/stop charge has more potential to bring value (whereas I use the chargers API to to that).

4homeassistant avatar Dec 31 '22 16:12 4homeassistant

I meant those are just the relevant types. Any or all can be done just with time.

cdnninja avatar Dec 31 '22 16:12 cdnninja

Happy New Year @cdnninja :-) Based on your thoughts I would just go for these controls: Button: deep refresh Button: cache refresh (service does not seem to work on both of our Hyundai cars) Is it possible to present a button action according to its state? E.g. have a button "Start charging" when the current state is "Stop charging" and vice versa? And start climate would be pretty useful as a button with the given settings. I had a look at the plenty services settings the integration exposes. How is the native app handling this? In the app UI I do set and store all parameters. Then, to activate it there's just a single button. What would the service do when you just start climate without any further settings? Would it activate everything that's been set with the native app? Where are these settings saved? On their cloud infrastructure or locally in the app?

4homeassistant avatar Jan 03 '23 23:01 4homeassistant

I don't think buttons can be state based, switches can though and are intended for state items. As for storing parameters I think that is stored in app and not on server side. Also could depend on region as this supports multiple APIs.

cdnninja avatar Jan 23 '23 01:01 cdnninja

    await coordinator.async_start_charge(vehicle_id)
  File "/config/custom_components/kia_uvo/coordinator.py", line 212, in async_start_charge
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/VehicleManager.py", line 148, in start_charge
    return self.api.start_charge(self.token, self.get_vehicle(vehicle_id))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 848, in start_charge
    _check_response_for_errors(response)
  File "/usr/local/lib/python3.11/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 113, in _check_response_for_errors
    raise error_code_mapping[response["resCode"]](response["resMsg"])
hyundai_kia_connect_api.exceptions.DeviceIDError: Invalid request body - Invalid deviceId. ```

 thats what i get on start charge for me a start and stop charging capibility is a must with my automated panels and charger and home battery storage.

rchiileea avatar Aug 02 '23 18:08 rchiileea

@rchiileea you are on latest version right?

fuatakgun avatar Aug 02 '23 18:08 fuatakgun

Yea just re-downloaded to check

rchiileea avatar Aug 02 '23 19:08 rchiileea

OK so more info on this, I have tried all the versions, errors still happening, if I delete the the intergration the first call service I try works (only been testing on lock and unlock so far) will test the charge when next plugged in.

What I have figured out is if I say call service to unlock the car it will unlock, if Ithen call service to lock the car I have to reload the integration to be able to call service to lock the car (its the same vise versa and I presume once plugged in to charge it will be the same again. for the call service to start and stop charge will need a reload of the integration in between.

rchiileea avatar Aug 03 '23 07:08 rchiileea

Based on your error this is tracked separately and occurs when a push notification is sent. Logins are invalidated. It's a new issue.

cdnninja avatar Aug 05 '23 02:08 cdnninja

Based on your error this is tracked separately and occurs when a push notification is sent. Logins are invalidated. It's a new issue.

I known issue?

rchiileea avatar Aug 06 '23 06:08 rchiileea