TP-Link Tapo plugin

User avatar
racarter
Posts: 490
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

TP-Link Tapo plugin

Post 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.
autolog
Posts: 3996
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: TP-Link Tapo plugin

Post 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. :?
User avatar
matt (support)
Site Admin
Posts: 21437
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: TP-Link Tapo plugin

Post by matt (support) »

Try using pip3.10 instead of just pip3 to see if it in installed (and install it if it isn't).
Image
autolog
Posts: 3996
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: TP-Link Tapo plugin

Post 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: 
User avatar
jay (support)
Site Admin
Posts: 18317
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: TP-Link Tapo plugin

Post 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...
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
racarter
Posts: 490
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: TP-Link Tapo plugin

Post 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.
autolog
Posts: 3996
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: TP-Link Tapo plugin

Post 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. :)
autolog
Posts: 3996
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: TP-Link Tapo plugin

Post 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
User avatar
racarter
Posts: 490
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: TP-Link Tapo plugin

Post 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.
autolog
Posts: 3996
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: TP-Link Tapo plugin

Post by autolog »

New version 2022.4.0 works. :D

I can now turn my plug on and off.

Thanks for the quick update. :)
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: TP-Link Tapo plugin

Post 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?
User avatar
racarter
Posts: 490
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: TP-Link Tapo plugin

Post 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.
siclark
Posts: 1964
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Re: TP-Link Tapo plugin

Post by siclark »

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


Sent from my iPhone using Tapatalk
jonc
Posts: 12
Joined: Tue Apr 19, 2016 4:42 pm

Re: TP-Link Tapo plugin

Post by jonc »

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 2049 times
User avatar
racarter
Posts: 490
Joined: Sat Jun 18, 2016 4:23 am
Location: North Yorkshire, UK
Contact:

Re: TP-Link Tapo plugin

Post by racarter »

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

Return to “racarter's plugins”