Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since HA 2023.5.x ValueError #50

Open
thecem opened this issue May 8, 2023 · 3 comments
Open

Since HA 2023.5.x ValueError #50

thecem opened this issue May 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@thecem
Copy link

thecem commented May 8, 2023

Logger: homeassistant.components.mqtt.models
Source: components/sensor/__init__.py:583 
Integration: MQTT (documentation, issues) 
First occurred: 18:44:21 (91 occurrences) 
Last logged: 20:16:38

Exception raised when updating state of sensor.car_vehicleinfo_tripsinfo_trips_array_1_totalelectricdistance_value, topic: 'homeassistant/sensor/ZFAEFAC41NX0_car_vehicleInfo_tripsInfo_trips_array_1_totalElectricDistance_value/state' with payload: b'null'
Exception raised when updating state of sensor.car_vehicleinfo_tripsinfo_trips_array_1_totaldistance_value, topic: 'homeassistant/sensor/ZFAEFAC41NX0_car_vehicleInfo_tripsInfo_trips_array_1_totalDistance_value/state' with payload: b'null'
Exception raised when updating state of sensor.car_vehicleinfo_tripsinfo_trips_array_1_energyused_value, topic: 'homeassistant/sensor/ZFAEFAC41NX050548_car_vehicleInfo_tripsInfo_trips_array_1_energyUsed_value/state' with payload: b'null'
Exception raised when updating state of sensor.car_vehicleinfo_tripsinfo_trips_array_1_averageenergyused_value, topic: 'homeassistant/sensor/ZFAEFAC41NX0car_vehicleInfo_tripsInfo_trips_array_1_averageEnergyUsed_value/state' with payload: b'null'
Exception raised when updating state of sensor.car_vehicleinfo_tripsinfo_trips_array_1_totalhybriddistance_value, topic: 'homeassistant/sensor/ZFAEFAC41NX0car_vehicleInfo_tripsInfo_trips_array_1_totalHybridDistance_value/state' with payload: b'null'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 579, in state
    numerical_value = int(value)
ValueError: invalid literal for int() with base 10: 'null'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 270, in process_write_state_requests
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 583, in state
    raise ValueError(
ValueError: Sensor sensor.car_vehicleinfo_tyrepressure_array_0_pressure_value has device class None, state class None unit kPa and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: null (<class 'str'>)

Device class should be pressure

same or similar problem here:

robinostlund/homeassistant-volkswagencarnet#474

@wubbl0rz
Copy link
Owner

oh no 🙈 i didnt upgrade myself yet.

@wubbl0rz wubbl0rz added the bug Something isn't working label May 10, 2023
@moerpel
Copy link

moerpel commented Jul 9, 2023

Is there any status when this will be fixed?

@Henry-Sir
Copy link

Hi

Is there a status update?

Here my sensor with with payload 'null' (Fiat 500e new model 2023):

Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tyrepressure_array_0_pressure_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tyrepressure_array_1_pressure_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tyrepressure_array_2_pressure_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tyrepressure_array_3_pressure_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tripsinfo_trips_array_0_totalelectricdistance_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tripsinfo_trips_array_0_totalhybriddistance_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tripsinfo_trips_array_1_totalelectricdistance_value with payload: b'null'
Exception raised when updating state of sensor.fiat_500e_vehicleinfo_tripsinfo_trips_array_1_totalhybriddistance_value with payload: b'null'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants