Xiaomi vacuum unavailable after 0.59

Hi, my Xiaomi vacuum isn’t recognized after I updated to 0.59 last night.

2017-12-09 11:03:55 WARNING (Thread-2) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state:
2017-12-09 11:04:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.xiaomi_vacuum_cleaner is taking over 10 seconds
2017-12-09 11:04:16 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20
2017-12-09 11:04:16 WARNING (Thread-10) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state:

Anyone else getting this?

Yes, me too.
I am using Air Purifier Pro and it is not available now.
My friend’s xiaomi_miio devices are also not available.

+1, trying to use Xiaomi Philips bulbs. Working fine before upgrade from 0.58.0. Using Hassbian.

Me too, I switched from Hass.io to Hassbian, both with version 0.59 and after the switch the air purifier isn’t available any longer, the log shows:

ERROR (Thread-10) [miio.device] Got error when receiving: timed out
WARNING (Thread-10) [miio.device] Retrying with incremented id, retries left: 3
WARNING (MainThread) [homeassistant.components.fan] Setup of platform xiaomi_miio is taking over 10 seconds.
ERROR (Thread-10) [miio.device] Got error when receiving: timed out
WARNING (Thread-10) [miio.device] Retrying with incremented id, retries left: 2
ERROR (Thread-10) [miio.device] Got error when receiving: timed out
WARNING (Thread-10) [miio.device] Retrying with incremented id, retries left: 1
ERROR (Thread-10) [miio.device] Got error when receiving: timed out

me too,so how can i deal with it?

Same here :frowning:

oh and I can’t even downgrade to 58.1, I get Could not find a version that satisfies the requirement aiohttp==2.3.2 (from homeassistant==0.58.1) from versions: 0.1 [...] 2.3.1, 2.3.2b2) when executing sudo pip install homeassistant==0.58.1
Argh.
Hope someone can help

I adjusted and used sudo pip3 install homeassistant==0.58.1 which completed successfully however the vacuum is still unavailable. Not sure if Xiaomi changed anything, so I’m off to perform a full backup of my iPhone and retrieve the token…
Gosh this is painful

Update, having done a backup and retrieved the token, it’s the same.
The xiaomi app still works, though I see there was an update on 5th Dec, related?

https://github.com/home-assistant/home-assistant/issues/11048

It’s unlikely the app update would have this effect - checking my phone the app updated on the 5th, however 58.0 was still working for me until I updated hass on the 9th from 58.0. As far as I’m aware, the app serves no purpose within hass except to facitilitate the initial wifi connection of the device to the network (from my experience with the bulbs). From there the hass component is communicating the the device directly.

Hi @arnie580, check the link I posted just before your comment. It appears to be something on the Python side, which would potentially explain why downgrading doesn’t fix it. Doesn’t explain why it used to work and stopped with the 0.59 upgrade though…

I have encountering the same problem all xiaomi wifi devices do not work after upgrade to 0.59.2.

2017-12-12 11:13:43 WARNING (MainThread) [miio.device] Retrying with incremented id, retries left: 1
2017-12-12 11:13:48 ERROR (MainThread) [miio.device] Got error when receiving: timed out
2017-12-12 11:13:48 WARNING (MainThread) [homeassistant.components.switch] Setup of platform xiaomi_miio is taking over 10 seconds.
2017-12-12 11:13:49 WARNING (MainThread) [homeassistant.components.switch] Platform xiaomi_miio not ready yet. Retrying in 180 seconds.
2017-12-12 11:13:49 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20
2017-12-12 11:13:50 ERROR (SyncWorker_7) [miio.device] Got error when receiving: timed out
2017-12-12 11:13:50 WARNING (SyncWorker_7) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state:

Issue was found in the miio code.
You can wait for a fix to be officially published, but if like me you can’t, then you can replace some code as per this post:
https://github.com/home-assistant/home-assistant/issues/11048#issuecomment-350865107

1 Like

Hi Lolouk44, thank you for that. Much appreciated!
I’ve replaced the line for temporary fix, can’t wait for the next release :stuck_out_tongue:

Hi there,

I’ve got the same issue using HASS on mein QNAP container.
Unfortunatelly there is no such python code to change. :frowning:

Hello, me too I have the same problem… Xiaomi Vacuum isn’t detected since 0.59

Still not working here at 0.63.
All the requirements are filled, nogo.

construct (2.9.29)
python-miio (0.3.5)

But now I’m getting:

(hass) hass@daredevil:~$ mirobo -d --ip 192.168.0.14 --token xxxxx info
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Connecting to 192.168.0.14 with token xxxxx
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container: 
    data = Container: 
        length = 0
        offset2 = 32
        value =  (total 0)
        data =  (total 0)
        offset1 = 32
    header = Container: 
        length = 16
        offset2 = 16
        value = Container: 
            length = 32
            unknown = 0
            device_id = \x03N\x16\x84 (total 4)
            ts = 2018-02-11 17:02:43
        data = !1\x00 \x00\x00\x00\x00\x03N\x16\x84Z\x80w3 (total 16)
        offset1 = 0
    checksum = \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff (total 16)
DEBUG:miio.device:Discovered unhexlify('034e1684') with ts: 2018-02-11 17:02:43, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.device:192.168.0.14:54321 >>: {'method': 'miIO.info', 'params': [], 'id': 1}
ERROR:miio.device:Got error when receiving: timed out
WARNING:miio.device:Retrying with incremented id, retries left: 3
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device:Got a response: Container: 

Your token has changed. Please extract the token again.

Edit: Sorry for the below. I didn’t see this thread: Miio platform broken after upgrade 0.62

I have had issues with Construct the last couple of releases or three. Now (with 63) I get this error:
Log Details (ERROR)
Sun Feb 11 2018 18:17:14 GMT+0100 (CET)

Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/usr/lib/python3.6/site-packages/homeassistant/components/vacuum/xiaomi_miio.py”, line 90, in async_setup_platform
from miio import Vacuum
File “/usr/lib/python3.6/site-packages/miio/init.py”, line 2, in
from miio.protocol import Message, Utils
File “/usr/lib/python3.6/site-packages/miio/protocol.py”, line 179, in
Const(0x2131, Int16ub),
File “/usr/lib/python3.6/site-packages/construct/core.py”, line 1894, in init
super(Const, self).init(subcon)
File “/usr/lib/python3.6/site-packages/construct/core.py”, line 291, in init
raise TypeError(“subcon should be a Construct field”)
TypeError: subcon should be a Construct field