TP-Link Tapo P100

Yup !

Link with with my Xiaomi button and this is working

2020-10-31 10_37_42-Window

Thank you it’s amazing ! I was searching a solution for months

1 Like

Do you have a github account that I can add you as a contributor to the readme as you helped massively to trouble shoot the intergration :slight_smile:

Oh of course thank you

After downlading the last commit, you have littles bugs in it :

Line 57 switch.py

return self.is_on

Instead of

return self._is_on

And multiples spaces instead of indentation, you should juste replace them by tabulation and it’s working perfectly

I will change that now

Thanks everybody for all your help on this. Thanks to @vbtrek for raising this question. I have released the first fully working version on github along with the installation instructions. Please continue the discussion at [Custom Component] Tapo P100 Plug Control and I will continue to update the intergration with new features (Starting with getting the name of the plug)

3 Likes

Thank you for all of your work everyone, Its great to see.

Do you think its likely for TP Link to change the way it works so this stops working?

Only reason I ask is because not being able to control the Tapo plugs other than with the app (plus smart Assistants) has been kept me from buying them but with this I might buy.

Good job @fishbigger. I got it working without much fuss. :slight_smile:

any idea guys ?

Logger: homeassistant.components.switch
Source: custom_components/tapo_p100_control/switch.py:79
Integration: Switch (documentation, issues)
First occurred: 7:51:03 PM (1 occurrences)
Last logged: 7:51:03 PM

Error while setting up tapo_p100_control platform for switch

Traceback (most recent call last): File “/usr/local/lib/python3.8/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 197, 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 41, in setup_platform add_entities([P100Plug(p100)]) File “/config/custom_components/tapo_p100_control/switch.py”, line 49, in init self.update() File “/config/custom_components/tapo_p100_control/switch.py”, line 79, in update self._p100.login() File “/usr/local/lib/python3.8/site-packages/PyP100/PyP100.py”, line 159, in login raise Exception(f"Error Code: {errorCode}, {errorMessage}") Exception: Error Code: -1501, Invalid Request or Credentials

I’m getting the following configuration error:
Platform error switch.tapo_p100_control - Integration ‘tapo_p100_control’ not found.

Any idea’s please?

Have you restarted your Home Assistant after installing the custom integration?

Are you 100% your credentials are ok? From the error it seems that the crendentials don’t appear to be correct,
Exception: Error Code: -1501, Invalid Request or Credentials

I can’t restart Home Assistant with the config error, Checked and rechecked credentials. Error log

Log Details (ERROR)

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:383
Integration: Hass.io (documentation, issues)
First occurred: 20:16:31 (1 occurrences)
Last logged: 20:16:31

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

Presuming you’ve copied the folder across successfully, it sounds like you need to comment out (put a # in front of) the Tapo config lines and, if you’ve not already, restart HA. It should then recognise the folder in Custom Components, and then you can add them back in and restart again.

Folder copied to config\custom_components. Commented out switch: section, restarted HA and reinstated switch: same issue. Also tried recreating new Tapo account with no joy.
Could it be a permissions issue? I don’t know how to check that

oops found a typo in folder name. Now have the following error:

Platform error switch.tapo_p100_control - No module named ‘PyP100’

Hi You need to restart Hassio then add the Yaml config

Is there anyway to make it more secure than just having the account password right in the script?

I understand if not, just wondering.

A little more secure is to create secrets.yaml, and reference everything from there. At least then you know where all the sensitive information is. Not more secure per se, I think, but stops it being accidentally shared.

1 Like

How do I add more than one P100 plug?
I got one plug working.
However, if I list multiple IP addresses in the config file, they don’t register.