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
398 stars 84 forks source link

Ability to delete a Vehicle/Device #763

Open SteveDockar opened 8 months ago

SteveDockar commented 8 months ago

Is your feature request related to a problem? Please describe. Following the discussion in Discussions/728 there is currently no way to delete a vehicle/device which is not required to be included in the integration.

Describe the solution you'd like Within the integration there should be an ability to delete a vehicle/HASS Device if it is not required. At present the integration creates devices in Home Assistant for every vehicle present in the Connect Account but this may not be the required behavior so the user should be able to select which Connect account vehicles should be included, or, be able to delete ones which are already present but which are not required.

The remove/delete vehicle functionality should also be able to remove (with user confirmation) existing vehicles/devices from the integration which are no longer found in the Connect account (e.g when a vehicle is removed from the account before being sold).

Describe alternatives you've considered At present, the only alternative to removing vehicles which are no longer present on the Connect account it to remove/re-install the integration, but this does not solve the issue of vehicles which are present on the Connect account but are not required in the Integration for which I do not believe there is a direct alternative. Vehicles/devices can be disabled in Home Assistant but this only removes them and their entities from some views/lists so is not a complete solution.

Additional context Add any other context or screenshots about the feature request here. See discussion in Discussions/728.

cdnninja commented 8 months ago

Are you able to enable the API debug and check if it lists both cars? Main readme at the bottom shows how to enable debug for the API.

SteveDockar commented 7 months ago

Are you able to enable the API debug and check if it lists both cars? Main readme at the bottom shows how to enable debug for the API.

Sorry, I was away for a while but have just had chance to enable debugging. Here's the result of the Get Vehicles call. I've trimmed some of the noise to make it easier to read, but the "vehicles" JSON object looks to be an array with two members, one for each of the current vehicles.

2023-12-08 15:41:13.104 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Get Vehicles Response: {'retCode': 'S', 'resCode': '0000', 'resMsg': {'vehicles': [{'vin': 'VIN-WAS-HERE', 'vehicleId': 'VEHICLE-GUID-HERE', 'vehicleName': 'EV6','detailInfo': {}, {'vin': 'VIN-WAS-HERE', 'vehicleId': 'VEHICLE-GUID-HERE', 'vehicleName': 'Soul', 'detailInfo': {}]}, 'msgId': '418d97b1-5856-4796-87ea-20f3acba1a42'}

We still have two Kia vehicles, but the EV6 is a very recent arrival so the Integration is currently showing the four "devices" which have been on (and off) the account since it was installed, but is only receiving data from the two vehicles which are currently attached to the Connect account.

cdnninja commented 7 months ago

So the integration is pulling correct data.

To confirm you tried to remove the vehicle from HA and it didn't work? Ignore this being zigbee but same should apply:

image

SteveDockar commented 7 months ago

That's correct, the integration appears to be pulling the correct data.

I don't see any options to delete at the Device level (at least in the GUI). The Device Info panel for the Integration just shows this: image and the link takes me back to the integration itself. Unless I'm missing something really obvious (which is definitely possible) I don't see any option to remove the redundant HA devices on any of their views. The edit "pencil" shows the usual device metadata for name and area, but nothing that helps me get rid of it (other than the disable option I've used so up to now).

fuatakgun commented 7 months ago

@cdnninja as of now, we are not supporting this, i have recently learnt too

SteveDockar commented 7 months ago

@cdnninja as of now, we are not supporting this, i have recently learnt too

Apologies both, I thought @cdnninja's questions were connected to @fuatakgun's request for me to raise this following the discussion in the other thread. If nothing else, I learned how to enable the logger and just how much info comes back in those API calls. 😁