core: Ecovacs integration broken on core-2022.7
The problem
Ecovacs integration working in previous core (core-2022.6) but will no longer load. It appears to be a library depreciation (collections) related to Python 3.10.
What version of Home Assistant Core has the issue?
core-2022.7
What was the last working version of Home Assistant Core?
core-2022.6
What type of installation are you running?
Home Assistant Container
Integration causing the issue
ecovacs
Link to integration documentation on our website
https://www.home-assistant.io/integrations/ecovacs/
Diagnostics information
Logger: homeassistant.loader Source: components/ecovacs/init.py:6 First occurred: 11:49:51 PM (1 occurrences) Last logged: 11:49:51 PM
Unexpected exception importing component homeassistant.components.ecovacs Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/loader.py”, line 599, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File “/usr/local/lib/python3.10/importlib/init.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1050, in _gcd_import File “<frozen importlib._bootstrap>”, line 1027, in _find_and_load File “<frozen importlib._bootstrap>”, line 1006, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 688, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 883, in exec_module File “<frozen importlib._bootstrap>”, line 241, in _call_with_frames_removed File “/usr/src/homeassistant/homeassistant/components/ecovacs/init.py”, line 6, in <module> from sucks import EcoVacsAPI, VacBot File “/usr/local/lib/python3.10/site-packages/sucks/init.py”, line 10, in <module> from sleekxmppfs import ClientXMPP, Callback, MatchXPath File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/init.py”, line 20, in <module> from sleekxmppfs.stanza import Message, Presence, Iq File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/init.py”, line 10, in <module> from sleekxmppfs.stanza.error import Error File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/error.py”, line 9, in <module> from sleekxmppfs.xmlstream import ElementBase, ET File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/xmlstream/init.py”, line 9, in <module> from sleekxmppfs.jid import JID File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/jid.py”, line 25, in <module> from sleekxmppfs.thirdparty import OrderedDict File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/thirdparty/init.py”, line 13, in <module> from sleekxmppfs.thirdparty.orderedset import OrderedSet File “/usr/local/lib/python3.10/site-packages/sleekxmppfs/thirdparty/orderedset.py”, line 25, in <module> class OrderedSet(collections.MutableSet): AttributeError: module ‘collections’ has no attribute ‘MutableSet’
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Found this snippet which may be the fix for this library:
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections
>>> collections.MutableSet
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
<class 'collections.abc.MutableSet'>
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 121
- Comments: 44 (7 by maintainers)
Hey folks- Don’t give up!!! And please don’t remove this integration. I am currently working with the original author and have successfully had my PR merged into her branch. She just needs to update PyPI and all should be working. I know this has been a long process but I’ve been persistent and working as much as possible with a retired repo owner. It will soon be working again!
Any progress on this? Would love to have it working again!
I’m still on this, but need more time, since very limited spare time at the moment. Current progress is, that I’ve already forked the
suckslib (because the owner has archived it) and was able to re-write it to use the newslixmpplib. But this combination does have some issues in authenticating against the ecovacs servers. This I still investigate … so stay tuned…Okay!! We did it! Well the author did it… I just helped her along 😃
Anyway- the updated sleek module was pushed to PyPI and should automatically be updated on next HA release.
I’m going to keep the issue open until I feel confident this works for everyone.
@frenck- when the next HA release is published, HA will automatically update all of its dependencies right? The updated dependency for this integration is published on PyPI – it looks like it meets requirements for dependencies. Is there anything else I need to do? Thank you.
Just updating, this issue still persists with update 2022.8.0
PARTY PARTY now, please clean your dirty floors
@asellitt @aperr69 - I’m going to close this particular issue as the root cause was with SleekXMPPfs and python3.10. It seems like you are facing a different problem so this should be put into a new issue.
Just out of curiosity (still closing this issue), you could try changing your country code to US and continent to NA and seeing if it’ll work again. The error is that the xmpp recipient is unavailable. I’m in the US and changed to UK/EU and it had some strange behavior (toggle switch didnt work but could control from within the vacuum’s lovelace card).
Neither of you are in North America so it could be a region specific issue. But again, this is a separate issue so I’d like to close this pending other folks with the python3.10 issue still having problems.
Much thanks to @OverloadUT for her help with this matter.
maybe the
slixmppcould be used as replacement for the sleekxmppfs … will check this an try to contact the maintainer of the sucks lib …🤚 I have the same issue! 👇 Read below
Hi there! Sorry to read you are experiencing the same issue as more people here. Nobody likes having issues 😞
Finding an issue on a GitHub issue tracker that matches your problem is kinda nice: At least you know you are not alone. So, let’s leave a commit with: “Yeah, I have the same issue”, or “+1!!!”. 🚫 No!
Please do not create “I have the same issue” comments!
Not just this issue or this project, but anywhere on GitHub or any issue tracker on the internet even. It doesn’t add to triaging the issue. It only generates noise when reading / triaging the case.
What to do instead?
Instead, go to the top of the issue, and add a 👍 emoji reaction. That way, we can still see that you (and how many others) experience this issue while keeping the issue threads nice and clean.
Thanks! ❤️
…/Frenck
@mib1185 in order to authenticate (by which I mean bypass expired certificates and verification itself), you will need to modify the slixmpp library in xmlstream/certs.py to:
and
Note: this completely bypasses any safety checks on the certificates but should allow slixmpp to continue.
I am still working to get write access to the slickxmpp library as this would update the in-use library and would not require also modifying the sucks library. Slickxmpp is old but proven with sucks and I don’t know what sort of issues down the line would come from switching to slixmpp. Hats off to you if you can get it working.
Thank you a lot for your work and free time you’re putting into it. Much appreciated!!!
I have a fix but it’s not necessarily an HA issue. The underlying library (sleekxmppfs) is quite outdated compared to the head branch and apparently is no longer working. I was able to pull fritzy/SleekXMPP, update it to work with python 3.10, and get HA to work nicely again. I put in a PR with sleekxmppfs and if this gets approved, can move on to add the updates.
The actual commit that made this work was fairly simple: https://github.com/aszymanik/SleekXMPP/commit/8fc0359eed5bedaca1a4710a43151c512d44c029
If you cannot wait until these PR requests go through, you can make the following changes:
git clone https://github.com/aszymanik/SleekXMPPpython setup.py installmv /usr/local/lib/python3.10/site-packages/sleekxmppfs/ /usr/local/lib/python3.10/site-packages/sleekxmppfs_old/If you are running HA in docker- you will need to enter the container to perform these commands.
docker container lsCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES481be48bbdf5 ghcr.io/home-assistant/home-assistant:latest "/init" 2 hours ago Up 9 minutesdocker exec -it 481be48bbdf5 /bin/bashOr stop using it since the Ecovacs component works.
This issue seems to be fixed in HA 2022.8.7, but can’t find any code commit related to it.
https://github.com/home-assistant/core/issues/74564#issuecomment-1178766628 fixed it for me on Home Assistant Operating System (Raspberry Pi). Could this be integrated into core?
The PR is for sleekxmppfs which is owned by the same person with HA’s sucks fork and the owner of this integration (@OverloadUT). I don’t think the owner in maintaining it anymore, I agree with you.
In order to generate a viable PR in HA, I’d have to somehow publish my updated library to PyPI (I think)… stay tuned…
Here is a git where the effort is made to create a library for ecovacs. Unfortunately it only works for some devices and they are looking for people to help them test and recognize the commands for other devices. (I personally try to help this git from a deebot 500 ecovacs but more people with more models are needed).
https://deebot.readthedocs.io/
same here… HA 2022.8.7 fixed the Problem for me ❤️
for me it’s not working
the
suckslib usessleekxmppfswhich seems not to be python 3.10 compatible (latest release is from 18. April 2019)