Page 1 of 2

TP-Link Tapo plugin

PostPosted: Fri Oct 14, 2022 10:44 am
by racarter
New plugin for TP-Link Tapo smart plugs and bulbs is now in the plugin store.

Tapo smart plugs are a quarter of the price of their Z-Wave equivalents so are a cost-effective way to monitor energy usage.

Installation of the plugin is not straightforward; please read the following requirements carefully!

The plugin needs two Python libraries. In Terminal, install them with these commands:

pip3 install pkcs7

pip3 install Crypto

Then navigate to:

Macintosh HD/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages

and rename folder 'crypto' to 'Crypto'

If you get error messages saying Crypto is missing when you start the plugin (sometimes happens with M1 Macs) just copy the version I've included in the Resources folder of the plugin to the above folder and reload the plugin.

This sounds more complicated than it is, but unfortunately it's necessary because the Crypto library has to be installed manually.

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 9:59 am
by autolog
I have installed version 2022.3.0 on my M1 Mac mini running macOS Monterey 12.6.1 and Indigo 2022.1.2.

I am getting the flooring error and the plugin won't start:
Code: Select all
   Starting plugin "Tapo 2022.3.0" (pid 92483)
   Tapo Error                      Error in plugin execution InitializeMain:

  File "plugin.py", line 20, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/Tapo.IndigoPlugin/Contents/Server Plugin/tapo_plug/tapoPlugApi.py", line 11, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/Tapo.IndigoPlugin/Contents/Server Plugin/tapo_plug/tapoEncryption.py", line 7, in <module>
type: No module named 'Crypto'

   Stopping plugin "Tapo 2022.3.0" (pid 92483)
   Stopped plugin "Tapo 2022.3.0"
I have pip3 installed Crypto:
Code: Select all
user@mac ~ % pip3  show crypto
Name: crypto
Version: 1.4.1
Summary: Simple symmetric GPG file encryption and decryption
Home-page: https://github.com/chrissimpkins/crypto
Author: Christopher Simpkins
Author-email: git.simpkins@gmail.com
License: MIT license
Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
Requires: Naked, shellescape
Required-by:
Probably missing something but can't see it at the moment. :?

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 10:16 am
by matt (support)
Try using pip3.10 instead of just pip3 to see if it in installed (and install it if it isn't).

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 10:20 am
by autolog
It was already there and I didn't need to install it:
Code: Select all
user@mac ~ % pip3.10 show crypto
Name: crypto
Version: 1.4.1
Summary: Simple symmetric GPG file encryption and decryption
Home-page: https://github.com/chrissimpkins/crypto
Author: Christopher Simpkins
Author-email: git.simpkins@gmail.com
License: MIT license
Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
Requires: shellescape, Naked
Required-by:

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 10:42 am
by jay (support)
Did you do the rename step in the instructions in the first post? Not sure what that's necessary, but it is there...

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 10:49 am
by racarter
Unfortunately the renaming is necessary. I’m not the only developer who uses this library, and we all have to do the same.

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 10:56 am
by autolog
jay (support) wrote:
Did you do the rename step in the instructions in the first post? Not sure what that's necessary, but it is there...

Apparently not! :oops:

It is starting OK now, once I renamed the folder and then overwrote it with the copy from the plugin Resources folder. :)

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 11:16 am
by autolog
I am getting a "comms failed" message :?:

I have put in the correct login details and IP address AFAICS.

My plug is a Tapo P100, Hardware Version 2.0, Firmware Version 1.1.0 Build 220720 Real.163239.00

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 11:45 am
by racarter
The P100 sockets are not energy-monitoring. The main purpose of the plugin is for energy monitoring - hence my placing it in that category in the plugin store. It supports the P110 sockets and all bulbs at the moment.

If you DM me with your email address I'll send you a debug version of the plugin and see if I can extend it to support the P100.

Re: TP-Link Tapo plugin

PostPosted: Mon Oct 31, 2022 12:36 pm
by autolog
New version 2022.4.0 works. :D

I can now turn my plug on and off.

Thanks for the quick update. :)

Re: TP-Link Tapo plugin

PostPosted: Sat Feb 11, 2023 4:37 pm
by jonc
I am also using 2022.4.0 with a P100 and getting comms failed error. Device works normally with the Tapo app, and I am certain of its local IP address. Any suggestions?

Re: TP-Link Tapo plugin

PostPosted: Sat Feb 11, 2023 4:49 pm
by racarter
Any clues in the comms? Click the tickbox in config to copy messages to the event log.

The API will not respond while you have the Tapo app open on your phone, by the way.

Re: TP-Link Tapo plugin

PostPosted: Sun Feb 12, 2023 9:08 am
by siclark
Cheers for the heads up on these. Under a tenner each with an Amazon multipack! Bargain


Sent from my iPhone using Tapatalk

Re: TP-Link Tapo plugin

PostPosted: Sun Feb 12, 2023 11:27 am
by jonc
No clue in the comms. I have made sure to quit the Tapo app.

Re: TP-Link Tapo plugin

PostPosted: Sun Feb 12, 2023 11:43 am
by racarter
Did you click the tickbox in config to copy messages to the event log?