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

Cannot connect to Xiaomi Mijia 1C vacuum #49188

Closed
danielkaneider opened this issue Apr 13, 2021 · 6 comments
Closed

Cannot connect to Xiaomi Mijia 1C vacuum #49188

danielkaneider opened this issue Apr 13, 2021 · 6 comments

Comments

@danielkaneider
Copy link

The problem

Hi,

I'm struggling to newly connect to my vacuum robot. I've tried several things, and don't know, if there's a in issue with the unrecognized model, unrecognized commands, or some problem with the connection.

I've tried the (apparently) old way, by providing host and token in the configuration.yaml file, but also providing them in the UI failed.

The token extractor gives me this:

Devices found for server "de":
   ---------
...
   IP:       192.168.0.23
   MODEL:    dreame.vacuum.mc1808

As the UI gave me some model unknown error, I've tried to edit/add the model to https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_miio/const.py#L107

I was able to add the integration, but still HA doesn't seem to be able to connect.

ping inside HA works.

miiocli device --ip <IP> --token <TOKEN> info gives me

Model: dreame.vacuum.mc1808
Hardware version: Linux
Firmware version: 3.5.8_1096

And mirobo --ip <IP> --token <TOKEN> -d info gives

INFO:miio.vacuum_cli:Debug mode active
Traceback (most recent call last):
  File "/usr/local/bin/mirobo", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/vacuum_cli.py", line 61, in cli
    with open(id_file, "r") as f, contextlib.suppress(
FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/python-miio/python-mirobo.seq'

However, miiocli dreamevacuummiot --ip <IP> --token <TOKEN> status, as stated in rytilahti/python-miio#952, works fine!

What is version of Home Assistant Core has the issue?

2021.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

xiaomi_miio

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-04-13 16:54:45 ERROR (SyncWorker_2) [miio.miioprotocol] Got error when receiving: timed out
2021-04-13 16:55:14 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.dreame_vacuum_mc1808 is taking over 10 seconds
2021-04-13 16:55:24 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20
@probot-home-assistant
Copy link

xiaomi_miio documentation
xiaomi_miio source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, @starkillerOG, mind taking a look at this issue as its been labeled with an integration (xiaomi_miio) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@rytilahti
Copy link
Member

rytilahti commented Apr 14, 2021

The xiaomi_miio vacuum integration supports currently only rockrobo vacuums (as implemented in Vacuum class/miiocli vacuum/mirobo of python-miio).

@danielkaneider
Copy link
Author

https://github.com/rytilahti/python-miio/blob/master/miio/dreamevacuum_miot.py should contain the desired functionality; not sure though, why this has been implemented as a separate interface

@rytilahti
Copy link
Member

The simple reason is that the backend library has grown organically from supporting only the first generation rockrobo vacuums to allow controlling other devices using the same lower-level miio (and recently, miot) protocol. The library needs refactoring to expose a common interfaces per device types (such as VacuumDevice for vacuums) to allow easy interfacing from homeassistant, as at the moment implementations are not compatible (see #27268 (comment)). Alas, I haven't had time to do that and no one has volunteered to do the work.

#27268 (comment) (and the whole issue) is related to this problematic, even when it is about viomi instead of dreame vacuums. If you wish to work to make this happen, I suggest creating a PR to consolidate the common interfaces on the backend lib to have basic functionality available for all python-miio supported vacuums. I'm happy to help with code reviews and any questions.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 13, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants