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
391 stars 81 forks source link

Battery Status from Kia USA Changed in API #841

Open seiggy opened 4 months ago

seiggy commented 4 months 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 USA - 2023 Kia EV6 GT-Line Version of the integration latest

Describe the bug 12V Battery status showing up as "Unknown", enabled debug logging, the JSON object is no longer returning an int for batteryStatus, instead returns an object now with multiple fields (could be due to my 12V battery being dead right now)

Debug logs if an error occurred

{
  "status": {
    "statusCode": 0,
    "errorType": 0,
    "errorCode": 0,
    "errorMessage": "Success with response body"
  },
  "payload": {
    "vehicleInfoList": [
      {
        "vinKey": "~~~REDACTED~~~",
        "vehicleConfig": {
          "vehicleDetail": {
            "vehicle": {
              "vin": "~~~REDACTED~~~",
              "trim": {
                "modelYear": "2023",
                "salesModelCode": "N4362",
                "optionGroupCode": "010",
                "modelName": "EV6",
                "factoryCode": "AS",
                "projectCode": "CV",
                "trimName": "GT-LINE",
                "driveType": "1",
                "transmissionType": "1",
                "ivrCategory": "5",
                "btSeriesCode": "Y"
              },
              "telematics": 1,
              "mileage": "16530",
              "mileageSyncDate": "20240223014104",
              "exteriorColor": "YACHT BLUE",
              "exteriorColorCode": "DU3",
              "fuelType": 4,
              "invDealerCode": "NC043",
              "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,
              "headUnitType": "N",
              "displayType": "AVN5.0WT",
              "headUnitName": "avn5em"
            },
            "images": [
              {
                "imageName": "2023-ev6-gt-line-du3.png",
                "imagePath": "/content/dam/kia/us/owners/image/vehicle-app/2023/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.0WT"
            }
          },
          "maintenance": {
            "nextServiceMile": 7469.4004,
            "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": "NC043",
          "licensePlate": "",
          "psi": "",
          "customerType": 0,
          "enrollment": {
            "provStatus": "4",
            "enrollmentStatus": "1",
            "enrollmentType": "0",
            "registrationDate": "20230119",
            "expirationDate": "20240119",
            "expirationMileage": "100000",
            "freeServiceDate": {
              "startDate": "20230119",
              "endDate": "20240119"
            },
            "evEnrollmentCode": "~~~REDACTED~~~"
          },
          "activeDTC": {
            "dtcActiveCount": "0"
          },
          "vehicleStatusRpt": {
            "statusType": "2",
            "reportDate": {
              "utc": "20240224162447",
              "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": 0,
                "batteryPlugin": 0,
                "batteryPrecondition": false,
                "remainChargeTime": [
                  {
                    "remainChargeType": 1,
                    "timeInterval": {
                      "value": 0,
                      "unit": 4
                    }
                  },
                  {
                    "remainChargeType": 2,
                    "timeInterval": {
                      "value": 0,
                      "unit": 4
                    }
                  },
                  {
                    "remainChargeType": 3,
                    "timeInterval": {
                      "value": 0,
                      "unit": 4
                    }
                  }
                ],
                "drvDistance": [
                  {
                    "type": 2,
                    "rangeByFuel": {
                      "evModeRange": {
                        "value": 0,
                        "unit": 0
                      },
                      "totalAvailableRange": {
                        "value": 0,
                        "unit": 0
                      }
                    }
                  }
                ],
                "syncDate": {
                  "utc": "20240223164104",
                  "offset": -8
                },
                "targetSOC": [
                  {
                    "plugType": 0,
                    "targetSOClevel": 0,
                    "dte": {
                      "type": 2,
                      "rangeByFuel": {
                        "gasModeRange": {
                          "value": 0,
                          "unit": 0
                        },
                        "evModeRange": {
                          "value": 0,
                          "unit": 0
                        },
                        "totalAvailableRange": {
                          "value": 0,
                          "unit": 0
                        }
                      }
                    }
                  },
                  {
                    "plugType": 1,
                    "targetSOClevel": 0,
                    "dte": {
                      "type": 2,
                      "rangeByFuel": {
                        "gasModeRange": {
                          "value": 0,
                          "unit": 0
                        },
                        "evModeRange": {
                          "value": 0,
                          "unit": 0
                        },
                        "totalAvailableRange": {
                          "value": 0,
                          "unit": 0
                        }
                      }
                    }
                  }
                ],
                "wirelessCharging": false
              },
              "ign3": false,
              "transCond": true,
              "tirePressure": {
                "all": 0
              },
              "dateTime": {
                "utc": "20240224162447",
                "offset": -8
              },
              "syncDate": {
                "utc": "20240223164104",
                "offset": -8
              },
              "batteryStatus": {
                "sensorStatus": 1,
                "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,
              "fuelLevel": 0,
              "washerFluidStatus": false,
              "brakeOilStatus": false,
              "engineRuntime": {},
              "remoteControlAvailable": 1,
              "valetParkingMode": 0,
              "rsaStatus": 0,
              "lightStatus": {
                "tailLampStatus": 0,
                "hazardStatus": 0
              },
              "systemCutOffAlert": 0
            }
          },
          "location": {
            "coord": {
              "lat": 35.98854722,
              "lon": -80.0275027778,
              "alt": 292,
              "type": 0,
              "altdo": 0
            },
            "head": 147,
            "speed": {
              "value": 0,
              "unit": 1
            },
            "accuracy": {
              "hdop": 10,
              "pdop": 28
            },
            "syncDate": {
              "utc": "20240223164104",
              "offset": -8
            }
          },
          "financed": true,
          "financeRegistered": true,
          "linkStatus": 0,
          "rsaStatus": 0,
          "primaryOwnerID": "~~~REDACTED~~~"
        }
      }
    ]
  }
}

Outlined here: https://github.com/fuatakgun/kia_uvo/blob/master/README.md

To Reproduce

Expected behavior

I assume that the sensorStatus / warning values relate to an error state and should be parsed and displayed as the sensor state instead of "Unavailable" if possible.

Screenshots If applicable, add screenshots to help explain your problem.

image

Additional context

DReffects commented 3 months ago

Bumo