Xiaomi Mi vacuum unavailable in 0.77

Hi, I’ve been trying to get this awesome vacuum integrated with Home Assistant and having lots of trouble. I verified the IP address and token are correct already.

Update of vacuum.xiaomi_vacuum_cleaner is taking over 10 seconds
3:33 PM core.py (WARNING)

Got exception while fetching the state: No response from the device
3:33 PM components/vacuum/xiaomi_miio.py (WARNING)

Updating xiaomi_miio vacuum took longer than the scheduled update interval 0:00:20
3:33 PM helpers/entity_platform.py (WARNING)

Got error when receiving: timed out
3:33 PM components/vacuum/xiaomi_miio.py (ERROR)

I’ve followed all the instructions I could find online for fixing this; rolling back to an earlier version of construct, and making some tweaks in miio’s protocols.py file (which I didn’t actually do since the ones in the posts I’d read about have already been committed by now).

Any other ideas on things I can try? Is anyone using this successfully now?

Does that mean you have not tried to integrate it pre 0.77? Works for me in 0.76.2…
Only obvious breaking change that I’ve see is:

Update Xiaomi Vacuum to new StateVacuumDevice changed some services: turn_on -> start , turn_off -> return_to_dock , toggle has been removed. States ‘on’ and ‘off’ will also no longer be used.

Correct, this is my first time integrating it, and I updated Home Assistant before starting. I think what I’m seeing is an issue of device communication rather than something related to states.

Try and update to 0.77.1 as there is a fix which may resolve your issue

Ugh, I figured it out… Didn’t realize the token changes with each new pairing of the vacuum to an app. I was using this hacked Russian app to provide me with the token, but then uninstalled that app and replaced with Google Play version). Lesson learned.

Nice one. Would be a good idea if you raised a change to update the docs

Thanks for the hint. I was also struggling with Mi Robot being unavailable although it worked fine from HA some time age.

Now I realised that before that I changed wifi network vacuum is connected to and that apparently involved new pairing and subsequently issues new token.

I had to repeat quirky procedure of getting token and fortunately vacuum is again available in HA. This should definitely emphasised in docs.

The Vacuum for me it’s working in HomeAssistant, but the switch exposed to the Home App via home bridge don’t work anymore, before this update when I turned it on, the cleaning started, and when it was off the vacuum went back to the dock. Now nothing happen… anyone have any solution for this?

You need to use:
action:
service: vacuum.start
entity_id: vacuum.rockrobo

Hi all experts,

I am a newbie here, I just bought the Xiaomi Vacuum robot 1,
in my config I have this,
vacuum:

  • platform: xiaomi_miio
    host: 192.168.15.189
    token: YOUR_TOKEN

Running Home Assistant 0.84.6 on a PI 3, I can see the Vacuum in the Hass UI, but status is showing unavailable,

in the log I am getting

2019-01-02 05:32:41 ERROR (SyncWorker_1) [miio.device] Unable to discover a device at address 192.168.15.189

2019-01-02 05:32:41 WARNING (SyncWorker_1) [homeassistant.components.vacuum.xiaomi_miio] Got exception while fetching the state: Unable to discover the device 192.168.15.189

do I need to manually update any lib to make this work so I can control the vacuum from Hass UI please?

thanks in advance.

Wilson

that should work. How did you retrieve your token?

I used that miToolkit to extract the tokens, that is what I do for my other Mi sockets etc, and those sockets seems to show up fine in Hassio, so somehow just doesn;t work for the vacuum.,

You may want to double check, i believe the vacuum token retrieval is slightly different than other Xiaomi devices


What do you use, an Android or iPhone?

I am using android, I also tried repair with my MI app, and miToolkit got the token again still no luck, then tried using the miio discovery, it could discover the vaccum on the same IP, but it returns ??? as the token, so I am not sure if it was anything to do with my network, I have quite many MI devices at home, but it seems like only the REPEATERS return the TOKENS, everything else returns “???” , any more advices please?

Which version of the app do you use on your phone? There’s a note in the setup section stating the latest versions of the android app no longer work.
Also depending on the version of the firmware you may need to downgrade it on your vacuum to retrieve the token. Please review the setup instructions carefully

I too am having issues with my xiaomi vacuum (gen 2) integration recently. It worked fine for a few months, started getting the unavailable status in the last few days.

I’ve tried a bunch of different things to try and fix this including simple things like restarting HA and to more heavy handed things like resetting the vacuum and checking if it works on a new installation of hassio all to no avail.

I’ve double checked that the IP address and token are correct as well.

In the logs I’m seeing errors like this

Got exception while fetching the state: Unable to discover the device 192.168.1.65

8:52 PM components/vacuum/xiaomi_miio.py (WARNING)

Unable to discover a device at address 192.168.1.65

8:52 PM components/vacuum/xiaomi_miio.py (ERROR)

I wonder if the xiaomi server the device is tied to has anything to do with it (mine is on the singapore server).
I would appreciate it if anyone has any tips on how to resolve this issue.

this is the exact message I am getting with my vacuum 1,

also I was wondering about the “region server” as well, all my devices are connected to the “Mainland china” server, but the vacuum I got requires the “OTHER” region.

I don’t know enough, but I would expect the “REGION” doesn’t matter in this case as Hassio directly access the mi devices directly within LAN and not to the MI Server right? <-- please correct me if I am wrong.

I have the latest MI App on my phone, and the 5.0.X mi app on my tablet, I only use my tablet to retrieve the token which seems to work fine. just to make sure, I will try getting the tokens from the my ipad as well, and see if they are the same or not.

I also read the other thread dated early this year with similar unaviaible message, some people mention updating the miio/device.py file manually. I just wasn’t sure what version of the MIIO do I have in my hassio, I tried copying the device.py into the custom_component\miio\device.py, but it doesn’t make any difference… really running out of ideas apart from dobule checking the token on IPAD… :frowning:

if you have an iPad, then try that as the token is still saved within the app.
If you want to use Android, as per the doc, you’d need 5.0.30 on your Android device to retrieve the token as from 5.0.31 onwards the token is no longer saved in the app itself:

ok now, I got further with this, I used ipad to extract the token, and it is exactly the same as the one from android.

so what I did next was installed a new fresh copy of Hass on a windows pc, with the exact config.yaml and same token, I could connect to the mi robot without problems from the windows version, which means I think there are some differences between the hassio on raspi and windows? I tried copied all the miio*.* from the windows install dir to the raspi custom_component folder, then rebooted but still can’t connect to the robot. I guess the next thing is I need to find out how to figure out if the raspberry pi is picking up the miio files from the custom_component folder correctly.