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

Xiaomi Vacuum Cleaner robot timeout / unavailable #9013

Closed
olskar opened this issue Aug 16, 2017 · 59 comments
Closed

Xiaomi Vacuum Cleaner robot timeout / unavailable #9013

olskar opened this issue Aug 16, 2017 · 59 comments

Comments

@olskar
Copy link
Contributor

olskar commented Aug 16, 2017

Home Assistant release (hass --version):
0.51.2

Python release (python3 --version):
3.4.2

Component/platform:
vacuum

Description of problem:
I see that #8982 was closed @azogue but I am afraid I still have the same problem. The token is correct and mirobo can communicate without problems, all the times I have tried. As you can see it spawns those errors for more than 20 minutes.

2017-08-16 17:41:56 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:41:56 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:42:17 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:42:17 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:42:38 ERROR (Thread-6) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:42:38 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:42:59 ERROR (Thread-6) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:42:59 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:43:20 ERROR (Thread-5) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:43:20 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:43:41 ERROR (Thread-2) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:43:41 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:44:02 ERROR (Thread-2) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:44:02 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:44:23 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:44:23 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:44:44 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:44:44 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:45:05 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:45:05 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:45:26 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:45:26 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:45:30 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.vindruva_moisture is taking over 10 seconds
2017-08-16 17:45:47 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:45:47 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:46:08 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:46:08 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:46:29 ERROR (Thread-6) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:46:29 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:46:50 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:46:50 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:47:11 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:47:11 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:47:32 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:47:32 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:47:53 ERROR (Thread-8) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:47:53 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:48:14 ERROR (Thread-7) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:48:14 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:48:35 ERROR (Thread-7) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:48:35 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:48:56 ERROR (Thread-2) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:48:56 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:49:17 ERROR (Thread-5) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:49:17 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:49:38 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:49:38 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:49:59 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:49:59 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:50:20 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:50:20 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:50:41 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:50:41 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:51:02 ERROR (Thread-8) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:51:02 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:51:23 ERROR (Thread-12) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:51:23 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:51:44 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:51:44 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:52:05 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:52:05 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:52:26 ERROR (Thread-12) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:52:26 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:52:47 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:52:47 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:53:08 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:53:08 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:53:29 ERROR (Thread-7) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:53:29 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:53:50 ERROR (Thread-12) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:53:50 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:54:11 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:54:11 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:54:32 ERROR (Thread-4) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:54:32 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:54:53 ERROR (Thread-4) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:54:53 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:55:14 ERROR (Thread-11) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:55:14 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:55:35 ERROR (Thread-10) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:55:35 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:55:56 ERROR (Thread-8) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:55:56 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:56:17 ERROR (Thread-2) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:56:17 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:56:38 ERROR (Thread-3) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:56:38 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:57:20 ERROR (Thread-7) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:57:20 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:59:26 ERROR (Thread-4) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:59:26 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 17:59:47 ERROR (Thread-8) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 17:59:47 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 18:00:29 ERROR (Thread-7) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 18:00:29 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 18:02:13 ERROR (Thread-2) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 18:02:13 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
2017-08-16 18:02:34 ERROR (Thread-5) [mirobo.device] Unable to discover a device at address 192.168.1.128
2017-08-16 18:02:34 WARNING (MainThread) [homeassistant.components.vacuum.xiaomi] Got exception while fetching the state: Unable to discover the device 192.168.1.128
@azogue
Copy link
Member

azogue commented Aug 17, 2017

I see, those are a lot of errors...

Well, for now there isn't a solution for lazy botvacs, and I think these problems have to be handled within the python-mirobo library, not in Home Assistant (what do you think about, @rytilahti ?), so perhaps opening an issue there is the way to go.

I'm understanding that you normally can access the bot and control it from HA, but sometimes you enter in that bad-update loop for quite some time, I'm correct, @olskar ?

I myself have some of these bad updates from time to time, but I chose to ignore them, because I hadn't the time to investigate and, anyway, in practice, they do not pose any problem to the botvac control...
The way to hide these is config the logger like that:

logger:
  default: warn
  logs:
    # Hide botvac connexion errors which happen sometimes:
    homeassistant.components.vacuum: error
    mirobo.device: critical

So you'll never see the messages, but that's obviously not a solution for the problem.

I could imagine some sugar-code in the HA component to handle these without so many logging, remembering the last good update and so, but it would be just that, not a real solution whatsoever.
If that is wanted, I could do a PR about that this weekend...

@olskar
Copy link
Contributor Author

olskar commented Aug 17, 2017

Ok, I reopened it cause it seemed the person in the old issue resolved it by having the right token, but I got the same error even with the right token. If the error should be resolved in python-mirobo, I agree opening an issue there is the right way.

Do you know if this constant behavior might have a negative impact on performance in Home Assistant, or is it just cluttering the logs?

@azogue
Copy link
Member

azogue commented Aug 17, 2017

Do you know if this constant behavior might have a negative impact on performance in Home Assistant, or is it just cluttering the logs?

I think there is no real problem; if so, you could see some 'reset timer' in the logs or some side effects in cpu or memory usage, but it's not the case. That's why I chose to ignore them by now...

@happyleavesaoc
Copy link
Contributor

Same problem here.

@rytilahti
Copy link
Member

For some reason the vacuum is not always responsive to the initial handshake, but the reason is not yet known. This may be, however, related to this problem: rytilahti/python-miio#48

@syssi
Copy link
Member

syssi commented Sep 10, 2017

The same issue is discussed here I think: aholstenson/miio#59

@antosiekd
Copy link

Also have this log issue, though it does not seem to affect the operation of the vacuum at all. So for now I will ignore the log entries!

@Ernst79
Copy link
Contributor

Ernst79 commented Nov 4, 2017

For those who are ignoring the messages, I had to change the logger settings (see post from @azogue) since the update to 0.57.

In the last line, I had to change

mirobo.device: critical
to
miio.device: critical

@ferdydek
Copy link

ferdydek commented Nov 4, 2017

Started seeing in logs today (not sure if related to bump from 0.57 or was there all along):

/usr/lib/python3.6/site-packages/homeassistant/components/vacuum/xiaomi_miio.py:90: DeprecationWarning: Please convert to using 'miio' package, this package will be removed at some point in the future
  from mirobo import Vacuum
...
...
/usr/lib/python3.6/site-packages/homeassistant/components/vacuum/xiaomi_miio.py:203: DeprecationWarning: Call to deprecated function dnd (Use vacuum's dnd_status() instead, which is more accurate).
  STATE_ON if self.vacuum_state.dnd else STATE_OFF,

@rytilahti
Copy link
Member

That's not related to this issue, the backend library got bumped without converting the code to use the new package name (the first warning) and dnd_status() (the second warning).

@joq3
Copy link

joq3 commented Nov 21, 2017

@ferdydek I have the same issue in my log.
@rytilahti is there a fix?

STATE_ON if self.vacuum_state.dnd else STATE_OFF,
/usr/src/app/homeassistant/components/vacuum/xiaomi_miio.py:203: DeprecationWarning: Call to deprecated function dnd (Use vacuum's dnd_status() instead, which is more accurate).

@rytilahti
Copy link
Member

The solution is to avoid calling dnd, which is what was proposed here #9733 . The problem was that this broke the unit tests horribly and I haven't had time to look how to fix those properly.

@joq3
Copy link

joq3 commented Nov 21, 2017

@rytilahti But I don't call dnd, I have the Xiaomi Mi Vacuum component active in my configuration, I haven't done anything else. Is there something I can do to fix this?

@ferdydek
Copy link

ferdydek commented Nov 23, 2017

@joq3 there is nothing broken, its just log info, not actual drop in functionality.
@rytilahti if I could code Id gladly help, but if you need tests done poke me here or on discord, always happy to assist. ... also the "unable to discover" ... doesnt this come from attempt to autodiscover the device by the lib ?

@rytilahti
Copy link
Member

@joq3 it is coming from the platform requesting dnd status which does not respond with an accurate information and the warning is to show that it should be changed by developers.

@ferdydek the "unable to discover" comes from the library indeed. At the moment the library will try to do a discovery every time before it sends a command to the device, why it fails sometimes is unclear. The tests for this broke as calling dnd_status() instead of reading it from the status message introduces new calls and the tests are looking for a specific ordering of calls, instead of whether those were just called. I'll try to look into fixing it for good before the next release.

@olskar
Copy link
Contributor Author

olskar commented Dec 14, 2017

I still get those errors even with #10839 merged :/ @rytilahti

@olskar olskar closed this as completed Dec 14, 2017
@olskar olskar reopened this Dec 14, 2017
@ajfriesen
Copy link

Yeah me too.

@rytilahti
Copy link
Member

That PR fixes just deprecated warnings which is unrelated to unavailable/timeout issues, I just linked it here as people started discussing about those here. The cause for timeout / unavailable issues is unknown and may be related to local network setups.

@ferdydek
Copy link

I have similar impression as @rytilahti regarding the cause of the timeouts.

I do get from time to time "Can't upload the map die to low connection speed. Check your network" in HiMome App just after the "Getting info..." disappears.
image

I don't think it has anything to do with my local LAN/WLAN, rather suspect somewhere in the process of getting information a query to Chinese mi servers is passed and that is causing a cascading timeout.
When I will get some free time will try to wireshark the info to verify this suspicion (or maybe someone here could do that faster than me?).

@rytilahti
Copy link
Member

I think there are users having this problem even when they have blocked the external network access for the device, so that cannot be the only reason. To debug this, we would require testing through various versions to see at what point it stopped working (git bisect may help here) to pinpoint that change.

@jghaanstra
Copy link

Just chipping in here. I dont use home-assistant but the same issue occurs on a nodejs library (miio) to control the Xiaomi Mi Robot Vacuum Cleaner. It was introduced with the lastest firmware update of the device with version number 3.3.9_003077. It's described here: aholstenson/miio#59

I lack the knowledge to do a proper inspect of the traffic with a MITM attack but that seems the only way to really troubleshoot what's happening.

@Ernst79
Copy link
Contributor

Ernst79 commented Dec 18, 2017

@jghaanstra The issue you are referring to is closed. You should consider reopening the issue, if it isn’t solved.

@rytilahti
Copy link
Member

Getting time-outs from the device just means that the device is not answering for a reason or another, there's no simple way to pinpoint what is causing this, but the 3077 firmware incorporated more strict checking of the communication (incl. order of messages, thereby increasing msgids, timestamp handling, ..).

That being said, there may very well be something that's been overlooked, but it is not so simple to find out the real causes on real use-cases with heterogeneous network setups. For many python-miio (or miio in JS) is working just fine, where-as some encounter problems with no apparent / easy to find out reason.

If someone has ideas how to debug these issues please report into issue tracker of those upstream projects where possible, thanks!

@brent20
Copy link

brent20 commented Dec 22, 2017

Just received a new Mi Robot - was getting this issue on the first setup in HA. Unavailable in UI and timeouts in the logs.

2017-12-22 09:41:12 ERROR (SyncWorker_0) [miio.device] Got error when receiving: timed out

2017-12-22 09:41:12 WARNING (SyncWorker_0) [miio.device] Retrying with incremented id, retries left: 3

@iMicknl
Copy link
Contributor

iMicknl commented Dec 26, 2017

I have the same issue. It can't connect to the Xiaomi Vacuum from HomeAssistant, but the mirobo Python library works like a charm on my Mac. (with the same IP + token). Anything I can do to help debugging this issue?

@ferdydek
Copy link

@danielpalstra your errors are not related to this issue. I guess the other issues were fixed with your update and you are left with the point 3 below. But this is not the issue for that problem.

I think we need to close this issue as it begins to suck up all possible issues with miio.
To close the topic @rytilahti correct me if Im wrong:

  1. The depreciated and discovery errors are now corrected (this is what this issue was created for with Xiaomi Vacuum: remove deprecated calls #10839).
  2. The updated library that broke the component at some point was fixed.
  3. The source of disconnects and timeouts is currently unknown and is investigated. Please don't add to this issue, create separate issue for that topic instead.

@rytilahti
Copy link
Member

I think those may be related, but as this issue has started to cover so many different issues, it's starting to get hard to keep track on all of it.

Thanks for summarizing it all to those three points, however, to my understanding it was only the point 3 what was being tracked in this issue, those two others being just unfortunate, unrelated problems. Number 2 was never tracked here (in homeassistant's issue tracker), and I think the fix is still to be released with the next homeassistant release.

The insight that it works with the mirobo tool is an interesting one though, as if that's true then there must be a way to fix it and that the problem has to have something to do with the state handling (the mirobo tool keeps just the msgid stored between executions where-as the platform keeps the whole instance around). What makes it hard to debug is 1) different people have different kinds of network setups, and they all think they are hit by this issue even if it may be just caused by their network setup and 2) this is working for quite a few people just fine, or so I'd assume.

@Coffee-lover
Copy link

Hey guys,
I just connected my Xiaomi Me to home-assistant but it is displayed as "unavailable".
It prompts: "[miio.device] Unable to discover a device at address xxx.xxx.xxx.xxx"
Token and ID were copy - pasted to config-file, so there is no reason to believe in typing mistakes.
Probably I'm suffering the same issue discussed above.
Best regards

@danielpalstra
Copy link

danielpalstra commented Dec 28, 2017

@rytilahti how can I help to gain more insight into "issue 3"?

@joq3
Copy link

joq3 commented Dec 28, 2017

I am having the same issues after updating Home Assistant to v.60. The Mi Vacuum shows up as unavailable. Before the update everything worked great!

@RDumais
Copy link

RDumais commented Dec 29, 2017

Same issue as above users.

EDIT: My original reply was beyond useless. I have solved my issue and will post it here in hopes of helping someone. My Hass.io version is 60.0.

My problem was I grabbed my token from my iOS device using a .sqlite DB explorer and got a 96 character token. This was not working for me, so I used miio (miio --discover) and got a 32 character token. I tried using this token, but still not working. I would run --discover after pairing the device to my network and my MiHome app, but the token would should '???' when I ran 'miio --discover'... weird.

The solution for me was to take the original 96 character token and decode it to a 32 character token. I forget the website I used, but there are probably a hundred of them that can do the same thing.

@rytilahti
Copy link
Member

rytilahti commented Dec 30, 2017

Getting the token is described in https://python-miio.readthedocs.io/en/latest/discovery.html#tokens-from-backups . The most reliable way is to extract them from backups, and works with all supported devices. Tokens of vacuums have not been discoverable through other means for a while now. The miio-extract-tokens tool will do decoding if needed automatically for you, and this works for both android & ios backups.

@danielpalstra considering it works in the console, it most likely has something to do with either 1) timing or 2) msg id -- you could enable debug mode and check the timing between the handshake and the status request, maybe the time difference is too great and the robot ignores the request because of that. For message ids, they should always be incremented, so if you see out-of-order msgids that could be something to investigate.

@danielpalstra
Copy link

@rytilahti took a spin with the dev Docker image and it seems to be working better. Will double check network and time settings.

@olskar
Copy link
Contributor Author

olskar commented Jan 2, 2018

Is this perhaps solved by #11232 ? Haven't received any error messages after upgrading python-miio to 0.3.3

Edit: No, still same problem :(

@jaimemrjm
Copy link

jaimemrjm commented Feb 13, 2018

mirobo --ip 192.168.1.15 --token xxxxxx
State: Charging
Battery: 100 %
Fanspeed: 60 %
Cleaning since: 0:58:56
Cleaned area: 56.6575 m²

but since I have updated to HomeAssistant 0.63, I receive the same error: Unable to discover the device. Version of python-mio: 0.3.5

@rytilahti
Copy link
Member

Please make sure you are using the latest version of construct, maybe that will help. What kind of network setup you have, e.g. are you blocking vacuum's access to the xiaomi cloud or not? The error is so generic (which just says that the robot is not responding to your queries) that it's hard to pinpoint where the problem is if you are not receiving any other errors or warnings.

@jaimemrjm
Copy link

By updating to python-miio to 0.3.6 solves the issue but HA downgrades the library on boot always:
feb 15 23:10:42 camelberry hass[25477]: 2018-02-15 23:10:42 INFO (Thread-5) [homeassistant.util.package] Attempting install of python-miio==0.3.5
How can force the newest python-miio version?

@syssi
Copy link
Member

syssi commented Feb 15, 2018

You could start HA by bin/hass --skip-pip

@jaimemrjm
Copy link

Yes, I have updated the homeassistant.service file to use --skip-pip as temporary solution.

@ferdydek
Copy link

Still getting:

Feb 25 22:38:31 MrMeeSeeks hass[29480]: 2018-02-25 22:38:31 WARNING (Thread-5) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state: Unable to discover the device 192.168.2.198
Feb 25 22:39:29 MrMeeSeeks hass[29480]: 2018-02-25 22:39:29 ERROR (Thread-9) [miio.device] Got error when receiving: timed out
Feb 25 22:39:29 MrMeeSeeks hass[29480]: 2018-02-25 22:39:29 WARNING (Thread-9) [miio.device] Retrying with incremented id, retries left: 3

info:
construct==2.9.31
homeassistant==0.64.0
python-miio==0.3.7
firmware 3.3.9_003096, HW: ver 1

There is no issue with functionality or sensors. Vacuum works fine.

@syssi
Copy link
Member

syssi commented Feb 26, 2018

This is fine. The device doesn't respond sometimes. The second try / retry was successful in your case.

@beatmag
Copy link

beatmag commented Feb 28, 2018

I have
construct==2.9.31
homeassistant==0.64.1
python-miio==0.3.7

The issue with my gen2 roborock is that it’s unable to discover it anymore.
It was working fine with 0.64. Then I started to add lifx lights which vacuum still worked.
But after setting up homebridge and homebridge home assistant plugin after a restart of home assistant vacuum no longer responds.

Mirobo command line tool also doesn’t work anymore.

Is this because the vacuum token has changed?
My vacuum does not have access to Internet.
It was working fine pre 0.64 for a whole week.
I would get some b’fffffffffff errors though.

Any ideas? Tried downgrading same thing. Surprised mirobo command line isn’t working anymore.
I can check the token again tonight but is the token suppose to change? The vacuum still pings.

@syssi
Copy link
Member

syssi commented Mar 1, 2018

Please check your token. It has possibly changed. There is not much known about the 2gen vacuum yet.

@beatmag
Copy link

beatmag commented Mar 1, 2018

So I connected the gen2 xiaomi vacuum back to internet and to mi home android app. The earlier version where you can still get token.
Had to reboot the vacuum.
Felt like the vacuum went into a crashed state due to some reason.

Now I’m home assistant the fan speed is 102%. Which is suppose to be balanced mode.
Max is 104. I set the speed from the mihome app and I can see home assistant change

It use to say balanced and max. Now just 102%.
Token didn’t change its back online with home assistant and internet blocked off again.

Strange that it kind of went into a crashed mode and couldn’t get back online even the mi home couldn’t detect it until I restarted it.

@beatmag
Copy link

beatmag commented Mar 1, 2018

No idea why the mi home app set the fan speed to 101, 102, 103, 104
Now I’ve rebooted the vacuum again the value reset back to 60% which home assistant tells me it’s balanced mode again.

Anyone with a gen2 has seen this strange behaviour?
Are the fan values same from gen 1 to gen 2???
Either way it’s been strange.

@beatmag
Copy link

beatmag commented Mar 8, 2018

After a week of idling. Gen2 vacuum didn’t respond. And when I restarted hass. It was no longer available.

Starting to think whether I need to allow the vacuum to access dns and ntp maybe.
For those that have not given internet access to the vacuum has yours been working???

@beatmag
Copy link

beatmag commented Mar 10, 2018

Found a post on the forums saying that the vacuum would only work after allowing dns and ntp??
https://community.home-assistant.io/t/what-are-your-strategies-to-protect-your-network-security-privacy/31569

Has anyone here experienced the same thing?
I will try and find out which dns and ntp the vacuum uses and allow it. Will let you all know when I find out.

Sounds like the vacuum retires accessing the internet too much and eventual enters a crashed state.

@tringler
Copy link
Contributor

tringler commented Mar 12, 2018

This is fine. The device doesn't respond sometimes. The second try / retry was successful in your case.

But it's not good if I get these messages up to three times a minute right or am I wrong? https://gist.github.com/tringler/87bd31b43e6cb0955c01a39ee4263b36

I have no problems to call the vacuum cleaner at all. I'm struggling only with these messages all the time. I think [homeassistant.core] Timer got out of sync. Resetting is also caused by these messages but not 100% sure.

@rytilahti
Copy link
Member

No, that's not definitely good. Did you look at the link @beatmag posted? Do you allow your vacuum to connect to the cloud? If not, do you silently drop the packets or are you rejecting them? The former is known to cause (or at least amplify) the problem.

@linuxlurak
Copy link

I jumped from 0.65.0 to 0.65.6 and my first gen robovac is not detected anymore. I reject any attempts of my robovac to communicate with the internet. Worked fine till the update to 0.65.6.

@rytilahti
Copy link
Member

See my commentary on #11048 (comment) . If someone is having still issues with this (and none of the listed potential causes apply), feel free to open a new issue & including enough information to debug this.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 24, 2018
@balloobbot
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 👍

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