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

Kia EV6 - 12 volt battery drain #719

Open manofpants opened 1 year ago

manofpants commented 1 year ago

Not sure how to file this one...

My 6 month old EV6 was found in the morning with a 12 volt (small one, not the big pack for driving) completely dead. It had 92% when I went to sleep and it was unplugged overnight. I was able to get a jump to back it out of my garage and drive it to the dealership to look at by their EV specialist.

The specialist asked me if I had any apps or integrations that connected to the car and the only thing I had was this HA integration. The car has since held a charge in the 12v since disabling the integration.

Was the intermittent ping from HA causing the battery to drain a little bit every time it's off so that in 6 months, the wear from that killed the 12v?

freaksdotcom commented 8 months ago

The car has changed from trying to boil off the 12v battery to trying to drain it again.

HA has only requested a forced sync twice since I fixed the logging.

2023-12-19 09:00:51.235 DEBUG (SyncWorker_3) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/rems/rvs request with {'requestType': 0}
2023-12-22 16:59:29.771 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/rems/rvs request with {'requestType': 0}

All the other requests are made to https://api.owners.kia.com/apigw/v1/cmm/gvi on a 45 minute interval, which is the configured scan interval.

Is there any documentation for the API endpoints? It seems like the car is doing a forced update even when cached data is requested.

The car appears to be waking up every 90 minutes to send data, which is twice the scan interval. This behavior is inconsistent - It wasn't happening for a while with the same settings.

chart

cdnninja commented 8 months ago

No documentation just people sniffing what the app does and learning from it. It may be worth someone in the US sniffing the traffic from the app and comparing to our payloads to see if it has changed for the ev6 or not.

cdnninja commented 8 months ago

I also noticed you are USA Kia. Most users here are EU or CA from what I have seen. Potentially different behavior by region.

freaksdotcom commented 8 months ago

It looks like refreshing the login token is causing a forced sync. These are happening every 90 minutes:

2023-12-26 09:47:36.118 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Refresh token expired
2023-12-26 11:17:39.118 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Refresh token expired
2023-12-26 12:47:42.119 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Refresh token expired
2023-12-26 14:17:45.118 DEBUG (SyncWorker_2) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Refresh token expired

https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/blob/ed8476e1f27647bb4a529c0561c66953c8c767ea/hyundai_kia_connect_api/KiaUvoAPIUSA.py#L179

The value here should be set to 23 hours (as in the EU client), or better yet to the force refresh interval. https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/467

The api client should also avoid refreshing the token during the "No Force Refresh" window.

cdnninja commented 8 months ago

So you are thinking a get vehicles or login command is triggering a call to the car?

All the expiry does is trigger a login and update list of vehicles.

freaksdotcom commented 8 months ago

So you are thinking a get vehicles or login command is triggering a call to the car?

All the expiry does is trigger a login and update list of vehicles.

I'm fairly certain. The dips in voltage from the battery monitor align with the "Refresh token expired" message in the logs.

This also explains why non-US users aren't seeing the same behavior. Only the US client has a 1 hour token lifetime.

I can't find where HACS installs the hyundai_kia_connect_api library. Otherwise I'd patch my local copy to verify the behavior.

alexwhittemore commented 8 months ago

I need to double check tomorrow in more detail, but I’m in the US and don’t have that same issue - my car wakes up for a refresh only every few hours tops. I’ll have a look through and see about my login token refresh if I can to verify they don’t align.

tomhermanny commented 4 months ago

Isn't most of this discussion impacted greatly by the fact that the Kia Niro has a "12V Reset" switch? This switch will jump the 12V battery with the vehicle battery when the car won't start. Kia KNOWS the problem exists. They need to fix the EV6 once and for all. In my experience with my EV6, when the car won't run due to the low 12V battery, my battery has 12.8V when I test it with a multimeter. What more does the car need?