Struggling to enable Tapo plug

I’m a newbie attempting to enable my Tapo plug based on fishbigger’s example:

I have pasted the folder from GitHib into my custom components folder and the code into configuration.yaml, when I run Check Configuration I get the following error:

Platform error switch.tapo_p100_control - Integration ‘tapo_p100_control’ not found.

So, what am I doing wrong?

You have to

  • Add integration in custom_component
  • Restart HA
  • Add integration to configuration.yaml
  • Restart HA

Or just reboot

Yes, I’m doing all that.

I’ve just discovered the Full Home Assistant Log which contains many entries regarding the tapo_p100_control. Here it is in it’s entirety:

2021-11-05 08:47:27 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_p100_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-11-05 08:47:27 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-11-05 08:47:27 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-11-05 08:47:34 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server (0 bytes read on a total of 32 expected bytes)

2021-11-05 08:47:34 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server

2021-11-05 08:47:36 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘Canon TS8100 series’ for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background

2021-11-05 08:47:36 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘RM4C MINI’ for broadlink integration not ready yet: [Errno -4000] Network timeout; Retrying in background

2021-11-05 08:47:36 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘RM4 MINI’ for broadlink integration not ready yet: [Errno -4000] Network timeout; Retrying in background

2021-11-05 08:47:39 ERROR (SyncWorker_2) [custom_components.tapo_p100_control.switch] Could not connect to plug. Possibly invalid credentials

2021-11-05 08:47:41 ERROR (MainThread) [homeassistant.components.switch] Error while setting up tapo_p100_control platform for switch

Traceback (most recent call last):

File “/usr/local/lib/python3.9/site-packages/PyP100/PyP100.py”, line 155, in login

self.token = ast.literal_eval(decryptedResponse)[“result”][“token”]

KeyError: ‘result’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 249, in _async_setup_platform

await asyncio.shield(task)

File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 52, in run

result = self.fn(*self.args, **self.kwargs)

File “/config/custom_components/tapo_p100_control/switch.py”, line 44, in setup_platform

add_entities([P100Plug(p100)])

File “/config/custom_components/tapo_p100_control/switch.py”, line 53, in init

self.update()

File “/config/custom_components/tapo_p100_control/switch.py”, line 84, in update

self._p100.login()

File “/usr/local/lib/python3.9/site-packages/PyP100/PyP100.py”, line 159, in login

raise Exception(f"Error Code: {errorCode}, {errorMessage}")

Exception: Error Code: -1501, Invalid Request or Credentials

2021-11-05 08:52:05 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.0.10 (192.168.0.10). (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36)

2021-11-05 08:52:05 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.0.10 (192.168.0.10). (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36)

I wouldn’t know where to start with this lot.

Well, or you actually indicated wrong credentials, or there is a bug on the component.

These are the lines I have in my configuration.yaml file (obviously I’m hiding the actual username and password):

#P100 Plug
switch:
platform: tapo_p100_control
ip_address: 192.168.0.17
email: ‘@*.
password: '

One question, I’ve just copied the tapo_p100_control directory to custom_components; should I have copied the whole directory structure found on Github?

Just the tapo_p100_control directory directly under custom_component

OK, at least I got that right.

I am now looking at configuration.yaml file with the Visual Studio Code rather than the File Editor.

This has highlighted the characters before each line so I have made those consistent with the other entries.

Also it seems to be objecting to the password line saying ‘Incorrect type. Expected “array”’. This has me completely baffled. I have tried replacing the single quotes with double quotes to no avail.

I have noticed that with other entries in configuration.yamp, there is a hyphen (-) before the word ‘platform’. Trying this removes the ‘Incorrect type’ error but still tapo_p100_control fails to load.

Given up with the Tapo P100 Control and having much more luck with the Tapo: Cameras Control:

|[Custom Component] Tapo: Cameras Control|