TP-Link Tapo wifi plug

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

nezber
Posts: 4
Joined: Wednesday 09 August 2017 22:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by nezber »

Hi

Re ran that command, rebooted but still getting the same error :(

Any other thoughts?

Many thanks
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

nezber
Try removing the hardware from Domoticz, then delete the tapo plugin from the Domoticz/plugin directory.

then reboot

then re add the tapo plugin, make sure you set the correct permissions (chmod 777 plugin.py)

then re add the hardware in Domoticz.
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

this seems to be broken in the new buster release of raspian

anyone else having problems?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TP-Link Tapo wifi plug

Post by waltervl »

newpond wrote: Tuesday 23 November 2021 5:36 this seems to be broken in the new buster release of raspian

anyone else having problems?
Bullseye release you mean? Yes, you are not alone: viewtopic.php?f=6&t=37376
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
nezber
Posts: 4
Joined: Wednesday 09 August 2017 22:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by nezber »

Still no joy, tried uninstalling reboot etc etc same error message....

2021-11-25 09:46:44.640 Error: (TapoPlugin) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Tapo/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2021-11-25 09:46:44.640 Error: (Utility Room Switch) Module Import failed, exception: 'SyntaxError'
2021-11-25 09:46:44.640 Error: (Utility Room Switch) Import detail: File: /usr/local/lib/python3.5/dist-packages/PyP100/PyP100.py, Line: 74, offset: 9
2021-11-25 09:46:44.640 Error: (Utility Room Switch) Error Line ' decode: bytes = b64decode(key.encode("UTF-8"))
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

waltervl wrote: Tuesday 23 November 2021 8:41
newpond wrote: Tuesday 23 November 2021 5:36 this seems to be broken in the new buster release of raspian

anyone else having problems?
Bullseye release you mean? Yes, you are not alone: viewtopic.php?f=6&t=37376
yes sorry I did!!
I have now downgraded back to buster
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster

and it all works again.!!
Iridium
Posts: 4
Joined: Saturday 11 December 2021 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by Iridium »

I had the same problem. After many hours (too many) I finally got it working.

This is on RaspiOS - so may be different from your system.

After running "pip3 install PyP100" I noticed that the modules had been created in /home/pi/.local/lib/python3.7/site-packages/ which is not in the $PATH variable. (I later found out that you can use pip3 --target to force the modules to a specific location).

So to solve the issue I just copied all the modules to /home/pi/domoticz/plugins/Domoticz-Tapo and restarted Domoticz and everything worked as expected.
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

I thought bullseye used python 3.9 by default now?

would the best way to install this be as you say, by copying the modules over as you did, using the target option you mention or adding the location to the path somehow?

also please could you confirm which files you actually copied over?

thanks
JOn
Iridium
Posts: 4
Joined: Saturday 11 December 2021 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by Iridium »

The *best* way to install it is by running

pip3 install PyP100 --target <INSTALL_DIR>/plugins/Domoticz-Tapo
Where default INSTALL_DIR is /home/pi/domoticz/ (On my system)

As I hadn't installed anything by pip3 I just copied everything over. If you want to know what files you need just install to a temp folder and do a listing from there.

BTW: I noticed an issue with the plugin that it was giving errors due to timeouts and high CPU usage (I have 8 devices). So I modified plugin.py heartbeat to 10 and then 60 seconds. The latter seems to work the best.

See: https://github.com/593304/Domoticz-Tapo/issues/3
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

ok cool, thanks for the info.

I can see 3 files in the python folder
PyP100.py
tp_link_cipher.py
__init__.py
(plus a cache folder)

I will upgrade to buster when I get a moment and give it a try

Re the errors and timeouts, I experienced this too and fixed by increasing the timeout like you did.

Have a look at my post re this on the first page of this thread if you get a moment, as I would be interested to your thoughts re the possible heartbeat issues you can run into when using a value of more than 30 seconds that I mention in my post.
cheers
Jon
Iridium
Posts: 4
Joined: Saturday 11 December 2021 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by Iridium »

I did try on Bullseye but had too many errors - as my server was on Buster, I stuck with that.

I tried various settings for the heartbeat from 0 to 3600s and settled on 60 as this didn't throw any errors, reduced the CPU considerably and worked as expected.

Anything over 120 caused errors, whilst 0 gave the timeout error. I was hoping 0 would turn it off but didn't.

I'm not convinced these devices really need a heartbeat as they are either on or off and don't need to interact with the world as other devices (wind sensor, gauge etc.) do. It also causes errors if for whatever reason the plug/light is switched off... but I'm new to this and have no real idea what is going on under the hood.
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

ah hang on, the issues I was seeing were only bullseye related, I never had a problem with buster (this is why I mentioned about the default python version in bullseye now being 3.9).

I think these are two different issues.
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

in regards to the heartbeat settings
20 seconds seems to work best for me, anything less increases cpu activity and anything more makes no difference.

I still get error regularly about not being able to connect to certain devices, usually on boot up (but also on other occasions too)

I think these may be related to the tapo server itself however, maybe when it see too many requests or possible when its overloaded.

It would be nice to may be have a retry section in the script to see if that is the case.

I also get lots of errors when the tapo device is unplugged or turned off at the wall socket, so would be nice if there was a mechanism that pinged it first to see if its up before going any further through the script to avoid that.
fabd
Posts: 11
Joined: Friday 15 January 2016 11:21
Target OS: -
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by fabd »

Hi all,

I am trying to setup Tapo Plugin on my Domoticz

First, i didn't update to Buster. I run into problem while testing it with last domoticz version and plugin.

So, i reverted to my Stretch setup (uptodate) and domoticz 4.11.590 (dec 2019 ....)

After installing the plugin and setting up, here is what i have

Code: Select all

 
2022-01-17 13:46:41.437 Error: (TapoPlugin) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Tapo/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2022-01-17 13:46:41.437 Error: (Tapo) Module Import failed, exception: 'SyntaxError'
2022-01-17 13:46:41.437 Error: (Tapo) Import detail: File: /home/pi/domoticz/plugins/Domoticz-Tapo/PyP100/PyP100.py, Line: 74, offset: 9
2022-01-17 13:46:41.437 Error: (Tapo) Error Line ' decode: bytes = b64decode(key.encode("UTF-8"))
2022-01-17 13:46:41.437 '
 
PyP100 is installed as prerequisite.

I tryed Iridium workaround : install py100 with another target

Code: Select all

sudo pip3 install PyP100 --target /home/pi/domoticz/plugins/Domoticz-Tapo
but no luck.

Does someone has an idea ?
Iridium
Posts: 4
Joined: Saturday 11 December 2021 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by Iridium »

Remove existing PyP100 module from /home/pi/domoticz as you installed it with "root (sudo)" - this may be causing the error.
fabd
Posts: 11
Joined: Friday 15 January 2016 11:21
Target OS: -
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by fabd »

Hello

Thanks for your reply

Here is what i tryed :

Remove PyP100

Code: Select all

pi@raspberrypi:~/domoticz/scripts $ sudo pip3 uninstall PyP100
Uninstalling PyP100-0.0.18:
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/INSTALLER
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/METADATA
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/RECORD
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/WHEEL
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/metadata.json
  /usr/local/lib/python3.5/dist-packages/PyP100-0.0.18.dist-info/top_level.txt
  /usr/local/lib/python3.5/dist-packages/PyP100/PyL530.py
  /usr/local/lib/python3.5/dist-packages/PyP100/PyP100.py
  /usr/local/lib/python3.5/dist-packages/PyP100/PyP110.py
  /usr/local/lib/python3.5/dist-packages/PyP100/__init__.py
  /usr/local/lib/python3.5/dist-packages/PyP100/__pycache__/__init__.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/PyP100/tp_link_cipher.py
Proceed (y/n)? y
  Successfully uninstalled PyP100-0.0.18
  
Réinstall Pyp100 by default

Code: Select all

pi@raspberrypi:~/domoticz/scripts $ sudo pip3 install PyP100
Collecting PyP100
  Using cached https://www.piwheels.org/simple/pyp100/PyP100-0.0.18-py3-none-any.whl
Requirement already satisfied: requests==2.24.0 in /usr/local/lib/python3.5/dist-packages (from PyP100)
Requirement already satisfied: pkcs7==0.1.2 in /usr/local/lib/python3.5/dist-packages (from PyP100)
Requirement already satisfied: pycryptodome==3.9.8 in /usr/local/lib/python3.5/dist-packages (from PyP100)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests==2.24.0->PyP100)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.5/dist-packages (from requests==2.24.0->PyP100)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests==2.24.0->PyP100)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.5/dist-packages (from requests==2.24.0->PyP100)
Installing collected packages: PyP100
Successfully installed PyP100-0.0.18
pi@raspberrypi:~/domoticz/scripts $
After restarting domoticz service, i found this in log

Code: Select all

 2022-01-19 10:36:31.798 Error: (TapoPlugin) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Tapo/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2022-01-19 10:36:31.798 Error: (Tapo) Module Import failed, exception: 'SyntaxError'
2022-01-19 10:36:31.798 Error: (Tapo) Import detail: File: /home/pi/domoticz/plugins/Domoticz-Tapo/PyP100/PyP100.py, Line: 74, offset: 9
2022-01-19 10:36:31.798 Error: (Tapo) Error Line ' decode: bytes = b64decode(key.encode("UTF-8"))
2022-01-19 10:36:31.798 ' 
I dont find a crying smiley....

What can i do ?
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

Can you post the permissions and ownership info for the plugin.py files

(Use ls-al command)
fabd
Posts: 11
Joined: Friday 15 January 2016 11:21
Target OS: -
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by fabd »

Code: Select all

-rwxrwxrwx  1 pi   pi   7389 janv. 17 10:59 plugin.py
newpond
Posts: 26
Joined: Sunday 26 September 2021 2:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by newpond »

What folder is that file in?

The error you posted mentions looking in
/home/pi/domoticz/plugins/Domoticz-Tapo/PyP100/PyP100.py

But the python path used was this

/home/pi/domoticz/plugins/Domoticz-Tapo/

The second one being the correct path.

I think you have somehow installed stuff in the wrong directory

I would remove pip and the plugin and start over following the instructions word by word

let me know if this helps

cheers
Jon
kacper077
Posts: 1
Joined: Sunday 13 February 2022 7:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: TP-Link Tapo wifi plug

Post by kacper077 »

It's no work

in location :
/home/pi/domoticz/plugins/
I run :
git clone https://github.com/593304/Domoticz-Tapo.git
and
chmod -R 777 Domoticz-Tapo/

In location:
/home/pi/domoticz/plugins/Domoticz-Tapo/
I run:
pip3 install PyP100
pip3 install PyP100 --target /home/pi/domoticz/plugins/Domoticz-Tapo

after that DOMOTICZ it stopped working in browser: "https://192.168.0.250/#/Dashboard" - I see only backround and after refresh https://192.168.0.250/#/Dashboard - EROR CONECTTION

after command
pi@raspberrypi:~/domoticz/plugins $ ls -a
. .. AwoxSMP Domoticz-Tapo examples

cd Domoticz-Tapo

and:
pi@raspberrypi:~/domoticz/plugins/Domoticz-Tapo $ ls -a
. pkcs7
.. pkcs7-0.1.2.dist-info
bin plugin.py
certifi __pycache__
certifi-2021.10.8.dist-info pycryptodome-3.9.8.dist-info
chardet PyP100
chardet-3.0.4.dist-info PyP100-0.0.18.dist-info
Crypto README.md
.git requests
.gitignore requests-2.24.0.dist-info
idna urllib3
idna-2.10.dist-info urllib3-1.25.11.dist-info


No idea why the Domoticz website does not work
"https://192.168.0.250/#/Offline"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest