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

P110 - cannot control switch when energy sensors are enabled #190

Open
KoenVcBE opened this issue May 27, 2024 · 0 comments
Open

P110 - cannot control switch when energy sensors are enabled #190

KoenVcBE opened this issue May 27, 2024 · 0 comments

Comments

@KoenVcBE
Copy link

This weekend I updated a P110 (V1) to the latest firmware (1.3.0 build 230905 rel 152200)
After processing the update, suddenly the 'today energy' sensor started working (printing out the actual load) but the switch became "not provided" within HASS.
To verify the issue, I updated another P110 (V1) from 1.1.6 build 221114 rel 203339 (working) to 1.3.0 (not working anymore) ending up with the same result.

When I disabled all energy sensors, the ability to switch on/off started working again.

Debug log:
2024-05-27 10:35:53.196 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 4.235 seconds (success: True)
2024-05-27 10:35:53.197 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
update_callback()
File "/config/custom_components/tapo/entity.py", line 45, in _handle_coordinator_update
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 26, in get_value
return energy.energy_info.today_energy / 1000
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'today_energy'
2024-05-27 10:35:54.052 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:
2024-05-27 10:35:54.053 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 10.001 seconds (success: False)
2024-05-27 10:35:54.996 ERROR (MainThread) [custom_components.tapo.coordinators] Error fetching tapo data: Unexpected exception:
2024-05-27 10:35:54.996 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 10.001 seconds (success: False)

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

No branches or pull requests

1 participant