[Custom Component] Tapo P100 Plug Control

Still getting the

Error Code: -1501, Invalid Request or Credentials

But I was able to login via the cloud api using postman and see all my devices registered via the cloud.
The thing that hinders me and got me stumped is in the login() function.
I reviewed the code and saw that this part depends on the encryption that was used by the app. I am not sure if the current PyP100 is aligned with the current Tapo App or I’m doing something wrong.

But I think it’s safe to assume that the encryption step of the app does not need to know the type of the device nor the model. I want to reverse engineer the app but I’m still hoping someone here still has the answer.

My Tapo app is currently 2.2.36

I have Home Assistant on Pi Zero, when installing the Tapo integration I get the error Platform error switch.tapo_p100_control - No module named ‘PyP100’, I see that running pip3 install PyP100 would fix this but as this is a pre install image I cant install python. Could anone advise on this.

Thanks in advance Richard.

I had this issue. Initial attempt failed with the PyP100 error. Deleted the installation and the deleted the lines from my yams file, restart. Then began again, simply copying tapo_p100_control folder into the custom_components folder and restarting the server before adding the lines to configuration.yaml solved it.

1 Like

I will give this a try. Thanks. Will post my result. :slight_smile:

Thank you! I had the same problem as @Richard_Erbe, running hassio on Rpi3B and that fixed it. Looks like order matters. For error no module found - PyP100, I copies files from repo Github PyP100, to the same folder as custom component: image

EDIT: @fishbigger thank you for all of your amazing work!

I’m just gonna close out my issue here. I managed to make my Tapo P105 Plug just by using an 8 character password with 1 number.

ex.
tplinkz1

Edit:
Just tested this component on Tapo L510E Bulb, and it works as a light entity as well.

switch:
  - platform: tapo_p100_control
    ip_address: 192.168.1.20
    email: [email protected]
    password: tplinkz1
light:
  - platform: switch
    name: Dirty Kitchen Bulb
    entity_id: switch.dkbulb

Note that dkbulb is the actual name of the bulb from the Tapo app.

Conclusion:
This component supports Tapo P105 and Tapo L510E

Latest Version now on pypi install using

pip3 install pyP100==0.0.10

It now has a setBrightness function created by Sonic74 on github which I will now work on implementing into ha

1 Like

The documentation for creating lights in ha is less obvious than creating switches so I’m going to tackle adding the lights at a later date :slight_smile:

1 Like

Happy Holidays!

I’ve been monitoring the component for some time now and I saw some behaviours that are quite problematic:

  1. Tapo devices gets disconnected from time to time HA
  • This resulted my aircon to run for hours lol
  1. Not too problematic - the response time of the switch is 1 to 2 seconds late
  2. This Log:
Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:603
Integration: Switch (documentation, issues)
First occurred: 2:50:21 AM (114 occurrences)
Last logged: 3:46:52 AM

Updating tapo_p100_control switch took longer than the scheduled update interval 0:00:30

Unsure what is happening. I might try to debug if I have free time but the holiday season is in.

1 Like

Just wondering if there is any particular setup that need to be set up to run with the Tapo bulbs, just trying the 0.0.11 version though python on my computer just to have them turn on/off/brightness, but still getting the -1501 error when trying to set up. Running the L510B bulbs with 1.1.8 firmware, i saw there was some suggestion that i need to talk to TPlink to downgrade the firmware potentially to enable the connections?

Dude, you probably shouldn’t be posting your full login details including password on the internet…

thank you, didnt think, long day

Don’t forget to change the password for security :wink:

Was this resolved? I am having the same issue

With the Tapo P100? I just found HA yesterday and I was trying to do this and the only solution was to change the password of the tapo login. Don’t know if this helps.

Home Assistant Tapo P100 Control V2 is here

The custom integration now has support for the L510 series of bulbs!! Please let me know either here or on github what features I should add next.

Installation

To install the Tapo P100 integration copy the tapo_p100_control folder from the github into the custom_components folder on your home assistant instance then these lines should be added to your configuration.yaml file.

#P100 or P105 Plug
switch:
    platform: tapo_p100_control
    ip_address: 192.168.x.x
    email: [email protected]
    password: Password123
    
#L510 Series Bulbs
light:
    platform: tapo_p100_control
    ip_address: 192.168.x.x
    email: [email protected]
    password: Password123
2 Likes

Just created an issue on GitHub but in case anyone here has a quick fix for me, I had this working then this evening my Node Red flow to turn the lights on failed. Updated to the new version and also HA has updated to 2012.01. Seeing the below error:

Error while setting up tapo_p100_control platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/tapo_p100_control/switch.py", line 43, in setup_platform
    add_entities([P100Plug(p100)])
  File "/config/custom_components/tapo_p100_control/switch.py", line 52, in __init__
    self.update()
  File "/config/custom_components/tapo_p100_control/switch.py", line 85, in update
    self._name = self._p100.getDeviceName()
  File "/usr/local/lib/python3.8/site-packages/PyP100/PyP100.py", line 285, in getDeviceName
    data = self.getDeviceInfo()
  File "/usr/local/lib/python3.8/site-packages/PyP100/PyP100.py", line 278, in getDeviceInfo
    decryptedResponse = self.tpLinkCipher.decrypt(r.json()["result"]["response"])
KeyError: 'result'

Hi, I realized too late that your implementation already existed, so I made my own. I saw on the repository that there are credential problems. In my implementation, which is based on the plugp100 library, there are no problems. If you are interested, we could merge our works by opening a pull request. In addition, since I had planned to add the integration configuration via UI to my implementation, I can add it directly to this one that is most used.

1 Like

Do you want to open an issue on this integrations GitHub to discuss it :slight_smile:

1 Like

2021.1.1 had fixed this issue it seems.