Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Homeassistant 2022.7.0 #199

Closed
augard opened this issue Jul 5, 2022 · 85 comments
Closed

Support for Homeassistant 2022.7.0 #199

augard opened this issue Jul 5, 2022 · 85 comments

Comments

@augard
Copy link

augard commented Jul 5, 2022

It looks like with bump of python to 3.10 it's not possible to build required lib plugp100

Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14'].

@petretiandrea
Copy link
Owner

What's your pc? Architecture?

@augard
Copy link
Author

augard commented Jul 5, 2022

pi4, arm64

@VictoriousCupid
Copy link

virtual machine same issue:

Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14'].
21:38:21 – (ERROR) setup.py

@danielshughes
Copy link

Just updated and got the same issue. Running Hass OS

@MikyM0use
Copy link

Same problem here, running supervised HA on Chuwi Herobox Mini PC with Intel Gemini-Lake J4125

@neildsb
Copy link

neildsb commented Jul 6, 2022

+1

Home Assistant 2022.7.0
Supervisor 2022.06.2
Operating System 8.2
Frontend 20220706.0 - latest

Logger: homeassistant.setup
Source: setup.py:162
First occurred: 10:15:35 pm (1 occurrences)
Last logged: 10:15:35 pm

Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14'].

@djcrawleravp
Copy link

Same here 2022.7 Docker on Pi4

homeassistant.requirements.RequirementsNotFound: Requirements for tapo not found: ['plugp100==2.1.14'].

@lannon89
Copy link

lannon89 commented Jul 6, 2022

+1 running on pi4

@FluffyGhoster
Copy link

same issue here 2022.7 running on VM on ARM server (NOT raspberry)

@lannon89
Copy link

lannon89 commented Jul 6, 2022

Rolled back to 2022.6.7 and all good

@chiypg
Copy link

chiypg commented Jul 7, 2022

there is a plugp100 issue petretiandrea/plugp100#42

@margatemarcel
Copy link

margatemarcel commented Jul 7, 2022

Same issue here - my P110's have stopped working :( Running under HAOS on a Proxmox VM.

@laurgozilla98
Copy link

laurgozilla98 commented Jul 7, 2022

Same Here -P100 not working Running on Pi4 arm64. I'll roll back for now

@kaizersoje
Copy link

Same here. Running system on a RPi4.

Home Assistant 2022.7.0
Supervisor 2022.06.2
Operating System 8.2
Frontend 20220706.0 - latest

Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14'].

@aperr69
Copy link

aperr69 commented Jul 7, 2022

Same here. RPi64

@joaofgf
Copy link

joaofgf commented Jul 7, 2022

same here.
2022.7.0
VM with HA OS.

@sergiosb96
Copy link

sergiosb96 commented Jul 7, 2022

Same error here!
Running on a VM with Ubuntu 20.04
After updating to 2022.7.0

@moddroid94
Copy link

Same here too, VM with haos 8.2 and HA 2022 7.0

@RevillWeb
Copy link

Same for me too, running Home Assistant OS on a Linux VM running in VirtualBox on a Linux Server host.

@VictoriousCupid
Copy link

Peeps, on which hardware you run doesn't matter, if you run HA 2022.7 with python, 3.10 this integration won't work until this integration is made to work with python 3.10.

If this integration is essential to you, downgrade your HA to anything before 2022.7.

Otherwise wait it out untill the integration is updated.

@jsagu
Copy link

jsagu commented Jul 7, 2022

Rolled back to 2022.6.7 all fine

Connect over SSH and run
ha core update --version=2022.6.7

@petretiandrea
Copy link
Owner

Try to follow this #197 (comment).

Plugp100 depends on others pip packages. If there is no pre compiled wheels for python3.10 and running architecture, there will be compiled.

@spetrie13
Copy link

Try to follow this #197 (comment).

Plugp100 depends on others pip packages. If there is no pre compiled wheels for python3.10 and running architecture, there will be compiled.

Not sure what I need to do in post above. Can petretiandrea update his HACS store version with an updated plugp100 that works with the Python 3.1. I know that plugp100 was implemented by someone else but you obviously know coding. I'm lost. Thanks, Tapo integration has been working great until now.

@eholman89
Copy link

+1 Same

"Logger: homeassistant.setup
Source: setup.py:162
First occurred: 1:23:34 PM (1 occurrences)
Last logged: 1:23:34 PM

Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14']."

@richard-scott
Copy link

richard-scott commented Jul 7, 2022

It seems that HA is not compatible with pycryptodome anymore. I get the following error now installing plugp100.

      running build_ext
      building 'Crypto.Hash._MD2' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/src
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fomit-frame-pointer -g -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPYCRYPTO_LITTLE_ENDIAN -DSYS_BITS=64 -DLTC_NO_ASM -Isrc/ -I/usr/include/python3.10 -c src/MD2.c -o build/temp.linux-x86_64-3.10/src/MD2.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycryptodome

@FluffyGhoster
Copy link

FluffyGhoster commented Jul 7, 2022

Try to follow this #197 (comment).

Plugp100 depends on others pip packages. If there is no pre compiled wheels for python3.10 and running architecture, there will be compiled.

the HA core container does not come with GCC nor you're supposed to install it, it cannot compile anything in of itself, it's expected to find a precompiled package to pull

copying lib/Crypto/Math/_IntegerCustom.pyi -> build/lib.linux-aarch64-cpython-310/Crypto/Math
      copying lib/Crypto/Math/Primality.pyi -> build/lib.linux-aarch64-cpython-310/Crypto/Math
      running build_ext
      building 'Crypto.Hash._MD2' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/src
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPYCRYPTO_LITTLE_ENDIAN -DSYS_BITS=64 -DLTC_NO_ASM -Isrc/ -I/usr/local/include/python3.10 -c src/MD2.c -o build/temp.linux-aarch64-cpython-310/src/MD2.o
      error: command 'gcc' failed: No such file or directory
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  WARNING: No metadata found in /usr/local/lib/python3.10/site-packages
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pycryptodome
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
2022-07-07 14:57:43 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration tapo: Requirements for tapo not found: ['plugp100==2.1.14'].

@richard-scott
Copy link

@EvilItalianK Just for reference, I never asked pip to 'build' the installation of pycryptodome. This is what happens when you try and install it with: pip3 install pycryptodome.

@richard-scott
Copy link

It seems that a 'restore' of your last backup for your HA_Core doesn't restore Python to 3.9.

@nickmcgill
Copy link

+1 Same problem, HAOS on pi4 ...

@petretiandrea
Copy link
Owner

petretiandrea commented Jul 9, 2022 via email

@FluffyGhoster
Copy link

I've released a new version of plugp100, please try if it works: pip install plugp100==2.1.16. If do I will release a new version of integration

Same error for me, failed to dump attribute etc. etc.

Ok, but is installed, right? The main problem is install phase

yes, it is installed

@YorkshireHillbilly
Copy link

Yep

HA says no...
bash: pip: command not found

Home Assistant 2022.7.2
Supervisor 2022.07.0
Operating System 8.2
Frontend 20220707.0 - latest

@petretiandrea
Copy link
Owner

petretiandrea commented Jul 9, 2022

pip3? or python -m pip ...

@fanuch
Copy link

fanuch commented Jul 9, 2022

@YorkshireHillbilly you are clearly terminalled into the minimal host ...
See my comment, or run the following to interact with `Home Assistant Core:

docker exec -it homeassistant bash

Then run the pip install ... command.
@petretiandrea I reference my comment as I am also a HA Supervised user.

@petretiandrea
Copy link
Owner

I don't have much knowledge of the underlying software but I can share that I ran this from my supervised host successfully:

docker exec -it homeassistant bash -c "apk add musl-dev gcc;pip install plugp100==2.1.16"

I reinstalled 2022.7.x but I still get "unloaded" on the integration and that's as the HACS hasn't been updated, so unfortunately I can't run p100 library to confirm this does work on my P100. Let me know if there is anything you want me to do to test

I've lost this answer. The key point is the install phase of plugp100 2.1.16 using pip complete successfully? If yes, I can try to update integration to use 2.1.16 instead of 2.1.14

@fanuch
Copy link

fanuch commented Jul 9, 2022

Yes it installed.
I would like to note again that I installed musl-dev and gcc as another comment mentioned but I can try and remove them and install 2.1.16 again?
Otherwise if that doesn't matter, I can confirm it installed with no issues!

...
Installing collected packages: jsons, plugp100
  Attempting uninstall: jsons
    Found existing installation: jsons 1.6.1
    Uninstalling jsons-1.6.1:
      Successfully uninstalled jsons-1.6.1
  Attempting uninstall: plugp100
    Found existing installation: plugp100 2.1.14
    Uninstalling plugp100-2.1.14:
      Successfully uninstalled plugp100-2.1.14
Successfully installed jsons-1.6.3 plugp100-2.1.16

and

bash-5.1# pip show plugp100
Name: plugp100
Version: 2.1.16
Summary: Controller for TP-Link Tapo P100 and other devices
Home-page: https://github.com/petretiandrea/plugp100
Author: @petretiandrea
Author-email: petretiandrea@gmail.com
License: GPL3
Location: /usr/local/lib/python3.10/site-packages
Requires: aiohttp, certifi, chardet, idna, jsons, pycryptodome, requests, typish, urllib3
Required-by:

@glebaa
Copy link

glebaa commented Jul 9, 2022

I manually change requirements in manifest.json to "plugp100==2.1.16" and everything works fine now.
I'm on HA version 2022.6.7, downgraded from 2022.7.0.

@petretiandrea
Copy link
Owner

There is no gcc phase, so I think is right. If you can, try to remove gcc and devel and retry again (also remove plugp100)

@petretiandrea
Copy link
Owner

I manually change requirements in manifest.json to "plugp100==2.1.16" and everything works fine now. I'm on HA version 2022.6.7, downgraded from 2022.7.0.

The issue is releated to 2022.7.0, not 6.7

@glebaa
Copy link

glebaa commented Jul 9, 2022

Yes I know, but problem with pycryptodome still exist even if you downgrade from 2022.7.0 to earlier version.

@YorkshireHillbilly
Copy link

@fanuch
Sorry, nope...
[core-ssh ~]$ docker exec -it homeassistant bash -c "apk add musl-dev gcc;pip install plugp100==2.1.16"
-bash: docker: command not found

@moddroid94
Copy link

moddroid94 commented Jul 9, 2022

I was able to install on 2022.7.2 changing the manifest.json, i should not have gcc and others installed.
I cannot confirm it is working fully because i get invalid authentication rn, but it is probably my faulty network configuration.

Edit:
I've tried manually adding the device via YAML and i get this:

Error while setting up tapo platform for switch
Traceback (most recent call last):
File "/config/custom_components/tapo/common_setup.py", line 96, in _update_with_fallback
return await self.api.get_state()
File "/usr/local/lib/python3.10/site-packages/plugp100/api.py", line 89, in get_state
state=await self.get_state_as_dict(),
File "/usr/local/lib/python3.10/site-packages/plugp100/api.py", line 213, in get_state_as_dict
return await self._execute_method_request(device_info_method)
File "/usr/local/lib/python3.10/site-packages/plugp100/api.py", line 225, in _execute_method_request
dim_encrypted = self.tp_link_cipher.encrypt(jsons.dumps(method))
AttributeError: 'NoneType' object has no attribute 'encrypt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/tapo/common_setup.py", line 90, in _async_update_data
return await self._update_with_fallback()
File "/config/custom_components/tapo/common_setup.py", line 99, in _update_with_fallback
await self.api.login()
File "/usr/local/lib/python3.10/site-packages/plugp100/api.py", line 84, in login
await self._handshake()
File "/usr/local/lib/python3.10/site-packages/plugp100/api.py", line 157, in _handshake
resp_dict = await response.json()
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('http://192.168.1.181/app')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/tapo/common_setup.py", line 92, in _async_update_data
raise UpdateFailed() from exception
homeassistant.helpers.update_coordinator.UpdateFailed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/tapo/switch.py", line 28, in async_setup_platform
coordinator = await setup_tapo_coordinator_from_dictionary(hass, config)
File "/config/custom_components/tapo/common_setup.py", line 31, in setup_tapo_coordinator_from_dictionary
return await setup_tapo_coordinator(
File "/config/custom_components/tapo/common_setup.py", line 57, in setup_tapo_coordinator
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 178, in async_config_entry_first_refresh
raise ex
homeassistant.exceptions.ConfigEntryNotReady

@teleoltre
Copy link

I tried to install the pip version install plugp100 == 2.1.16
but this is the error i get.
and it doesn't work

  copying lib/Crypto/Math/_IntegerBase.pyi -> build/lib.linux-x86_64-3.10/Crypto/Math
  running build_ext
  building 'Crypto.Hash._MD2' extension
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/src
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fomit-frame-pointer -g -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPYCRYPTO_LITTLE_ENDIAN -DSYS_BITS=64 -DLTC_NO_ASM -Isrc/ -I/usr/include/python3.10 -c src/MD2.c -o build/temp.linux-x86_64-3.10/src/MD2.o
  error: command 'gcc' failed: No such file or directory
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycryptodome

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

@stanionascu
Copy link

I tried to install the pip version install plugp100 == 2.1.16 but this is the error i get. and it doesn't work

  copying lib/Crypto/Math/_IntegerBase.pyi -> build/lib.linux-x86_64-3.10/Crypto/Math
  running build_ext
  building 'Crypto.Hash._MD2' extension
  creating build/temp.linux-x86_64-3.10
  creating build/temp.linux-x86_64-3.10/src
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fomit-frame-pointer -g -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DPYCRYPTO_LITTLE_ENDIAN -DSYS_BITS=64 -DLTC_NO_ASM -Isrc/ -I/usr/include/python3.10 -c src/MD2.c -o build/temp.linux-x86_64-3.10/src/MD2.o
  error: command 'gcc' failed: No such file or directory
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> pycryptodome

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

Probably apk add musl-dev gcc would help.

Anyway 7.1 is out already.

@petretiandrea
Copy link
Owner

A new version is release 1.2.13, please try it 🎉🎉🎉

@juliandsp91
Copy link

Is working now! Thanks for the amazing work!

@margatemarcel
Copy link

Thanks Andrea, your efforts are very much appreciated 👍🏻

@Hobiano
Copy link
Contributor

Hobiano commented Jul 9, 2022

A new version is release 1.2.13, please try it 🎉🎉🎉

Thank u very much 🙏

@Viderek
Copy link

Viderek commented Jul 9, 2022

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.

Any idea?

@VictoriousCupid
Copy link

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.

Any idea?

There are more reporting the same issue in issue #122

@Viderek
Copy link

Viderek commented Jul 9, 2022

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.
Any idea?

There are more reporting the same issue in issue #122

Thanks @VictoriousCupid. I'll keep an eye on #122 in case a solution is found. I've tried adding the device trough YAML and that fails too.

@lannon89
Copy link

lannon89 commented Jul 9, 2022

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.
Any idea?

There are more reporting the same issue in issue #122

Thanks @VictoriousCupid. I'll keep an eye on #122 in case a solution is found. I've tried adding the device trough YAML and that fails too.

+1 on this

@gregorasia
Copy link

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.

Any idea?

Do you have capital letters in your password by any chance?
For me, it solved the problem.

@teleoltre
Copy link

Everything works perfectly!
Thank you !

@FluffyGhoster
Copy link

New version works for me too, authentication successful and everything is working fine

@Viderek
Copy link

Viderek commented Jul 10, 2022

1.2.13 installs fine through HACS but, for the life of me, I can't get past the "invalid authentication" error. I have tried re-downloading the integration, removing and re-adding the P100, logging out & back into the Tapo app... nothing works. Email address is lower case, of course. Nothing shows up in HA core logs.
Any idea?

Do you have capital letters in your password by any chance? For me, it solved the problem.

Spot on, @gregorasia! Changed the password, re-added devices in Tapp app, and it all works normally now. Thank you!

Kudos to @petretiandrea for the great work and dealing with the python fix in record time!

@delatt
Copy link
Contributor

delatt commented Jul 11, 2022

Oddly I'm still getting 'Setup failed for custom integration tapo: Unable to import component: No module named 'plugp100'' even after updating. Is anyone still seeing this issue?

@richard-scott
Copy link

I had to install that to get mine to work:

pip install plugp100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests