TP-Link Tapo plugin

Posted on
Fri Oct 14, 2022 10:44 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

TP-Link Tapo plugin

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.

Posted on
Mon Oct 31, 2022 9:59 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: TP-Link Tapo plugin

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. :?

Posted on
Mon Oct 31, 2022 10:16 am
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: TP-Link Tapo plugin

Try using pip3.10 instead of just pip3 to see if it in installed (and install it if it isn't).

Image

Posted on
Mon Oct 31, 2022 10:20 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: TP-Link Tapo plugin

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:

Posted on
Mon Oct 31, 2022 10:42 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: TP-Link Tapo plugin

Did you do the rename step in the instructions in the first post? Not sure what that's necessary, but it is there...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 31, 2022 10:49 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: TP-Link Tapo plugin

Unfortunately the renaming is necessary. I’m not the only developer who uses this library, and we all have to do the same.

Posted on
Mon Oct 31, 2022 10:56 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: TP-Link Tapo plugin

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. :)

Posted on
Mon Oct 31, 2022 11:16 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: TP-Link Tapo plugin

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

Posted on
Mon Oct 31, 2022 11:45 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: TP-Link Tapo plugin

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.

Posted on
Mon Oct 31, 2022 12:36 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: TP-Link Tapo plugin

New version 2022.4.0 works. :D

I can now turn my plug on and off.

Thanks for the quick update. :)

Posted on
Sat Feb 11, 2023 4:37 pm
jonc offline
Posts: 12
Joined: Apr 19, 2016

Re: TP-Link Tapo plugin

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?

Posted on
Sat Feb 11, 2023 4:49 pm
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: TP-Link Tapo plugin

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.

Posted on
Sun Feb 12, 2023 9:08 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: TP-Link Tapo plugin

Cheers for the heads up on these. Under a tenner each with an Amazon multipack! Bargain


Sent from my iPhone using Tapatalk

Posted on
Sun Feb 12, 2023 11:27 am
jonc offline
Posts: 12
Joined: Apr 19, 2016

Re: TP-Link Tapo plugin

No clue in the comms. I have made sure to quit the Tapo app.
Attachments
Screenshot 2023-02-12 at 9.25.55 AM.png
Screenshot 2023-02-12 at 9.25.55 AM.png (128.79 KiB) Viewed 1389 times

Posted on
Sun Feb 12, 2023 11:43 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: TP-Link Tapo plugin

Did you click the tickbox in config to copy messages to the event log?

Who is online

Users browsing this forum: No registered users and 1 guest

cron