Errors in HA log

I have been seeing this error in HA logs for several months now. HA has been upgraded several times but the error still remains. It is still there as of 2024.1.5. I have the mobile app installed on two phones, one Android and one iPhone. Both have the latest version of app. How to remove this error?

Thanks…!!

TypeError: 'async_generator' object is not callable
2024-01-22 07:02:31.496 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 639, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Not Charging'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: 'Not Charging'

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 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1282, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()

1 Like

Same problem, with an iPad. The error does not seem to stop the integration from working in general, but I hate seeing the error in the logs.

And I am pretty sure that no one from HA can be bothered to fix such an obvious bug.

The code is capturing a numeric value but when the device is not charging, the numeric variable gets a string and hence the error.

I also want to see a clean log and such errors bother me.

1 Like