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

data received through a forced update or regular update is not parsed in 2.0.1 #388

Closed zadigre closed 1 year ago

zadigre commented 1 year ago

Canada, Kona Electric 2021

after a forced update, data is received according to debug log. but "last updated at" entity or any other entities are not updated. also, if I start climate through the MyHyundai App and force update on HA 2 minutes later, data is received in the log... but not updated in HA.

here's the log for a force update. 2022-10-29 16:16:33.947 DEBUG (SyncWorker_7) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - Received forced vehicle data {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'status': {'lastStatusDate': '20221029201632', 'airCtrlOn': False, 'engine': False, 'doorLock': True, 'doorOpen': {'frontLeft': 0, 'frontRight': 0, 'backLeft': 0, 'backRight': 0}, 'trunkOpen': False, 'airTempUnit': 'C', 'airTemp': {'value': '00H', 'unit': 0}, 'defrost': False, 'acc': False, 'evStatus': {'batteryCharge': False, 'batteryStatus': 61, 'batteryPlugin': 0, 'remainTime2': {'etc1': {'value': 0, 'unit': 1}, 'etc2': {'value': 0, 'unit': 1}, 'etc3': {'value': 0, 'unit': 1}, 'atc': {'value': 0, 'unit': 1}}, 'drvDistance': [{'rangeByFuel': {'gasModeRange': {'value': 0.0, 'unit': 1}, 'evModeRange': {'value': 301.0, 'unit': 1}, 'totalAvailableRange': {'value': 301.0, 'unit': 1}}, 'type': 2}]}, 'hoodOpen': False, 'transCond': True, 'steerWheelHeat': 0, 'sideBackWindowHeat': 0, 'dte': {}, 'tirePressureLamp': {'tirePressureLampAll': 0}, 'battery': {'batSoc': 86, 'batState': 0, 'batSignalReferenceValue': {}}, 'remoteIgnition': True, 'seatHeaterVentInfo': {}, 'sleepModeCheck': False, 'lampWireStatus': {'headLamp': {}, 'stopLamp': {}, 'turnSignalLamp': {}}, 'windowOpen': {}, 'engineRuntime': {}}}} 2022-10-29 16:16:34.675 DEBUG (SyncWorker_7) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - get_cached_vehicle_status response {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'status': {'lastStatusDate': '20221029201632', 'airCtrlOn': False, 'engine': False, 'doorLock': True, 'doorOpen': {'frontLeft': 0, 'frontRight': 0, 'backLeft': 0, 'backRight': 0}, 'trunkOpen': False, 'airTempUnit': 'C', 'airTemp': {'value': '00H', 'unit': 0}, 'defrost': False, 'acc': False, 'evStatus': {'batteryCharge': False, 'batteryStatus': 61, 'batteryPlugin': 0, 'remainTime2': {'etc1': {'value': 0, 'unit': 1}, 'etc2': {'value': 0, 'unit': 1}, 'etc3': {'value': 0, 'unit': 1}, 'atc': {'value': 0, 'unit': 1}}, 'drvDistance': [{'rangeByFuel': {'gasModeRange': {'value': 0.0, 'unit': 1}, 'evModeRange': {'value': 301.0, 'unit': 1}, 'totalAvailableRange': {'value': 301.0, 'unit': 1}}, 'type': 2}]}, 'hoodOpen': False, 'transCond': True, 'steerWheelHeat': 0, 'sideBackWindowHeat': 0, 'dte': {}, 'tirePressureLamp': {'tirePressureLampAll': 0}, 'battery': {'batSoc': 86, 'batState': 0, 'batSignalReferenceValue': {}}, 'remoteIgnition': True, 'seatHeaterVentInfo': {}, 'sleepModeCheck': False, 'lampWireStatus': {'headLamp': {}, 'stopLamp': {}, 'turnSignalLamp': {}}, 'windowOpen': {}, 'engineRuntime': {}}}} 2022-10-29 16:16:35.249 DEBUG (SyncWorker_7) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - Get Service status data {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'maintenanceInfo': {'msopServiceOdometer': 48081.0, 'msopServiceOdometerUnit': 1, 'mtspServiceDate': '20220819', 'imatServiceOdometer': 60081.0, 'imatServiceOdometerUnit': 1, 'mtitServiceDate': '20230219', 'currentOdometer': 53713.8, 'currentOdometerUnit': 1, 'serviceOdometerDuration': 12000.0, 'serviceDaysDuration': 184, 'serviceMonthsThreshold': 6}}} 2022-10-29 16:16:35.249 DEBUG (SyncWorker_7) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - before 20221029201632 2022-10-29 16:16:35.250 DEBUG (SyncWorker_7) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - after 2022-10-29 20:16:32+00:00

screen capture of the taken right after seeing this in the log :

Capture d’écran, le 2022-10-29 à 16 26 50

but data updates automatically in HA after seeing this in the log (apparently not linked with anything I did to have the data) : 2022-10-29 16:38:07.003 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.VehicleManager] time diff - 290.003401 2022-10-29 16:38:07.668 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - get_cached_vehicle_status response {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'status': {'lastStatusDate': '20221029203538', 'airCtrlOn': False, 'engine': False, 'doorLock': True, 'doorOpen': {'frontLeft': 0, 'frontRight': 0, 'backLeft': 0, 'backRight': 0}, 'trunkOpen': False, 'airTempUnit': 'C', 'airTemp': {'value': '00H', 'unit': 0}, 'defrost': True, 'acc': False, 'evStatus': {'batteryCharge': False, 'batteryStatus': 61, 'batteryPlugin': 0, 'remainTime2': {'etc1': {'value': 34, 'unit': 1}, 'etc2': {'value': 700, 'unit': 1}, 'etc3': {'value': 135, 'unit': 1}, 'atc': {'value': 0, 'unit': 1}}, 'drvDistance': [{'rangeByFuel': {'gasModeRange': {'value': 0.0, 'unit': 1}, 'evModeRange': {'value': 301.0, 'unit': 1}, 'totalAvailableRange': {'value': 301.0, 'unit': 1}}, 'type': 2}]}, 'hoodOpen': False, 'transCond': True, 'steerWheelHeat': 0, 'sideBackWindowHeat': 0, 'dte': {}, 'tirePressureLamp': {'tirePressureLampAll': 0}, 'battery': {'batSoc': 86, 'batState': 0, 'batSignalReferenceValue': {}}, 'remoteIgnition': True, 'seatHeaterVentInfo': {}, 'sleepModeCheck': False, 'lampWireStatus': {'headLamp': {}, 'stopLamp': {}, 'turnSignalLamp': {}}, 'windowOpen': {}, 'engineRuntime': {}}}} 2022-10-29 16:38:08.247 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - Get Service status data {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'maintenanceInfo': {'msopServiceOdometer': 48081.0, 'msopServiceOdometerUnit': 1, 'mtspServiceDate': '20220819', 'imatServiceOdometer': 60081.0, 'imatServiceOdometerUnit': 1, 'mtitServiceDate': '20230219', 'currentOdometer': 53713.8, 'currentOdometerUnit': 1, 'serviceOdometerDuration': 12000.0, 'serviceDaysDuration': 184, 'serviceMonthsThreshold': 6}}} 2022-10-29 16:38:08.247 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - before 20221029203538 2022-10-29 16:38:08.248 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - after 2022-10-29 20:35:38+00:00 2022-10-29 16:38:08.250 DEBUG (MainThread) [custom_components.kia_uvo.coordinator] Finished fetching kia_uvo data in 1.248 seconds (success: True)

zadigre commented 1 year ago

is 2.0.4 supposed to fix this issue? if yes, I can say it's not (completely) fixed according to what is received in the log 2022-10-30 18:20:21.142 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - before 20221030222017 2022-10-30 18:20:21.142 DEBUG (SyncWorker_0) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - after 2022-10-30 22:20:17+00:00

it's currently 18h27 EDT here... and last updated at sensor says 23 minutes ago.

and when I force update, last updated at is not updated.

zadigre commented 1 year ago

I did a test just to confirm none of the data is updating and not just the last updated at sensor. I started climate using MyHyundai app. I did a force update in HA. Data was received in the log... but data was not updated in HA.

cdnninja commented 1 year ago

To confirm on it refreshing correctly on its own cycle? I ask since my appears to be. I did see similar issue around a force update though so I need to sit with my key fob in hand and play with this to figure it out.

zadigre commented 1 year ago

yes it refreshes fine on it's own... but not when I force an update even if I see the received data in the log. also when I unlock or lock my car, I don't see the status updating in HA... I believe it was updating with previous version. Problem still present in 2.0.10

cdnninja commented 1 year ago

Could you try v2.0.15?

zadigre commented 1 year ago

last updated at still not updating

cdnninja commented 1 year ago

last updated at still not updating

So to confirm the last updated in your log doesn't match the sensor?

zadigre commented 1 year ago

last updated at sensor doesn't match log...

log: 2022-11-04 15:44:51.062 DEBUG (SyncWorker_8) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - before 20221104194423 2022-11-04 15:44:51.062 DEBUG (SyncWorker_8) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - last_updated_at - after 2022-11-04 19:44:23+00:00

currently 15:48 sensor says 22 minutes ago.

cdnninja commented 1 year ago

We indeed had some state issues when a force call was placed. v2.0.18 adds code to update state. For me this is testing out well.

zadigre commented 1 year ago

Just tested… Confirmed with 2.0.18 last updated at sensor and other sensors are updated after a force update.

cdnninja commented 1 year ago

Awesome! Thanks for sticking with me on this one.