home-assistant-tapo-p100: "Unexpected Error" when adding device (P110)

Version of the integration

1.3.2

Configuration

P110 Firmware 1.1.6

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.tapo.config_flow
Source: custom_components/tapo/config_flow.py:78
Integration: Tapo Controller (documentation, issues)
First occurred: 13:08:12 (2 occurrences)
Last logged: 13:08:34

Failed to setup 'tapo'

Describe the bug

I got four P110 smart plugs. Added them to the Tapo app and updated them to the latest firmware. When I try to add them to HA I get “Unexpected Error” and the log pasted above. Any ideas where this comes from?

My mail address contains only lower case letters and I did not change the tapo password.

When I intentionally use wrong credentials I the “Invalid authentication” error.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 36 (10 by maintainers)

Most upvoted comments

I had the same problems, but with v1.3.3 I was able to add the devices. thanks for the excellent work

Yes. It doesn’t work 😦. The same issue.

When reverted back to the old code (in line 45 and 96) I was able to start the integration, however “Unexpected Error” when adding back switches.

When switches were added in the configuration the following error appeared:

2022-12-31 17:24:24.863 ERROR (MainThread) [homeassistant.config] Platform error: switch Traceback (most recent call last): File “/home/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py”, line 728, in get_platform cache[full_name] = self._import_platform(platform_name) File “/home/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py”, line 745, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File “/usr/lib/python3.9/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1030, in _gcd_import File “<frozen importlib._bootstrap>”, line 1007, in _find_and_load File “<frozen importlib._bootstrap>”, line 986, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 680, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 790, in exec_module File “<frozen importlib._bootstrap>”, line 228, in _call_with_frames_removed File “/home/homeassistant/.homeassistant/custom_components/tapo/switch.py”, line 11, in <module> from custom_components.tapo.tapo_entity import TapoEntity File “/home/homeassistant/.homeassistant/custom_components/tapo/tapo_entity.py”, line 13, in <module> class TapoEntity(CoordinatorEntity): File “/home/homeassistant/.homeassistant/custom_components/tapo/tapo_entity.py”, line 23, in TapoEntity def last_state(self) -> TapoDeviceState | None: TypeError: unsupported operand type(s) for |: ‘type’ and ‘NoneType’