Xiaomi Mi vacuum unavailable in 0.77

I just got a Roborock S5, trying to add it to Home Assistant without success. I was able to download Mi Home 5.0.30 onto my second Android phone (didn’t want to downgrade my main phone’s version) and got the token through MiToolkit However when booting up hass, I get this error:

2019-01-12 21:56:33 ERROR (MainThread) [homeassistant.components.vacuum] xiaomi_miio: Error on device update!
Traceback (most recent call last):
  File "/home/homeassistant/homeassistant/lib64/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/home/homeassistant/homeassistant/lib64/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/homeassistant/lib64/python3.6/site-packages/homeassistant/components/vacuum/xiaomi_miio.py", line 378, in update
    self.last_clean = self._vacuum.last_clean_details()
  File "/home/homeassistant/homeassistant/lib64/python3.6/site-packages/miio/vacuum.py", line 194, in last_clean_details
    last_clean_id = self.clean_history().ids.pop(0)
IndexError: pop from empty list
2019-01-12 21:56:33 INFO (MainThread) [homeassistant.setup] Setup of domain vacuum took 5.2 seconds.

Edit: now that I reread my error message, it’s because I’ve never sent my vacuum out to perform a cleaning task. It’s popping an empty list without any exception handling or checking list size.

@wilsonmanmcp @taaariq

I bought and configured a gen2 this past weekend. I consistently get the Unable to Discover messages. The token is verified to be correct, and I can see vacuum status in HA. So it seems to actually be connected, but is unstable… as if the connection drops and reconnects periodically. The result is lag in status updates and I have to usually fire commands multiple times until they actually are sent to the vac. I’m on the US Server.

I finally got to the bottom of this, it turns out it was my simple dhcp server setup, I believe it was something to do with some handshakes between mi vacuum to hassio, hassio was able to see the vacuum, but vacuum wasn’t able to response back from to hassio. once I fixed up simple dhcp setup everything works now.

I’m having the exact same issue. Extracted the token from the log in /smarthome.

The component is active in Hass.io, but the vacuum shows unavailable. I’m pretty sure it is no “DHCP issue” in my case.

I’m running hass.io 0.86.2 in docker on a ubuntu 18.04 system.

2019-01-26 10:53:51 INFO (MainThread) [homeassistant.components.vacuum] Setting up vacuum.xiaomi_miio 2019-01-26 10:53:51 INFO (MainThread) [homeassistant.components.vacuum.xiaomi_miio] Initializing with host 192.168.1.77 (token 33384...) 2019-01-26 10:53:56 ERROR (SyncWorker_0) [miio.device] Unable to discover a device at address 192.168.1.77 2019-01-26 10:53:56 WARNING (SyncWorker_0) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state: Unable to discover the device 192.168.1.77

Anyone?

The token works:

mirobo --ip 192.168.2.77 --token XXXXXXXXXXXXXXXXXXXXXXXXXXX
State: Charging
Battery: 100 %
Fanspeed: 60 %
Cleaning since: 0:46:34
Cleaned area: 41.035 m²

Home assistant still shows the device as “unavailable”

did you find any solution?

1 Like

Having the same problem here with a brand new styj02ym. Have you find the solution?

Instead of using the HA integration use this custom integration https://github.com/nqkdev/home-assistant-vacuum-styj02ym

1 Like

Thank you so much man. It really worked. You save my life (i mean, a lot of time).

Did you manage to change the maps in styj02ym? Can this be done with set_map command?

On the styj02ym sadly not. Yet, at least.

1 Like