home-assistant-tapo-p100
home-assistant-tapo-p100 copied to clipboard
P110 Month and Daily Energy Unavailable
Version of the integration
3.1.2
Configuration
Tapo P110 v 1.3.0 Build 230905
Describe the bug
After I restarted Home Assistant my Month and Daily energy entities became unavailable. This has happened before and so I tried to reload the integration. After that I tried removing the device and adding again, updating the integration, update Home Assistant and nothing worked. I tried seeing current issues but I only found old ones that were fixed by previous updates.
Error adding entity sensor.nao_mexer_month_energy for domain sensor with platform tapo
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1359, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 543, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/sensor.py", line 98, in native_value
return self._sensor_source.get_value(self.coordinator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tapo/sensors/__init__.py", line 41, in get_value
return energy.energy_info.month_energy / 1000
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'month_energy'