dahlb / ha_kia_hyundai

A Home Assistant HACS integration that supports Kia Connect(Uvo). The integration supports the USA.
MIT License
17 stars 6 forks source link

Integration Error Post-Configuration #45

Closed jakecolman closed 2 years ago

jakecolman commented 2 years ago

Region and Brand of car US / Kia Niro

Describe the bug After entering all the configuration details no data appears in the dashboard. When you view the Integrations screen you see "Retrying setup..." with error details. See below for traceback.

Debug logs if an error occurred

2021-12-29 07:40:08 DEBUG (MainThread) [custom_components.ha_kia_hyundai] first update start 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '1', 'vehicle': '1', 'vehicleFeature': '1'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '0', 'enrollment': '0', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['9a0042e8-8b89-4c6f-b293-460c15738b67']} 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] response headers:<CIMultiDictProxy('Server': 'KMA', 'Date': 'Wed, 29 Dec 2021 12:40:08 GMT', 'Content-Length': '4680', 'Content-Type': 'application/json', 'Xid': '6d46987c-44b5-43e8-b51b-b0830580a753')> 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] response text:{"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"9a0042e8-8b89-4c6f-b293-460c15738b67","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDCC3LC7L5428408","trim":{"modelYear":"2020","salesModelCode":"G4262","optionGroupCode":"010","modelName":"NIRO","factoryCode":"G5","projectCode":"DEHEV","trimName":"TOURING","driveType":"0","transmissionType":"1","ivrCategory":"5","btSeriesCode":"G"},"telematics":1,"mileage":"0","mileageSyncDate":"20211228211444","exteriorColor":"DEEP CERULEAN","exteriorColorCode":"C3U","fuelType":3,"invDealerCode":"PA004","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":"2020-niro-touring-c3u.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2020/niro/touring/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"DEPE_HEV.USA.D2V.002.001.191207","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true},"versionNum":"GASOLINE","headUnitType":"2","hdRadio":"X40HAF","ampType":"NA","modem":{"meid":"352756079211901","mdn":"6574342729","iccid":"89148000005952739845"},"headUnitName":"daudio1","bluetoothRef":"19","headUnitDesc":"DAV2"}},"maintenance":{"nextServiceMile":5823.7197,"maintenanceSchedule":[7500,15000,22500,30000,37500,45000,52500,60000,67500,75000,82500,90000,97500,105000,112500]},"vehicleFeature":{"remoteFeature":{"lock":"1","unlock":"1","start":"3","stop":"1","scheduleCount":"2","inVehicleSchedule":"1","heatedSteeringWheel":"1","heatedSideMirror":"1","heatedRearWindow":"1","heatedSeat":"0","ventSeat":"0","alarm":"1","hornlight":"1","panic":"1","doorSecurity":"1","engineIdleTime":"1","separateHeatedAccessories":"0","windowSafety":"0"},"chargeFeature":{"batteryChargeType":"0","chargeEndPct":"0","immediateCharge":"0","cancelCharge":"0","evRange":"0","scheduleCount":"0","inVehicleSchedule":"0","offPeakType":"0","scheduleType":"0","chargeLevel":"0","scheduleConfig":"0","fatcWithCharge":"0"},"alertFeature":{"geofenceType":{"geofence":"1","entryCount":"5","exitCount":"1","inVehicleConfig":"0","minRadius":"1","maxRadius":"10","minHeight":"1","maxHeight":"10","minWidth":"1","maxWidth":"10","uom":"0"},"curfewType":{"curfew":"1","curfewCount":"21","inVehicleConfig":"0"},"speedType":{"speed":"1","speedCount":"21","inVehicleConfig":"0"},"valetType":{"valet":"1","valetParkingMode":"0","defaultRadius":"1","defaultRadiusUnit":"3","defaultInterval":"5","defaultIntervalUnit":"3","inVehicleConfig":"0"}},"vrmFeature":{"autoDTC":"1","scheduledDTC":"1","backgroundDTC":"1","manualDTC":"1","healthReport":"0","drivingScore":"1","gasRange":"1","evRange":"0","trip":"1"},"locationFeature":{"gpsStreaming":"0","location":"1","poi":"1","poiCount":"25","push2Vehicle":"1","wayPoint":"1","mapType":"1","surroundView":"0","svr":"1"},"userSettingFeature":{"usmType":"0","calendar":"0","valetParkingMode":"0","wifiHotSpot":"0","otaSupport":"0","digitalKeyOption":"0"}},"heatVentSeat":{},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"Niro","preferredDealer":"PA004","licensePlate":"","psi":"","customerType":1,"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20211229124008","offset":-8},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"75","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,"ign3":false,"transCond":true,"distanceToEmpty":{"value":438,"unit":3},"tirePressure":{"all":0,"frontLeft":0,"frontRight":0,"rearLeft":0,"rearRight":0},"dateTime":{"utc":"20211229124008","offset":-8},"syncDate":{"utc":"20211229121444","offset":-8},"batteryStatus":{"stateOfCharge":100,"sensorStatus":0,"deliveryMode":0},"sleepMode":true,"lampWireStatus":{"headLamp":{},"stopLamp":{},"turnSignalLamp":{}},"windowStatus":{},"engineOilStatus":false,"vehicleMovementHis":false,"engineRuntime":{"value":8,"unit":1},"valetParkingMode":0}},"location":{"coord":{"lat":40.008693,"lon":-75.243275,"alt":61.2,"type":0,"altdo":0},"head":179,"speed":{"value":0,"unit":1},"accuracy":{"hdop":0,"pdop":1},"syncDate":{"utc":"20211229121444","offset":-8}},"financed":true,"financeRegistered":false,"linkStatus":0}}]}} 2021-12-29 07:40:08 ERROR (MainThread) [custom_components.ha_kia_hyundai.vehicle] Unexpected error fetching Vehicle 428408 data: '<=' not supported between instances of 'NoneType' and 'int' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/ha_kia_hyundai/vehicle.py", line 112, in async_update_data await self.api_cloud.update(vehicle=self) File "/config/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 30, in request_with_active_session_wrapper return await func(*args, **kwargs) File "/config/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 232, in update if ev_max_dc_charge_level <= 100: TypeError: '<=' not supported between instances of 'NoneType' and 'int' 2021-12-29 07:40:08 DEBUG (MainThread) [custom_components.ha_kia_hyundai.vehicle] Finished fetching Vehicle 428408 data in 0.267 seconds (success: False)

To Reproduce Steps to reproduce the behavior: Simply configure the integration as per standard. It found my car but appears to get a parsing error when processing the results.

Expected behavior No error showing on the integration screen. Data showing in dashboard.

Screenshots image

dahlb commented 2 years ago

Thanks for another well detailed bug report, I don't have a lunch break today but should be able to fix it quickly in about 11 hours when I get to a computer tonight.

On Wed, Dec 29, 2021, 7:47 AM Jake Colman @.***> wrote:

Region and Brand of car US / Kia Niro

Describe the bug After entering all the configuration details no data appears in the dashboard. When you view the Integrations screen you see "Retrying setup..." with error details. See below for traceback.

Debug logs if an error occurred

2021-12-29 07:40:08 DEBUG (MainThread) [custom_components.ha_kia_hyundai] first update start 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] sending https://api.owners.kia.com/apigw/v1/cmm/gvi request with {'vehicleConfigReq': {'airTempRange': '0', 'maintenance': '1', 'seatHeatCoolOption': '1', 'vehicle': '1', 'vehicleFeature': '1'}, 'vehicleInfoReq': {'drivingActivty': '0', 'dtc': '0', 'enrollment': '0', 'functionalCards': '0', 'location': '1', 'vehicleStatus': '1', 'weather': '0'}, 'vinKey': ['9a0042e8-8b89-4c6f-b293-460c15738b67']} 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] response headers:<CIMultiDictProxy('Server': 'KMA', 'Date': 'Wed, 29 Dec 2021 12:40:08 GMT', 'Content-Length': '4680', 'Content-Type': 'application/json', 'Xid': '6d46987c-44b5-43e8-b51b-b0830580a753')> 2021-12-29 07:40:08 DEBUG (MainThread) [kia_hyundai_api.us_kia] response text:{"status":{"statusCode":0,"errorType":0,"errorCode":0,"errorMessage":"Success with response body"},"payload":{"vehicleInfoList":[{"vinKey":"9a0042e8-8b89-4c6f-b293-460c15738b67","vehicleConfig":{"vehicleDetail":{"vehicle":{"vin":"KNDCC3LC7L5428408","trim":{"modelYear":"2020","salesModelCode":"G4262","optionGroupCode":"010","modelName":"NIRO","factoryCode":"G5","projectCode":"DEHEV","trimName":"TOURING","driveType":"0","transmissionType":"1","ivrCategory":"5","btSeriesCode":"G"},"telematics":1,"mileage":"0","mileageSyncDate":"20211228211444","exteriorColor":"DEEP CERULEAN","exteriorColorCode":"C3U","fuelType":3,"invDealerCode":"PA004","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":"2020-niro-touring-c3u.png","imagePath":"/content/dam/kia/us/owners/image/vehicle-app/2020/niro/touring/","imageType":"1","imageSize":{"length":"100","width":"100","uom":0}}],"device":{"launchType":"0","swVersion":"DEPE_HEV.USA.D2V.002.001.191207","telematics":{"generation":"3","platform":"1","tmsCenter":"1","billing":true},"versionNum":"GASOLINE","headUnitType":"2","hdRadio":"X40HAF","ampType":"NA","modem":{"meid":"352756079211901","mdn":"6574342729","iccid":"89148000005952739845"},"headUnitName":"daudio1","bluetoothRef":"19","headUnitDesc":"DAV2"}},"maintenance":{"nextServiceMile":5823.7197,"maintenanceSchedule":[7500,15000,22500,30000,37500,45000,52500,60000,67500,75000,82500,90000,97500,105000,112500]},"vehicleFeature":{"remoteFeature":{"lock":"1","unlock":"1","start":"3","stop":"1","scheduleCount":"2","inVehicleSchedule":"1","heatedSteeringWheel":"1","heatedSideMirror":"1","heatedRearWindow":"1","heatedSeat":"0","ventSeat":"0","alarm":"1","hornlight":"1","panic":"1","doorSecurity":"1","engineIdleTime":"1","separateHeatedAccessories":"0","windowSafety":"0"},"chargeFeature":{"batteryChargeType":"0","chargeEndPct":"0","immediateCharge":"0","cancelCharge":"0","evRange":"0","scheduleCount":"0","inVehicleSchedule":"0","offPeakType":"0","scheduleType":"0","chargeLevel":"0","scheduleConfig":"0","fatcWithCharge":"0"},"alertFeature":{"geofenceType":{"geofence":"1","entryCount":"5","exitCount":"1","inVehicleConfig":"0","minRadius":"1","maxRadius":"10","minHeight":"1","maxHeight":"10","minWidth":"1","maxWidth":"10","uom":"0"},"curfewType":{"curfew":"1","curfewCount":"21","inVehicleConfig":"0"},"speedType":{"speed":"1","speedCount":"21","inVehicleConfig":"0"},"valetType":{"valet":"1","valetParkingMode":"0","defaultRadius":"1","defaultRadiusUnit":"3","defaultInterval":"5","defaultIntervalUnit":"3","inVehicleConfig":"0"}},"vrmFeature":{"autoDTC":"1","scheduledDTC":"1","backgroundDTC":"1","manualDTC":"1","healthReport":"0","drivingScore":"1","gasRange":"1","evRange":"0","trip":"1"},"locationFeature":{"gpsStreaming":"0","location":"1","poi":"1","poiCount":"25","push2Vehicle":"1","wayPoint":"1","mapType":"1","surroundView":"0","svr":"1"},"userSettingFeature":{"usmType":"0","calendar":"0","valetParkingMode":"0","wifiHotSpot":"0","otaSupport":"0","digitalKeyOption":"0"}},"heatVentSeat":{},"billingPeriod":{"freeTrial":{"value":12,"unit":0},"freeTrialExtension":{"value":12,"unit":1},"servicePeriod":{"value":60,"unit":1}}},"lastVehicleInfo":{"vehicleNickName":"Niro","preferredDealer":"PA004","licensePlate":"","psi":"","customerType":1,"vehicleStatusRpt":{"statusType":"2","reportDate":{"utc":"20211229124008","offset":-8},"vehicleStatus":{"climate":{"airCtrl":false,"defrost":false,"airTemp":{"value":"75","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,"ign3":false,"transCond":true,"distanceToEmpty":{"value":438,"unit":3},"tirePressure":{"all":0,"frontLeft":0,"frontRight":0,"rearLeft":0,"rearRight":0},"dateTime":{"utc":"20211229124008","offset":-8},"syncDate":{"utc":"20211229121444","offset":-8},"batteryStatus":{"stateOfCharge":100,"sensorStatus":0,"deliveryMode":0},"sleepMode":true,"lampWireStatus":{"headLamp":{},"stopLamp":{},"turnSignalLamp":{}},"windowStatus":{},"engineOilStatus":false,"vehicleMovementHis":false,"engineRuntime":{"value":8,"unit":1},"valetParkingMode":0}},"location":{"coord":{"lat":40.008693,"lon":-75.243275,"alt":61.2,"type":0,"altdo":0},"head":179,"speed":{"value":0,"unit":1},"accuracy":{"hdop":0,"pdop":1},"syncDate":{"utc":"20211229121444","offset":-8}},"financed":true,"financeRegistered":false,"linkStatus":0}}]}} 2021-12-29 07:40:08 ERROR (MainThread) [custom_components.ha_kia_hyundai.vehicle] Unexpected error fetching Vehicle 428408 data: '<=' not supported between instances of 'NoneType' and 'int' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/ha_kia_hyundai/vehicle.py", line 112, in async_update_data await self.api_cloud.update(vehicle=self) File "/config/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 30, in request_with_active_session_wrapper return await func(*args, **kwargs) File "/config/custom_components/ha_kia_hyundai/api_cloud_us_kia.py", line 232, in update if ev_max_dc_charge_level <= 100: TypeError: '<=' not supported between instances of 'NoneType' and 'int' 2021-12-29 07:40:08 DEBUG (MainThread) [custom_components.ha_kia_hyundai.vehicle] Finished fetching Vehicle 428408 data in 0.267 seconds (success: False)

To Reproduce Steps to reproduce the behavior: Simply configure the integration as per standard. It found my car but appears to get a parsing error when processing the results.

Expected behavior No error showing on the integration screen. Data showing in dashboard.

Screenshots [image: image] https://user-images.githubusercontent.com/14153890/147663746-5a0e180f-ad4a-48ce-800d-b976ccd88884.png

— Reply to this email directly, view it on GitHub https://github.com/dahlb/ha_kia_hyundai/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANGZMUHCYY3RR2YE5QIGTUTL7MXANCNFSM5K54UWHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

dahlb commented 2 years ago

this should fix that issue https://github.com/dahlb/ha_kia_hyundai/commit/6d0b78bbaa68258bc4de2d7508322b93165d4416, thanks for including your api responses, always helpful to see the available raw data

jakecolman commented 2 years ago

This worked. I now see my device and sensors. Do you want bug reports on sensors that are not displaying valid data or is this a work in progress and you just need more time?

On Wed, Dec 29, 2021 at 7:10 PM Brendan Dahl @.***> wrote:

this should fix that issue 6d0b78b https://github.com/dahlb/ha_kia_hyundai/commit/6d0b78bbaa68258bc4de2d7508322b93165d4416, thanks for including your api responses, always helpful to see the available raw data

— Reply to this email directly, view it on GitHub https://github.com/dahlb/ha_kia_hyundai/issues/45#issuecomment-1002820417, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADL7RIU2ETB2LWTJYIMKQETUTOPQFANCNFSM5K54UWHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

dahlb commented 2 years ago

@jakecolman if you're seeing sensors with invalid data please let me know and I'll try to address that, likely a discrepancy with vehicle models, I use USA Kia and all my data seems to show up valid but my vehicle is an EV Niro.