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

Integration regularly flatlines #722

Closed alexwhittemore closed 10 months ago

alexwhittemore commented 1 year ago

Please check Services, Known Bug / Issues and Troubleshooting over here first: https://github.com/fuatakgun/kia_uvo/blob/master/README.md Region and Brand of car North American Kia EV6

Version of the integration 2.14.1

Describe the bug NOTE: I have not tried to uninstall/reinstall the integration as I'm afraid of negatively impacting entity history or having new entity names going forward or something that don't match up. If someone can explain the proper procedure for reinstalling without losing any data continuity, I'm happy to try that first.

It seems that every so often, after a few days of continuous normal operation, the integration stops updating entities. That is, the logbook just stops showing new data, entities don't contain new data, and so on. For instance, on the following plot of a few entities: image there are two such "dropouts." The start of the first, about 36 hours, is highlighted at 9/17, 7:50pm. The start of the second is slightly after noon on 9/20.

Both of these "dropouts" recovered by restarting the integration in Settings>Devices and Services>Hyundai/Kia Connect>...>Reload.

Immediately on reload, fresh data came in accurately reflecting the state of the car.

The dropouts also seem to be preceded by a gap in recorded history data on the graph above. Notice the slight opening in the line 9/17 at 7:18pm and also 9/20 12:13pm. I'm not sure what the difference is to home assistant between data not changing and data dropping out, but that seems significant.

Debug logs if an error occurred

I'm still not sure if I know what I'm doing collecting logs, but this error below seems to closely precede the dropouts. Oddly, it seems to happen a few minutes BEFORE the most recent data in each case:

Logger: custom_components.kia_uvo.coordinator
Source: helpers/update_coordinator.py:235
Integration: Hyundai / Kia Connect ([documentation](https://github.com/fuatakgun/kia_uvo), [issues](https://github.com/fuatakgun/kia_uvo/issues))
First occurred: September 14, 2023 at 12:19:56 AM (3 occurrences)
Last logged: September 20, 2023 at 12:31:30 PM

Error requesting kia_uvo data:
Error requesting kia_uvo data: HTTPSConnectionPool(host='api.owners.kia.com', port=443): Max retries exceeded with url: /apigw/v1/prof/authUser (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f176432c210>: Failed to establish a new connection: [Errno -3] Try again'))
Timeout fetching kia_uvo data

What's especially odd is that, if I'm reading this right, it sure looks like the integration is successfully fetching API data after the start of the "dropout", but maybe not continuously. For instance, this is from 15:45, a few hours after the last fresh data before the second dropout. On quick review, the data looks unchanged from "last fresh".

2023-09-20 15:45:29.577 DEBUG (SyncWorker_4) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"7af11c3d-31dc-47c2-8006-2651e29e875e","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDC4DLC8N5032218","trim":{"modelYear":"2022","salesModelCode":"N5462","optionGroupCode":"014","modelName":"EV6","factoryCode":"AS","projectCode":"CV","trimName":"GT-LINE","driveType":"2","transmissionType":"1","ivrCategory":"10","btSeriesCode":"Y"},"telematics":1,"mileage":"16089","mileageSyncDate":"20230920061145","exteriorColor":"RUNWAY RED","exteriorColorCode":"CR5","fuelType":4,"invDealerCode":"CA313","testVehicle":"0","supportedApps":[{"appType":"0"},{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"activationType":2},"images":[{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"CVEV.USA.S5W_M.V010.003.230526","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true},"versionNum":"ECO","headUnitType":"0","hdRadio":"X40HAF","ampType":"NA","headUnitName":"avn5em","bluetoothRef":"20","headUnitDesc":"AVN5.0W"}},"maintenance":{"nextServiceMile":7911,"maintenanceSchedule":[8000,16000,24000,32000,40000,48000,56000,64000,72000,80000,88000,96000]},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"My EV6","preferredDealer":"CA313","licensePlate":"","psi":"","customerType":0,"enrollment":{"provStatus":"4","enrollmentStatus":"1","enrollmentType":"0","registrationDate":"20220310","expirationDate":"20230310","expirationMileage":"100000","freeServiceDate":{"startDate":"20220310","endDate":"20230310"},"evEnrollmentCode":"7ZMW77Q8"},"activeDTC":{"dtcActiveCount":"0"},"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20230920224529","offset":-7},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":77,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":28,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":130,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":15,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}],"syncDate":{"utc":"20230920201145","offset":-7},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20230920224529","offset":-7},"syncDate":{"utc":"20230920201145","offset":-7},"batteryStatus":{"stateOfCharge":93,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0}}},"location":{"coord":{"lat":33.88896111,"lon":-118.3626833333,"alt":0,"type":0,"altdo":0},"head":87,"speed":{"value":0,"unit":1},"accuracy":{"hdop":7,"pdop":12},"syncDate":{"utc":"20230920201145","offset":-7}},"financed":true,"financeRegistered":false,"linkStatus":0,"rsaStatus":0}}]}}
2023-09-20 15:45:29.582 DEBUG (SyncWorker_4) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230920201145
2023-09-20 15:45:29.582 DEBUG (SyncWorker_4) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-20 20:11:45+00:00
2023-09-20 15:45:29.582 DEBUG (SyncWorker_4) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230920201145
2023-09-20 15:45:29.583 DEBUG (SyncWorker_4) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-20 20:11:45+00:00
2023-09-20 15:45:29.874 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 0.919 seconds (success: True)
2023-09-20 15:55:29.955 DEBUG (SyncWorker_3) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Time differential in seconds: 9824.955833
2023-09-20 15:55:29.956 DEBUG (SyncWorker_3) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['7af11c3d-31dc-47c2-8006-2651e29e875e']}

I wanted to see the most recent API data before I reloaded the integration at 9/21 1:28pm, which seems to be this entry from the day before, 9/20 at 17:56. That would have been about the time I started the car to drive home from work.

So it's as if the error above happens, then the next time the API data changes, the integration permanently fails to actually store the new data.  

2023-09-20 17:56:14.510 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"ca10a050-a057-48d0-9f32-85cb71f1bc1d","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDC4DLC8N5032218","trim":{"modelYear":"2022","salesModelCode":"N5462","optionGroupCode":"014","modelName":"EV6","factoryCode":"AS","projectCode":"CV","trimName":"GT-LINE","driveType":"2","transmissionType":"1","ivrCategory":"10","btSeriesCode":"Y"},"telematics":1,"mileage":"16089","mileageSyncDate":"20230920101857","exteriorColor":"RUNWAY RED","exteriorColorCode":"CR5","fuelType":4,"invDealerCode":"CA313","testVehicle":"0","supportedApps":[{"appType":"0"},{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"activationType":2},"images":[{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"CVEV.USA.S5W_M.V010.003.230526","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true},"versionNum":"ECO","headUnitType":"0","hdRadio":"X40HAF","ampType":"NA","headUnitName":"avn5em","bluetoothRef":"20","headUnitDesc":"AVN5.0W"}},"maintenance":{"nextServiceMile":7911,"maintenanceSchedule":[8000,16000,24000,32000,40000,48000,56000,64000,72000,80000,88000,96000]},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"My EV6","preferredDealer":"CA313","licensePlate":"","psi":"","customerType":0,"enrollment":{"provStatus":"4","enrollmentStatus":"1","enrollmentType":"0","registrationDate":"20220310","expirationDate":"20230310","expirationMileage":"100000","freeServiceDate":{"startDate":"20220310","endDate":"20230310"},"evEnrollmentCode":"7ZMW77Q8"},"activeDTC":{"dtcActiveCount":"0"},"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20230921005614","offset":-7},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":77,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":28,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":130,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":15,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}],"syncDate":{"utc":"20230921001857","offset":-7},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":232,"unit":3},"totalAvailableRange":{"value":232,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20230921005614","offset":-7},"syncDate":{"utc":"20230921001857","offset":-7},"batteryStatus":{"stateOfCharge":93,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0}}},"location":{"coord":{"lat":33.88896111,"lon":-118.3626833333,"alt":0,"type":0,"altdo":0},"head":87,"speed":{"value":0,"unit":1},"accuracy":{"hdop":8,"pdop":13},"syncDate":{"utc":"20230921001857","offset":-7}},"financed":true,"financeRegistered":false,"linkStatus":0,"rsaStatus":0}}]}}
2023-09-20 17:56:14.515 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230921001857
2023-09-20 17:56:14.516 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-21 00:18:57+00:00
2023-09-20 17:56:14.516 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230921001857
2023-09-20 17:56:14.517 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-21 00:18:57+00:00
2023-09-21 13:28:40.790 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Sign In Response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"}}
2023-09-21 13:28:40.790 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoAPIUSA] got session id 85fd46bf-fe0d-4636-84d0-92c5ae0c916a
2023-09-21 13:28:41.145 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Get Vehicles Response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleSummary":[{"vin":"KNDC4DLC8N5032218","vehicleIdentifier":"032218","modelName":"EV6","modelYear":"2022","nickName":"My EV6","generation":2,"extColorCode":"CR5","trim":"GT-LINE","imagePath":{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}},"enrollmentStatus":1,"fatcAvailable":1,"telematicsUnit":1,"fuelType":4,"colorName":"RUNWAY RED","activationType":2,"mileage":"16117","dealerCode":"CA313","mobileStore":[{"osType":0,"downloadURL":"https://itunes.apple.com/us/app/kia-access-with-uvo-link/id1280548773?mt=8","image":{"imageName":"iosImage.png","imagePath":"/content/dam/kia/us/owners/image/common/app/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}},{"osType":1,"downloadURL":"https://play.google.com/store/apps/details?id=com.myuvo.link","image":{"imageName":"androidImage.png","imagePath":"/content/dam/kia/us/owners/image/common/app/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"supportedApp":{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}},"licensePlate":"","psi":"","supportAdditionalDriver":1,"customerType":0,"projectCode":"CV","headUnitDesc":"AVN5.0W","provStatus":"4","enrollmentSuppressionType":0,"rsaStatus":0,"dsEnrollment":0,"ubiEnrollment":0,"notificationCount":0,"vehicleKey":"f0372e6d-74a7-4a7b-b32e-e174082d4c19"}],"chatbotSupport":true}}
2023-09-21 13:28:41.150 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['f0372e6d-74a7-4a7b-b32e-e174082d4c19']}
2023-09-21 13:28:41.518 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"f0372e6d-74a7-4a7b-b32e-e174082d4c19","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDC4DLC8N5032218","trim":{"modelYear":"2022","salesModelCode":"N5462","optionGroupCode":"014","modelName":"EV6","factoryCode":"AS","projectCode":"CV","trimName":"GT-LINE","driveType":"2","transmissionType":"1","ivrCategory":"10","btSeriesCode":"Y"},"telematics":1,"mileage":"16117","mileageSyncDate":"20230921060229","exteriorColor":"RUNWAY RED","exteriorColorCode":"CR5","fuelType":4,"invDealerCode":"CA313","testVehicle":"0","supportedApps":[{"appType":"0"},{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"activationType":2},"images":[{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"CVEV.USA.S5W_M.V010.003.230526","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true},"versionNum":"ECO","headUnitType":"0","hdRadio":"X40HAF","ampType":"NA","headUnitName":"avn5em","bluetoothRef":"20","headUnitDesc":"AVN5.0W"}},"maintenance":{"nextServiceMile":7882.8,"maintenanceSchedule":[8000,16000,24000,32000,40000,48000,56000,64000,72000,80000,88000,96000]},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"My EV6","preferredDealer":"CA313","licensePlate":"","psi":"","customerType":0,"enrollment":{"provStatus":"4","enrollmentStatus":"1","enrollmentType":"0","registrationDate":"20220310","expirationDate":"20230310","expirationMileage":"100000","freeServiceDate":{"startDate":"20220310","endDate":"20230310"},"evEnrollmentCode":"7ZMW77Q8"},"activeDTC":{"dtcActiveCount":"0"},"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20230921202841","offset":-7},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":67,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":31,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":540,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":55,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":199,"unit":3},"totalAvailableRange":{"value":199,"unit":3}}}],"syncDate":{"utc":"20230921200229","offset":-7},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":199,"unit":3},"totalAvailableRange":{"value":199,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":199,"unit":3},"totalAvailableRange":{"value":199,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20230921202841","offset":-7},"syncDate":{"utc":"20230921200229","offset":-7},"batteryStatus":{"stateOfCharge":86,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0}}},"location":{"coord":{"lat":33.88883611,"lon":-118.3628916667,"alt":15,"type":0,"altdo":0},"head":83,"speed":{"value":0,"unit":1},"accuracy":{"hdop":6,"pdop":12},"syncDate":{"utc":"20230921200229","offset":-7}},"financed":true,"financeRegistered":false,"linkStatus":0,"rsaStatus":0}}]}}
2023-09-21 13:28:41.523 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230921200229
2023-09-21 13:28:41.523 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-21 20:02:29+00:00
2023-09-21 13:28:41.524 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20230921200229
2023-09-21 13:28:41.524 DEBUG (SyncWorker_5) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-09-21 20:02:29+00:00
2023-09-21 13:28:42.186 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 1.863 seconds (success: True)
2023-09-21 13:28:42.281 DEBUG (SyncWorker_3) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Time differential in seconds: 1573.281327
2023-09-21 13:28:42.282 DEBUG (SyncWorker_3) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['f0372e6d-74a7-4a7b-b32e-e174082d4c19']}

To Reproduce I'm not sure. I just check my graph each day and if it's been flatlined for over 24h, that's the tell.

Expected behavior At a minimum, I expect fresh data at least every time I drive, and typically every handful of hours when the car's asleep as well. My force refresh interval is currently the default 4h, although I've typically had it much longer (max value in minutes, 999 I think?) and that still gets updates more often than these flatlines.

Screenshots Inline above.

Additional context Not sure if there is but I'm happy to provide answers!

cdnninja commented 10 months ago

I haven't sifted through the data above in depth but are you sure it is flatlining and not the API? You mention logs look clean - does the data in the logs after the "flatline" show different values than the chart?

alexwhittemore commented 10 months ago

I'm not sure if I'd say the logs look "clean." As far as the integration flatlining vs the API - the data in the kia connect app still changes and remains up-to-date during the non-response of the integration. And of course, restarting the integration immediately results in fresh data, so interpret that how you will. The data in the logs after a restart certainly reflects a change.

cdnninja commented 10 months ago

So the data logged under Hyundai Kia connect is the raw server response. I reviewed again and the data coming from the server is indeed what we are putting into home assistant.

When I say logs are clean I mean no unexpected errors. Time out occurs and integration tries again later, is successful and stores the values.

What seems to be happening is the API is giving you old data.

I would have to check the code but a restart may trigger a force refresh which could solve this.

Next things I need confirmation on, you mentioned the native app works fine.

When this occurs please leave home assistant as is. Open the native app, don't refresh the data. See if it is different results. If so wait for next home assistant scan and let me know if that data makes its way over.

I'm wondering if the token expires, instead of the API rejecting it just keeps giving old data.

alexwhittemore commented 10 months ago

I'm wondering if the token expires, instead of the API rejecting it just keeps giving old data.

That seems extremely plausible.

OK, I'll: 1) disable my nighly integration reload and keep debug logging on 2) see if I can catch it in the act again. Then I'll 3) Check the app to see if the "real" data is, indeed, reflected in the app but not HA. 4) Try issuing a forced refresh in the app to see if the HA data THEN starts updating 5) If no, issue a forced refresh from the integration to see if THAT sorts anything out 6) if nothing above, reload the integration.

Will report back!

One interesting side note: I was under the impression that a forced refresh would reset the vehicle's "i've been idle too long let's shut off telematics to save battery" timer. A year ago before all of Kia's firmware updates and such, I ran into a problem with the default 4h forced refresh for exactly this - my car was sitting idle in the dealership parking lot, and the 4h refreshes caused aux battery saver + to hit the 10-tries limit and stop recharging the 12V, which of course then went flat.

Fast forward to now, I was just away for 10 days and around the 7 day mark, my car went into the telematics-off deep sleep, and completely stopped draining anything from the 12V. The app showed the "we shut off kia connect to save battery" message. So apparently my once-a-day integration reloads either weren't sending a forced update, or if they were, one forced update a day isn't too tight of timing to prevent the car entering deep sleep.

fuatakgun commented 10 months ago

After a week, it goes to deep sleep, force updates are not resetting it or keeping it out of deep sleep.

alexwhittemore commented 10 months ago

Alright, so my integration's been "flatlined" for a couple days now. The last update in home assistant was December 1 at 1:21AM (The "last updated at" entity is quite helpful!) The odometer at this point was 17,871mi

Screenshot 2023-12-03 at 3 14 04 PM

I can confirm that the kia connect app shows new information. Everything is different, but for a specific datapoint, the mileage shows in-app as 17,915.

Looking in the log, these are the latest messages returned for a search of "kia" so it sure looks like the extension died without any logged error, and has just been cold since then.

2023-12-01 01:21:40.655 DEBUG (SyncWorker_11) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"4fbac685-b254-43f2-914a-5523cd678406","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDC4DLC8N5032218","trim":{"modelYear":"2022","salesModelCode":"N5462","optionGroupCode":"014","modelName":"EV6","factoryCode":"AS","projectCode":"CV","trimName":"GT-LINE","driveType":"2","transmissionType":"1","ivrCategory":"10","btSeriesCode":"Y"},"telematics":1,"mileage":"17891","mileageSyncDate":"20231130182123","exteriorColor":"RUNWAY RED","exteriorColorCode":"CR5","fuelType":4,"invDealerCode":"CA313","testVehicle":"0","supportedApps":[{"appType":"0"},{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"activationType":2},"images":[{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"CVEV.USA.S5W_M.V011.004.231010","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true,"genType":"2"},"versionNum":"ECO","headUnitType":"0","hdRadio":"X40HAF","ampType":"NA","headUnitName":"avn5em","bluetoothRef":"20","headUnitDesc":"AVN5.0W"}},"maintenance":{"nextServiceMile":6108.5996,"maintenanceSchedule":[8000,16000,24000,32000,40000,48000,56000,64000,72000,80000,88000,96000]},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"My EV6","preferredDealer":"CA313","licensePlate":"","psi":"","customerType":0,"enrollment":{"provStatus":"4","enrollmentStatus":"1","enrollmentType":"0","registrationDate":"20220310","expirationDate":"20230310","expirationMileage":"100000","freeServiceDate":{"startDate":"20220310","endDate":"20230310"},"evEnrollmentCode":"7ZMW77Q8"},"activeDTC":{"dtcActiveCount":"0"},"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20231201092140","offset":-8},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":74,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":33,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":245,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":25,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":209,"unit":3},"totalAvailableRange":{"value":209,"unit":3}}}],"syncDate":{"utc":"20231201092123","offset":-8},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":209,"unit":3},"totalAvailableRange":{"value":209,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":209,"unit":3},"totalAvailableRange":{"value":209,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20231201092140","offset":-8},"syncDate":{"utc":"20231201092123","offset":-8},"batteryStatus":{"stateOfCharge":85,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0}}},"location":{"coord":{"lat":33.81519722,"lon":-118.3109416667,"alt":19,"type":0,"altdo":0},"head":270,"speed":{"value":0,"unit":1},"accuracy":{"hdop":6,"pdop":12},"syncDate":{"utc":"20231201092123","offset":-8}},"financed":true,"financeRegistered":false,"linkStatus":0,"rsaStatus":0}}]}}
2023-12-01 01:21:40.664 DEBUG (SyncWorker_11) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20231201092123
2023-12-01 01:21:40.664 DEBUG (SyncWorker_11) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-12-01 09:21:23+00:00
2023-12-01 01:21:40.665 DEBUG (SyncWorker_11) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20231201092123
2023-12-01 01:21:40.665 DEBUG (SyncWorker_11) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-12-01 09:21:23+00:00
2023-12-01 01:21:41.061 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 1.842 seconds (success: True)
2023-12-01 01:31:41.220 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['4fbac685-b254-43f2-914a-5523cd678406']}

For good measure, I commanded a force update from the app. At this point (3:25pm pacific today) I realized that I didn't actually have debug logging enabled for the integration, so I turned that back on. I waited 10 minutes, but no new data appeared for the EV6 device and the logbook was empty. No new debug log entries appeared either.

At this point, wanting to prod the integration, I tried unlocking the car doors using the integration's command. That WORKED, the car unlocked, and a couple data points also updated (including the Last Updated At entity, the two batteries, and the mileage). Oddly, the "Door Lock" entity didn't update from "locked" to "unlocked".

Some new debug log entries appeared as well (I included the last couple from above for reference):

2023-12-01 01:21:41.061 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 1.842 seconds (success: True)
2023-12-01 01:31:41.220 DEBUG (SyncWorker_10) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['4fbac685-b254-43f2-914a-5523cd678406']}
2023-12-03 15:48:27.363 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Refresh token expired
2023-12-03 15:48:27.655 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Sign In Response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"}}
2023-12-03 15:48:27.655 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.KiaUvoAPIUSA] got session id dea25880-54d1-48e8-acf1-674f158903c0
2023-12-03 15:48:27.993 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Get Vehicles Response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleSummary":[{"vin":"KNDC4DLC8N5032218","vehicleIdentifier":"032218","modelName":"EV6","modelYear":"2022","nickName":"My EV6","generation":2,"extColorCode":"CR5","trim":"GT-LINE","imagePath":{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}},"enrollmentStatus":1,"fatcAvailable":1,"telematicsUnit":1,"fuelType":4,"colorName":"RUNWAY RED","activationType":2,"mileage":"17915","dealerCode":"CA313","mobileStore":[{"osType":0,"downloadURL":"https://itunes.apple.com/us/app/kia-access-with-uvo-link/id1280548773?mt=8","image":{"imageName":"iosImage.png","imagePath":"/content/dam/kia/us/owners/image/common/app/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}},{"osType":1,"downloadURL":"https://play.google.com/store/apps/details?id=com.myuvo.link","image":{"imageName":"androidImage.png","imagePath":"/content/dam/kia/us/owners/image/common/app/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"supportedApp":{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}},"licensePlate":"","psi":"","supportAdditionalDriver":1,"customerType":0,"projectCode":"CV","headUnitDesc":"AVN5.0W","provStatus":"4","enrollmentSuppressionType":0,"rsaStatus":0,"dsEnrollment":0,"ubiEnrollment":0,"notificationCount":0,"genType":"2","vehicleKey":"17aebd80-ae4f-4f4a-9e62-3459a4264260"}],"chatbotSupport":true}}
2023-12-03 15:48:27.993 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Vehicles Type Passed in: <class 'dict'>
2023-12-03 15:48:27.994 DEBUG (SyncWorker_1) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Vehicles Passed in: {'032218': Vehicle(id='032218', name='My EV6', model='EV6', registration_date=None, year=None, VIN=None, key='4fbac685-b254-43f2-914a-5523cd678406', enabled=True, _total_driving_range=209, _total_driving_range_value=209, _total_driving_range_unit='mi', _odometer=17891.0, _odometer_value=17891.0, _odometer_unit='mi', _geocode_address={'house_number': '23217', 'road': 'Falena Avenue', 'city': 'Torrance', 'county': 'Los Angeles County', 'state': 'California', 'ISO3166-2-lvl4': 'US-CA', 'postcode': '90501', 'country': 'United States', 'country_code': 'us'}, _geocode_name='23217, Falena Avenue, Torrance, Los Angeles County, California, 90501, United States', car_battery_percentage=85, engine_is_running=False, last_updated_at=datetime.datetime(2023, 12, 1, 9, 21, 23, tzinfo=datetime.timezone.utc), timezone=datetime.timezone.utc, dtc_count='0', dtc_descriptions=None, smart_key_battery_warning_is_on=False, washer_fluid_warning_is_on=False, brake_fluid_warning_is_on=None, _air_temperature='72', _air_temperature_value='72', _air_temperature_unit='°F', air_control_is_on=False, defrost_is_on=False, steering_wheel_heater_is_on=0, back_window_heater_is_on=0, side_mirror_heater_is_on=0, front_left_seat_status=None, front_right_seat_status=None, rear_left_seat_status=None, rear_right_seat_status=None, is_locked=True, front_left_door_is_open=0, front_right_door_is_open=0, back_left_door_is_open=0, back_right_door_is_open=0, trunk_is_open=0, hood_is_open=0, front_left_window_is_open=None, front_right_window_is_open=None, back_left_window_is_open=None, back_right_window_is_open=None, tire_pressure_all_warning_is_on=0, tire_pressure_rear_left_warning_is_on=None, tire_pressure_front_left_warning_is_on=None, tire_pressure_front_right_warning_is_on=None, tire_pressure_rear_right_warning_is_on=None, _next_service_distance=6108.5996, _next_service_distance_value=6108.5996, _next_service_distance_unit='mi', _last_service_distance=None, _last_service_distance_value=None, _last_service_distance_unit='mi', _location_latitude=33.81519722, _location_longitude=-118.3109416667, _location_last_set_time=datetime.datetime(2023, 12, 1, 9, 21, 23, tzinfo=datetime.timezone.utc), ev_charge_port_door_is_open=None, ev_charge_limits_dc=100, ev_charge_limits_ac=80, total_power_consumed=None, total_power_regenerated=None, power_consumption_30d=None, daily_stats=[], month_trip_info=None, day_trip_info=None, ev_battery_percentage=74, ev_battery_is_charging=False, ev_battery_is_plugged_in=0, _ev_driving_range=209, _ev_driving_range_value=209, _ev_driving_range_unit='mi', _ev_estimated_current_charge_duration=33, _ev_estimated_current_charge_duration_value=33, _ev_estimated_current_charge_duration_unit='m', _ev_estimated_fast_charge_duration=None, _ev_estimated_fast_charge_duration_value=None, _ev_estimated_fast_charge_duration_unit='m', _ev_estimated_portable_charge_duration=None, _ev_estimated_portable_charge_duration_value=None, _ev_estimated_portable_charge_duration_unit='m', _ev_estimated_station_charge_duration=None, _ev_estimated_station_charge_duration_value=None, _ev_estimated_station_charge_duration_unit='m', _ev_target_range_charge_AC=None, _ev_target_range_charge_AC_value=None, _ev_target_range_charge_AC_unit=None, _ev_target_range_charge_DC=None, _ev_target_range_charge_DC_value=None, _ev_target_range_charge_DC_unit=None, ev_first_departure_enabled=None, ev_second_departure_enabled=None, ev_first_departure_days=None, ev_second_departure_days=None, ev_first_departure_time=None, ev_second_departure_time=None, ev_off_peak_start_time=None, ev_off_peak_end_time=None, ev_off_peak_charge_only_enabled=None, _fuel_driving_range=None, _fuel_driving_range_value=None, _fuel_driving_range_unit=None, fuel_level=None, fuel_level_is_low=False, engine_type=None, data={'vinKey': '4fbac685-b254-43f2-914a-5523cd678406', 'vehicleConfig': {'vehicleDetail': {'vehicle': {'vin': 'KNDC4DLC8N5032218', 'trim': {'modelYear': '2022', 'salesModelCode': 'N5462', 'optionGroupCode': '014', 'modelName': 'EV6', 'factoryCode': 'AS', 'projectCode': 'CV', 'trimName': 'GT-LINE', 'driveType': '2', 'transmissionType': '1', 'ivrCategory': '10', 'btSeriesCode': 'Y'}, 'telematics': 1, 'mileage': '17891', 'mileageSyncDate': '20231130182123', 'exteriorColor': 'RUNWAY RED', 'exteriorColorCode': 'CR5', 'fuelType': 4, 'invDealerCode': 'CA313', 'testVehicle': '0', 'supportedApps': [{'appType': '0'}, {'appType': '5', 'appImage': {'imageName': 'uvo-app.png', 'imagePath': '/content/dam/kia/us/owners/image/common/app/access/', 'imageType': '2', 'imageSize': {'length': '100', 'width': '100', 'uom': 0}}}], 'activationType': 2}, 'images': [{'imageName': '2022-ev6-gt-line-cr5.png', 'imagePath': '/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/', 'imageType': '1', 'imageSize': {'length': '100', 'width': '100', 'uom': 0}}], 'device': {'launchType': '0', 'swVersion': 'CVEV.USA.S5W_M.V011.004.231010', 'telematics': {'generation': '3', 'platform': '1', 'tmsCenter': '1', 'billing': True, 'genType': '2'}, 'versionNum': 'ECO', 'headUnitType': '0', 'hdRadio': 'X40HAF', 'ampType': 'NA', 'headUnitName': 'avn5em', 'bluetoothRef': '20', 'headUnitDesc': 'AVN5.0W'}}, 'maintenance': {'nextServiceMile': 6108.5996, 'maintenanceSchedule': [8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 72000, 80000, 88000, 96000]}, 'billingPeriod': {'freeTrial': {'value': 12, 'unit': 0}, 'freeTrialExtension': {'value': 12, 'unit': 1}, 'servicePeriod': {'value': 60, 'unit': 1}}}, 'lastVehicleInfo': {'vehicleNickName': 'My EV6', 'preferredDealer': 'CA313', 'licensePlate': '', 'psi': '', 'customerType': 0, 'enrollment': {'provStatus': '4', 'enrollmentStatus': '1', 'enrollmentType': '0', 'registrationDate': '20220310', 'expirationDate': '20230310', 'expirationMileage': '100000', 'freeServiceDate': {'startDate': '20220310', 'endDate': '20230310'}, 'evEnrollmentCode': '7ZMW77Q8'}, 'activeDTC': {'dtcActiveCount': '0'}, 'vehicleStatusRpt': {'statusType': '2', 'reportDate': {'utc': '20231201092140', 'offset': -8}, 'vehicleStatus': {'climate': {'airCtrl': False, 'defrost': False, 'airTemp': {'value': '72', 'unit': 1}, 'heatingAccessory': {'steeringWheel': 0, 'sideMirror': 0, 'rearWindow': 0}}, 'engine': False, 'doorLock': True, 'doorStatus': {'frontLeft': 0, 'frontRight': 0, 'backLeft': 0, 'backRight': 0, 'trunk': 0, 'hood': 0}, 'lowFuelLight': False, 'evStatus': {'batteryCharge': False, 'batteryStatus': 74, 'batteryPlugin': 0, 'batteryPrecondition': False, 'remainChargeTime': [{'remainChargeType': 1, 'timeInterval': {'value': 33, 'unit': 4}}, {'remainChargeType': 2, 'timeInterval': {'value': 245, 'unit': 4}}, {'remainChargeType': 3, 'timeInterval': {'value': 25, 'unit': 4}}], 'drvDistance': [{'type': 2, 'rangeByFuel': {'evModeRange': {'value': 209, 'unit': 3}, 'totalAvailableRange': {'value': 209, 'unit': 3}}}], 'syncDate': {'utc': '20231201092123', 'offset': -8}, 'targetSOC': [{'plugType': 0, 'targetSOClevel': 100, 'dte': {'type': 2, 'rangeByFuel': {'gasModeRange': {'value': 0, 'unit': 3}, 'evModeRange': {'value': 209, 'unit': 3}, 'totalAvailableRange': {'value': 209, 'unit': 3}}}}, {'plugType': 1, 'targetSOClevel': 80, 'dte': {'type': 2, 'rangeByFuel': {'gasModeRange': {'value': 0, 'unit': 3}, 'evModeRange': {'value': 209, 'unit': 3}, 'totalAvailableRange': {'value': 209, 'unit': 3}}}}]}, 'ign3': False, 'transCond': True, 'tirePressure': {'all': 0}, 'dateTime': {'utc': '20231201092140', 'offset': -8}, 'syncDate': {'utc': '20231201092123', 'offset': -8}, 'batteryStatus': {'stateOfCharge': 85, 'deliveryMode': 1, 'warning': 65, 'powerAutoCutMode': 2}, 'sleepMode': False, 'lampWireStatus': {'headLamp': {'headLampStatus': False, 'lampLL': False, 'lampRL': False, 'lampLH': False, 'lampRH': False, 'lampLB': False, 'lampRB': False}, 'stopLamp': {'leftLamp': False, 'rightLamp': False}, 'turnSignalLamp': {'lampLF': False, 'lampRF': False, 'lampLR': False, 'lampRR': False}}, 'windowStatus': {'windowFL': 0, 'windowFR': 0, 'windowRL': 0, 'windowRR': 0}, 'smartKeyBatteryWarning': False, 'washerFluidStatus': False, 'brakeOilStatus': False, 'engineRuntime': {}, 'remoteControlAvailable': 1, 'valetParkingMode': 0, 'rsaStatus': 0, 'lightStatus': {'tailLampStatus': 0, 'hazardStatus': 0}}}, 'location': {'coord': {'lat': 33.81519722, 'lon': -118.3109416667, 'alt': 19, 'type': 0, 'altdo': 0}, 'head': 270, 'speed': {'value': 0, 'unit': 1}, 'accuracy': {'hdop': 6, 'pdop': 12}, 'syncDate': {'utc': '20231201092123', 'offset': -8}}, 'financed': True, 'financeRegistered': False, 'linkStatus': 0, 'rsaStatus': 0}})}
2023-12-03 15:48:28.002 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Action for lock is: VEHICLE_LOCK_ACTION.UNLOCK
2023-12-03 15:48:28.002 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - Calling unlock
2023-12-03 15:48:28.002 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/rems/door/unlock request
2023-12-03 15:48:28.411 DEBUG (SyncWorker_9) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"}}
2023-12-03 15:48:28.419 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.VehicleManager] hyundai_kia_connect_api - Time differential in seconds: 224825.419347
2023-12-03 15:48:28.420 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}
2023-12-03 15:48:29.029 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleStatusRpt":{"statusType":"1","reportDate":{"utc":"20231203234828","offset":-8},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":76,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":30,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":175,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":20,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}],"syncDate":{"utc":"20231203232715","offset":-8},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20231203234828","offset":-8},"syncDate":{"utc":"20231203232715","offset":-8},"batteryStatus":{"stateOfCharge":81,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0},"systemCutOffAlert":0}}}}
2023-12-03 15:48:29.033 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '0', 'vehicle': '1', 'vehicleFeature': '0'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '1', 'enrollment': '1', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['17aebd80-ae4f-4f4a-9e62-3459a4264260']}
2023-12-03 15:48:29.449 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api got response {"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"17aebd80-ae4f-4f4a-9e62-3459a4264260","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDC4DLC8N5032218","trim":{"modelYear":"2022","salesModelCode":"N5462","optionGroupCode":"014","modelName":"EV6","factoryCode":"AS","projectCode":"CV","trimName":"GT-LINE","driveType":"2","transmissionType":"1","ivrCategory":"10","btSeriesCode":"Y"},"telematics":1,"mileage":"17915","mileageSyncDate":"20231203082715","exteriorColor":"RUNWAY RED","exteriorColorCode":"CR5","fuelType":4,"invDealerCode":"CA313","testVehicle":"0","supportedApps":[{"appType":"0"},{"appType":"5","appImage":{"imageName":"uvo-app.png","imagePath":"/content/dam/kia/us/owners/image/common/app/access/","imageType":"2","imageSize":{"length":"100","width":"100","uom":0}}}],"activationType":2},"images":[{"imageName":"2022-ev6-gt-line-cr5.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2022/ev6/gt-line/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"CVEV.USA.S5W_M.V011.004.231010","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true,"genType":"2"},"versionNum":"ECO","headUnitType":"0","hdRadio":"X40HAF","ampType":"NA","headUnitName":"avn5em","bluetoothRef":"20","headUnitDesc":"AVN5.0W"}},"maintenance":{"nextServiceMile":6084.699,"maintenanceSchedule":[8000,16000,24000,32000,40000,48000,56000,64000,72000,80000,88000,96000]},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"My EV6","preferredDealer":"CA313","licensePlate":"","psi":"","customerType":0,"enrollment":{"provStatus":"4","enrollmentStatus":"1","enrollmentType":"0","registrationDate":"20220310","expirationDate":"20230310","expirationMileage":"100000","freeServiceDate":{"startDate":"20220310","endDate":"20230310"},"evEnrollmentCode":"7ZMW77Q8"},"activeDTC":{"dtcActiveCount":"0"},"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20231203234829","offset":-8},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"72","unit":1},"heatingAccessory":{"steeringWheel":0,"sideMirror":0,"rearWindow":0}},"engine":false,"doorLock":true,"doorStatus":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0,"trunk":0,"hood":0},"lowFuelLight":false,"evStatus":{"batteryCharge":false,"batteryStatus":76,"batteryPlugin":0,"batteryPrecondition":false,"remainChargeTime":[{"remainChargeType":1,"timeInterval":{"value":30,"unit":4}},{"remainChargeType":2,"timeInterval":{"value":175,"unit":4}},{"remainChargeType":3,"timeInterval":{"value":20,"unit":4}}],"drvDistance":[{"type":2,"rangeByFuel":{"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}],"syncDate":{"utc":"20231203232715","offset":-8},"targetSOC":[{"plugType":0,"targetSOClevel":100,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}},{"plugType":1,"targetSOClevel":80,"dte":{"type":2,"rangeByFuel":{"gasModeRange":{"value":0,"unit":3},"evModeRange":{"value":217,"unit":3},"totalAvailableRange":{"value":217,"unit":3}}}}]},"ign3":false,"transCond":true,"tirePressure":{"all":0},"dateTime":{"utc":"20231203234829","offset":-8},"syncDate":{"utc":"20231203232715","offset":-8},"batteryStatus":{"stateOfCharge":81,"deliveryMode":1,"warning":65,"powerAutoCutMode":2},"sleepMode":false,"lampWireStatus":{"headLamp":{"headLampStatus":false,"lampLL":false,"lampRL":false,"lampLH":false,"lampRH":false,"lampLB":false,"lampRB":false},"stopLamp":{"leftLamp":false,"rightLamp":false},"turnSignalLamp":{"lampLF":false,"lampRF":false,"lampLR":false,"lampRR":false}},"windowStatus":{"windowFL":0,"windowFR":0,"windowRL":0,"windowRR":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"brakeOilStatus":false,"engineRuntime":{},"remoteControlAvailable":1,"valetParkingMode":0,"rsaStatus":0,"lightStatus":{"tailLampStatus":0,"hazardStatus":0},"systemCutOffAlert":0}},"location":{"coord":{"lat":33.81518611,"lon":-118.3109805556,"alt":16,"type":0,"altdo":0},"head":270,"speed":{"value":0,"unit":1},"accuracy":{"hdop":5,"pdop":10},"syncDate":{"utc":"20231203232715","offset":-8}},"financed":true,"financeRegistered":false,"linkStatus":0,"rsaStatus":0}}]}}
2023-12-03 15:48:29.454 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20231203232715
2023-12-03 15:48:29.455 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-12-03 23:27:15+00:00
2023-12-03 15:48:29.456 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - before 20231203232715
2023-12-03 15:48:29.456 DEBUG (SyncWorker_6) [hyundai_kia_connect_api.KiaUvoAPIUSA] hyundai_kia_connect_api - last_updated_at - after 2023-12-03 23:27:15+00:00
2023-12-03 15:48:29.459 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 1.042 seconds (success: True)

A few minutes later, the integration had updated again, this time reflecting that the car doors were unlocked. Which is funny because by now they'd re-locked themselves because no doors were opened.

So in summary: This time, it looks like the integration just stopped trying to poll the API at all. After being manually prodded to unlock the car, it then started polling the API again as if nothing was wrong.

Edit: I reloaded the integration to be sure debug logging would be enabled from now on.

cdnninja commented 10 months ago

As a note debug requires a restart to enable. So worth doing that to get Kia_uvo debug as well. However it does appear home assistant isn't triggering a poll.

Could I get a screenshot of your refresh intervals? Also try adjust them and save to confirm this isn't some corrupt data. This data is saved to home assistant and home assistant is responsible for calling the integration next times it's due for a poll. At which point you should see data in the logs.

alexwhittemore commented 10 months ago

As a note debug requires a restart to enable. Do you mean to confirm that reloading the integration was necessary, or do I need to restart home assistant or something?

Here's my config:

image

I just tried to change the scan interval to 11, to save and then revert it to 10, but I got an error that it must be at least 15. So I've just changed it to 15min and now that's where it lives, I guess.

alexwhittemore commented 10 months ago

Ever since taking that action to change the scan interval to 15min, I haven't had a flatline since. I think maybe that's the root cause of my whole issue. I guess the fix is just to change the scan interval from the old default of 10min to the new minimum of 15. Note that I've explicitly avoided running any HA updates or restarting the machine or any actions that otherwise might reload HA or the integration.

I'm setting a reminder now for next Friday to close this issue if it hasn't come back in that time.

alexwhittemore commented 10 months ago

I had to restart HA anyway, so I'm closing this. Will reopen if the issue comes back, but tl;dr set your scan interval to 15min or higher!