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

Ecovacs integration broken on core-2022.7 #74564

Closed
aszymanik opened this issue Jul 7, 2022 · 44 comments
Closed

Ecovacs integration broken on core-2022.7 #74564

aszymanik opened this issue Jul 7, 2022 · 44 comments

Comments

@aszymanik
Copy link

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 "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/src/homeassistant/homeassistant/components/ecovacs/init.py", line 6, in
from sucks import EcoVacsAPI, VacBot
File "/usr/local/lib/python3.10/site-packages/sucks/init.py", line 10, in
from sleekxmppfs import ClientXMPP, Callback, MatchXPath
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/init.py", line 20, in
from sleekxmppfs.stanza import Message, Presence, Iq
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/init.py", line 10, in
from sleekxmppfs.stanza.error import Error
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/error.py", line 9, in
from sleekxmppfs.xmlstream import ElementBase, ET
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/xmlstream/init.py", line 9, in
from sleekxmppfs.jid import JID
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/jid.py", line 25, in
from sleekxmppfs.thirdparty import OrderedDict
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/thirdparty/init.py", line 13, in
from sleekxmppfs.thirdparty.orderedset import OrderedSet
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/thirdparty/orderedset.py", line 25, in
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

@probot-home-assistant
Copy link

ecovacs documentation
ecovacs source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @OverloadUT, mind taking a look at this issue as it has been labeled with an integration (ecovacs) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@Marcoske23

This comment was marked as off-topic.

@Marcoske23
Copy link

Marcoske23 commented Jul 7, 2022

A dirty solution might be
1.- download the init ( https://github.com/wpietri/sucks/blob/master/sucks/__init__.py) and rename it as "sucks", then paste it in custom_component of deebot.
2.-in the custom_components folder of the integration, every time you import "sucks" you change it to ".sucks".
Example:
import sucks to import .sucks
3.- In manifest.json add the following: "slixmpp==1.8.2" in "requeriments. Something like this: "requirements": [
"ozmo==1.0.4","slixmpp==1.8.2"
],
4.- in sucks.py changes from

from sleekxmppfs import ClientXMPP, Callback, MatchXPath
from sleekxmppfs.xmlstream import ET
from sleekxmppfs.exceptions import XMPPError 

to:

from slixmpp import ClientXMPP, Callback, MatchXPath
from slixmpp.xmlstream import ET
from slixmpp.exceptions import XMPPError

5.- Restar HA to finish.

(Translated thanks to google translate )

@aszymanik
Copy link
Author

@Marcoske23 - thank you for the hack! Clear instructions too.

However, HA would not load ecovacs, citing a new issue with asyncio.get_event_loop.

Logger: homeassistant.setup
Source: components/ecovacs/sucks.py:427
First occurred: 6:29:56 AM (1 occurrences)
Last logged: 6:29:56 AM

Error during setup of component ecovacs
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ecovacs/init.py", line 72, in setup
vacbot = VacBot(
File "/usr/src/homeassistant/homeassistant/components/ecovacs/sucks.py", line 276, in init
self.xmpp = EcoVacsXMPP(user, domain, resource, secret, continent, server_address)
File "/usr/src/homeassistant/homeassistant/components/ecovacs/sucks.py", line 427, in init
ClientXMPP.init(self, user + '@' + domain, '0/' + resource + '/' + secret)
File "/usr/local/lib/python3.10/site-packages/slixmpp/clientxmpp.py", line 59, in init
BaseXMPP.init(self, jid, 'jabber:client', **kwargs)
File "/usr/local/lib/python3.10/site-packages/slixmpp/basexmpp.py", line 76, in init
XMLStream.init(self, **kwargs)
File "/usr/local/lib/python3.10/site-packages/slixmpp/xmlstream/xmlstream.py", line 357, in init
self.disconnected = Future()
File "/usr/local/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'SyncWorker_1'.

@thomsy81

This comment was marked as off-topic.

@frenck
Copy link
Member

frenck commented Jul 7, 2022

🤚 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

@Marcoske23
Copy link

Do you have a complete log of debug?

@HarlemSquirrel
Copy link
Contributor

HarlemSquirrel commented Jul 7, 2022

Looks like we need someone to either take over the abandoned sucks library or fork it to a new library.

As of March 2020, this is no longer an active project. My Ecovacs robot died and has since been replaced with a Roomba. That means I can't see if code changes work, so I can't even usefully approve patches. As of yet, nobody has agreed to take it over. If you are interested in doing so, please join the mailing list and discuss it there.

https://github.com/wpietri/sucks/blob/c8fcc2abd2dda12c75dee6ec21fd0140cd757386/README.md?plain=1#L10-L15

@Marcoske23
Copy link

Marcoske23 commented Jul 7, 2022

Looks like we need someone to either take over the abandoned sucks library or fork it to a new library.

As of March 2020, this is no longer an active project. My Ecovacs robot died and has since been replaced with a Roomba. That means I can't see if code changes work, so I can't even usefully approve patches. As of yet, nobody has agreed to take it over. If you are interested in doing so, please join the mailing list and discuss it there.

https://github.com/wpietri/sucks/blob/c8fcc2abd2dda12c75dee6ec21fd0140cd757386/README.md?plain=1#L10-L15

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/

@aszymanik
Copy link
Author

aszymanik commented Jul 8, 2022

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: aszymanik/SleekXMPP@8fc0359

If you cannot wait until these PR requests go through, you can make the following changes:

  • Pull my updated library. This is up to date with fritzy/SleekXMPP but includes OverloadUT/SleekXMPP's renaming and disabling of cert checks.
    git clone https://github.com/aszymanik/SleekXMPP
  • Install library. Enter into SleekXMPP/ directory then:
    python setup.py install
  • You may need to disable your OS's version of sleekxmppfs so that it will use this updated version. In docker, the command is
    mv /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.

  • Find container ID
    docker container ls
  • Mine looked like this:
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    481be48bbdf5 ghcr.io/home-assistant/home-assistant:latest "/init" 2 hours ago Up 9 minutes
  • Enter container using its ID
    docker exec -it 481be48bbdf5 /bin/bash
  • Change to home (root) directory and perform the git pull instructions as above

@Sangoku
Copy link

Sangoku commented Jul 8, 2022

Not really familiar witht the PR structure. Did you put a PR to ha core or to the sleekxmppfs repo?

Because last activity from the main branch is really some time ago as far i can tell. I think none is maintaining it anymore so none is merging the pull requests.

This is old PR is kinda teling :
fritzy/SleekXMPP#507

Sorry if i am getting somthing wrong.

@aszymanik
Copy link
Author

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

@mib1185
Copy link
Contributor

mib1185 commented Jul 9, 2022

the sucks lib uses sleekxmppfs which seems not to be python 3.10 compatible (latest release is from 18. April 2019)

2022-07-09 20:44:22 ERROR (MainThread) [homeassistant.loader] 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'

@mib1185
Copy link
Contributor

mib1185 commented Jul 9, 2022

maybe the slixmpp could be used as replacement for the sleekxmppfs ... will check this an try to contact the maintainer of the sucks lib ...

@neegbeah
Copy link

#74564 (comment) Might have to clone the project for Docker users

@Sangoku
Copy link

Sangoku commented Jul 17, 2022

Hmm any update on this one? Should we contact somone from HA core team?

@mib1185
Copy link
Contributor

mib1185 commented Jul 17, 2022

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 sucks lib (because the owner has archived it) and was able to re-write it to use the new slixmpp lib. But this combination does have some issues in authenticating against the ecovacs servers. This I still investigate ... so stay tuned...

@spieker
Copy link

spieker commented Jul 18, 2022

Thank you a lot for your work and free time you’re putting into it. Much appreciated!!!

@aszymanik
Copy link
Author

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 sucks lib (because the owner has archived it) and was able to re-write it to use the new slixmpp lib. But this combination does have some issues in authenticating against the ecovacs servers. This I still investigate ... so stay tuned...

@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:

def extract_dates(raw_cert: bytes) -> Tuple[Optional[datetime], Optional[datetime]]:
        return None, None

and

def verify(expected: str, raw_cert: bytes) -> Optional[bool]:
        return None

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.

@dennisbrouwer91
Copy link

Any progress on this? Would love to have it working again!

@iyruk
Copy link

iyruk commented Aug 4, 2022

Just updating, this issue still persists with update 2022.8.0

@Deltafire
Copy link

#74564 (comment) fixed it for me on Home Assistant Operating System (Raspberry Pi). Could this be integrated into core?

@Zupkowski
Copy link

#74564 (comment) fixed it for me on Home Assistant Operating System (Raspberry Pi). Could this be integrated into core?

for me it's not working

@neuman1812
Copy link

Just adding my Name to this. Tried installing the component . failed validation test on reboot.

Home Assistant 2022.8.3
Supervisor 2022.08.3
Operating System 8.4
Frontend 20220802.0 - latest

Error In log

2022-08-13 15:55:03.128 INFO (SyncWorker_5) [homeassistant.loader] Loaded ecovacs from homeassistant.components.ecovacs
2022-08-13 15:55:03.194 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component homeassistant.components.ecovacs
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 638, 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):

@aszymanik
Copy link
Author

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!

@aszymanik
Copy link
Author

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.

@aszymanik
Copy link
Author

aszymanik commented Aug 19, 2022

According to #77009 (comment): the sucks library must be version incremented in order for HA core to pick up the new sleek update. Stay tuned- this might be a while again.

For those of you comfortable in ssh/terminal/docker container: Since the sleek owner pushed it into pypi, you can enter your HA instance with the following and ecovacs integration should work now (and after restarting).
pip install --upgrade sleekxmppfs

If you are running a docker container, you will need to commit the changes to a new image then specify that new image in your docker-compose file. Someone above said that after restart, the changes disappeared. This will fix that. Here is a brief explanation of how to save a new image: https://stackoverflow.com/a/71127180

Fingers crossed!

@HarlemSquirrel
Copy link
Contributor

HarlemSquirrel commented Aug 19, 2022

We might need either a new release of sucks lib or an update to ha that sets the new version of sleekxmppfs
https://github.com/wpietri/sucks/blob/c8fcc2abd2dda12c75dee6ec21fd0140cd757386/setup.py#L66

@asellitt
Copy link

not sure if this is related, but after manually updating sleekxmppfs, this is the error i see when trying to re-enable the ecovacs component:

Logger: homeassistant.loader
Source: components/ecovacs/__init__.py:6
First occurred: 1:32:39 PM (3 occurrences)
Last logged: 1:34:03 PM

Unexpected exception importing component homeassistant.components.ecovacs
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 638, 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'

@aszymanik
Copy link
Author

not sure if this is related, but after manually updating sleekxmppfs, this is the error i see when trying to re-enable the ecovacs component:

Logger: homeassistant.loader
Source: components/ecovacs/__init__.py:6
First occurred: 1:32:39 PM (3 occurrences)
Last logged: 1:34:03 PM

Unexpected exception importing component homeassistant.components.ecovacs
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 638, 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'

Which installation are you running? It looks like the update reverted back to the old library. If using docker, you'd have to commit the image then restart the container. If installed on bare metal (not sure what HASS is calling it) or supervised, you'd at the minimum have to completely restart HA or even reboot for good measure. I havent used a Yellow yet

@asellitt
Copy link

asellitt commented Aug 22, 2022

Its a bare metal install (yeah, the names are pretty confusing). But even after a reboot of the machine, the same thing happens.

That said, there's something wrong with the upgrade via pip:

pip show sleekxmppfs
WARNING: Package(s) not found: sleekxmppfs

So i must have done something wrong when i ran the upgrade. I'll wait til the dependencies are bumped and try again.

@Sangoku
Copy link

Sangoku commented Aug 22, 2022

But even after a reboot of the machine, the same thing happens.

That said, there's something wrong with the upgrade via pip:

This is the output i get on a NUC install hassio via terminal into hassio
image
After a host reboot i still cant enable the extension. I get the same error like aszymanik
And the pachege gets rolled back.

@ejalal
Copy link

ejalal commented Aug 25, 2022

This issue seems to be fixed in HA 2022.8.7, but can't find any code commit related to it.

@masyfil
Copy link

masyfil commented Aug 25, 2022

same here... HA 2022.8.7 fixed the Problem for me <3

@asellitt
Copy link

It doesnt seem to be working for me after the update

I'm able to add in an ecovacs entity, but when i try to actually control it, it fails:

2022-08-26 14:28:36.882 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139977668092272] <iq type="error" to="[email protected]/9b08b2035b4224521a06d7c033cc35b5" from="[email protected]/atom" id="ec0d00c0-34eb-494c-9813-0f54d58ec3de-3F"><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/vacuum/__init__.py", line 351, in async_turn_on
    await self.hass.async_add_executor_job(partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ecovacs/vacuum.py", line 138, in turn_on
    self.device.run(sucks.Clean())
  File "/usr/local/lib/python3.10/site-packages/sucks/__init__.py", line 416, in run
    self.send_command(action.to_xml())
  File "/usr/local/lib/python3.10/site-packages/sucks/__init__.py", line 413, in send_command
    self.xmpp.send_command(xml, self._vacuum_address())
  File "/usr/local/lib/python3.10/site-packages/sucks/__init__.py", line 482, in send_command
    c.send()
  File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/iq.py", line 235, in send
    raise IqError(result)
sleekxmppfs.exceptions.IqError: <iq type="error" to="[email protected]/9b08b2035b4224521a06d7c033cc35b5" from="[email protected]/atom" id="ec0d00c0-34eb-494c-9813-0f54d58ec3de-3F"><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

@thomsy81
Copy link

It didn't work for me at first but I then realised I had commented out the config entry. Uncommented, restarted now working great.

@aperr69
Copy link

aperr69 commented Aug 26, 2022

Configuration.yaml config is set to UK for the country code and EU for continent (if that makes a difference?)

Vacuum shows up as entity, but get the following error when trying any action via HA:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/ecovacs/vacuum.py:138
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 06:52:51 (2 occurrences)
Last logged: 07:34:33

[547272978688]
[547258467616]
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/vacuum/init.py", line 351, in async_turn_on
await self.hass.async_add_executor_job(partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/ecovacs/vacuum.py", line 138, in turn_on
self.device.run(sucks.Clean())
File "/usr/local/lib/python3.10/site-packages/sucks/init.py", line 416, in run
self.send_command(action.to_xml())
File "/usr/local/lib/python3.10/site-packages/sucks/init.py", line 413, in send_command
self.xmpp.send_command(xml, self._vacuum_address())
File "/usr/local/lib/python3.10/site-packages/sucks/init.py", line 482, in send_command
c.send()
File "/usr/local/lib/python3.10/site-packages/sleekxmppfs/stanza/iq.py", line 235, in send
raise IqError(result)
sleekxmppfs.exceptions.IqError:

@aszymanik
Copy link
Author

aszymanik commented Aug 26, 2022

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.

@JBakers
Copy link

JBakers commented Sep 8, 2022

HA 2022.8.7 did not fix the problem for me.
running Home Assistant 2022.9.0
Frontend-versie: 20220907.0 - latest

Also using pip install --upgrade sleekxmppfs in my HA install did not fix it (it updated sleekxmppfs though)

`Logger: homeassistant.loader
Source: custom_components/deebot/hub.py:9
Integration: Deebot 4 Home Assistant (documentation, issues)
First occurred: 22:27:57 (1 occurrences)
Last logged: 22:27:57

Unexpected exception importing component custom_components.deebot
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 662, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/deebot/init.py", line 12, in
from . import hub
File "/home/homeassistant/.homeassistant/custom_components/deebot/hub.py", line 9, in
from deebot_client import Configuration, create_instances
File "/srv/homeassistant/lib/python3.9/site-packages/deebot_client/init.py", line 4, in
from ._api_client import _InternalApiClient
File "/srv/homeassistant/lib/python3.9/site-packages/deebot_client/_api_client.py", line 10, in
from .models import Configuration, Credentials
File "/srv/homeassistant/lib/python3.9/site-packages/deebot_client/models.py", line 9, in
class DeviceInfo(dict):
File "/srv/homeassistant/lib/python3.9/site-packages/deebot_client/models.py", line 28, in DeviceInfo
def nick(self) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'`

@mib1185
Copy link
Contributor

mib1185 commented Sep 8, 2022

Hi @JBakers
You are using a custom component called deebot.
This is not maintained by the Home-Assistant project.
You should get in contact with the maintainer of this custom component.

@broyuken
Copy link

broyuken commented Sep 8, 2022

Or stop using it since the Ecovacs component works.

@JBakers
Copy link

JBakers commented Sep 9, 2022

I'm so sorry if this is indeed the case. I understand the ridicule towards me if so. I
I'm not sure why i started using the custom component in the first place, could it be because the original component missed options this custom one didnt?
Thanks for bringing it to my attention!

@weberjam007
Copy link

No shame in the game, @JBakers. Anyone using Home Assistant for a while will find previously added custom components have since been more natively supported. That's the great thing about Home Assistant, it is always growing and improving!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.