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

HA error due car sensor not numeric #3762

Closed
OzGav opened this issue Aug 6, 2023 · 0 comments · Fixed by #3764
Closed

HA error due car sensor not numeric #3762

OzGav opened this issue Aug 6, 2023 · 0 comments · Fixed by #3764
Labels

Comments

@OzGav
Copy link

OzGav commented Aug 6, 2023

Home Assistant Android app version(s):

Android version(s):
13

Device model(s):
Pixel 4a

Home Assistant version:
2023.8.1

Last working Home Assistant release (if known):

Description of problem, include YAML if issue is related to notifications:
Using the 2023.7.8-full version of app and the car sensors. Noticed this in the HA log:

2023-08-05 10:32:49.611 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform mobile_app

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 593, in state
numerical_value = float(value) # type:ignore[arg-type]

^^^^^^^^^^^^

ValueError: could not convert string to float: 'Open Home Assistant app to activate the sensor'
The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
state = self._stringify_state(available)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
if (state := self.state) is None:

^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 595, in state
raise ValueError(
ValueError: Sensor sensor.gavin_pixel_4a_car_battery has device class 'battery', state class 'None' unit '%' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'Open Home Assistant app to activate the sensor' (<class 'str'>)

Companion App Logs:


Screenshot or video of problem:

Additional information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants