Open instantdreams opened 3 months ago
What year and model? Looks like they finally are not using the crazy temp approach of the past. This section of code will need to detect if the car is providing a real temp vs hex and not touch it if a real temp:
This is a 2024 Kona Preferred (SE) in Canada.
Checking HA this morning, the car is connected and information can be displayed, but the error message is still occurring:
homeassistant | 2024-06-27 08:46:10.114 ERROR (MainThread) [custom_components.kia_uvo.coordinator] Error fetching kia_uvo data: Error communicating with API: invalid literal for int() with base 16: '19.5'
The payload has 19.5 as the airTemp:
homeassistant | 2024-06-27 08:46:10.111 DEBUG (SyncWorker_51) [hyundai_kia_connect_api.KiaUvoApiCA] hyundai_kia_connect_api - get_cached_vehicle_status response {'responseHeader': {'responseCode': 0, 'responseDesc': 'Success'}, 'result': {'status': {'lastStatusDate': '20240627143621', 'airCtrlOn': True, 'engine': True, 'doorLock': False, 'doorOpen': {'frontLeft': 0, 'frontRight': 0, 'backLeft': 0, 'backRight': 0}, 'trunkOpen': False, 'airTempUnit': 'C', 'airTemp': {'value': '19.5', 'unit': 0}, 'defrost': False, 'lowFuelLight': False, 'acc': True, 'evStatus': {'batteryCharge': False, 'batteryStatus': 76, 'batteryPlugin': 0, 'dischargingLimit': 20, 'remainTime2': {'etc1': {'value': 62, 'unit': 1}, 'etc2': {'value': 450, 'unit': 1}, 'etc3': {'value': 105, 'unit': 1}, 'atc': {'value': 0, 'unit': 1}}, 'drvDistance': [{'rangeByFuel': {'evModeRange': {'value': 317.0, 'unit': 1}, 'totalAvailableRange': {'value': 317.0, 'unit': 1}}, 'type': 2}], 'reservChargeInfos': {'reservChargeInfo': {'reservChargeInfoDetail': {'reservInfo': {'day': [5, 1, 6, 0, 4, 2, 3], 'time': {'time': '3170', 'timeSection': 0}}, 'reservChargeSet': False, 'reservFatcSet': {'defrost': False, 'airTemp': {'value': 'OFF', 'unit': 0, 'hvacTempType': 0}, 'airCtrl': 2, 'heating1': 0}}}, 'reserveChargeInfo2': {'reservChargeInfoDetail': {'reservInfo': {'day': [5, 1, 6, 0, 4, 2, 3], 'time': {'time': '3170', 'timeSection': 0}}, 'reservChargeSet': False, 'reservFatcSet': {'defrost': False, 'airTemp': {'value': 'OFF', 'unit': 0, 'hvacTempType': 0}, 'airCtrl': 2}}}, 'offpeakPowerInfo': {'offPeakPowerFlag': 0, 'offPeakPowerTime1': {'starttime': {'time': '3170', 'timeSection': 0}, 'endtime': {'time': '3170', 'timeSection': 0}}, 'offPeakPowerTime2': {'starttime': {'time': '3170', 'timeSection': 0}, 'endtime': {'time': '3170', 'timeSection': 0}}}, 'reservFlag': 0, 'ect': {'start': {'day': 9, 'time': {'time': '3163', 'timeSection': 0}}, 'end': {'day': 7, 'time': {'time': '3163', 'timeSection': 0}}}, 'targetSOClist': [{'plugType': 0, 'targetSOClevel': 100}, {'plugType': 1, 'targetSOClevel': 100}]}, 'batteryPreconditiong': False, 'chargePortDoorOpenStatus': 0, 'wirelessCharging': False, 'batterySoh': 100, 'sequenceDetails': 0, 'sequenceSubcode': 0}, 'hoodOpen': False, 'transCond': True, 'steerWheelHeat': 0, 'sideBackWindowHeat': 0, 'tirePressureLamp': {'tirePressureLampAll': 1, 'tirePressureLampFL': 0, 'tirePressureLampFR': 0, 'tirePressureLampRL': 0, 'tirePressureLampRR': 0}, 'battery': {'batSoc': 96, 'batState': 0, 'sjbDeliveryMode': 1, 'batSignalReferenceValue': {'batWarning': 65}, 'powerAutoCutMode': 2}, 'remoteIgnition': True, 'seatHeaterVentInfo': {'drvSeatHeatState': 2, 'astSeatHeatState': 2, 'rlSeatHeatState': 2, 'rrSeatHeatState': 2}, 'lampWireStatus': {'headLamp': {'headLampStatus': False, 'leftLowLamp': False, 'rightLowLamp': False, 'leftHighLamp': False, 'rightHighLamp': False, 'leftBifuncLamp': False, 'rightBifuncLamp': False}, 'stopLamp': {'stopLampStatus': False, 'leftLamp': False, 'rightLamp': False}, 'turnSignalLamp': {'turnSignalLampStatus': False, 'leftFrontLamp': False, 'rightFrontLamp': False, 'leftRearLamp': False, 'rightRearLamp': False}}, 'smartKeyBatteryWarning': False, 'washerFluidStatus': False, 'breakOilStatus': False, 'engineRuntime': {}}}}
Checking further, there are more detailed error messages:
homeassistant | 2024-06-27 08:47:14.801 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.kona_ev_set_temperature for domain sensor with platform kia_uvo
homeassistant | Traceback (most recent call last):
homeassistant | File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 658, in state
homeassistant | numerical_value = int(value)
homeassistant | ^^^^^^^^^^
homeassistant | ValueError: invalid literal for int() with base 10: 'OFF'
homeassistant |
homeassistant | During handling of the above exception, another exception occurred:
homeassistant |
homeassistant | Traceback (most recent call last):
homeassistant | File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 661, in state
homeassistant | numerical_value = float(value)
homeassistant | ^^^^^^^^^^^^
homeassistant | ValueError: could not convert string to float: 'OFF'
homeassistant |
homeassistant | The above exception was the direct cause of the following exception:
homeassistant |
homeassistant | Traceback (most recent call last):
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
homeassistant | await coro
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity
homeassistant | await entity.add_to_platform_finish()
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish
homeassistant | self.async_write_ha_state()
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state
homeassistant | self._async_write_ha_state()
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state
homeassistant | state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1061, in __async_calculate_state
homeassistant | state = self._stringify_state(available)
homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant | File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in _stringify_state
homeassistant | if (state := self.state) is None:
homeassistant | ^^^^^^^^^^
homeassistant | File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 665, in state
homeassistant | raise ValueError(
homeassistant | ValueError: Sensor sensor.kona_ev_set_temperature has device class 'temperature', state class 'None' unit '°C' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'OFF' (<class 'str'>)
Hope that helps!
Region and Brand of car Canada Hyundai
Version of the integration 2.25.0
Describe the bug After entering integration configuration details the following message appears:
No integration details can be seen.
Debug logs if an error occurred Debug logs were enabled and the configuration was refreshed.
Access token is correctly generated. Vehicle details are retrieved.
To Reproduce key
airTemp
has value20.0
and unit0
, which is the only matching value in the debug log.Expected behavior Exception not to be raised by temperature value.