Xiaomi Robot Vacuum Binding

Tags: #<Tag:0x00007fd30e290bd8> #<Tag:0x00007fd30e290a98> #<Tag:0x00007fd30e290958>

(Smhgit) #529


Got my robot cleaner (Ver 2) yesterday. At first didn’t notice that I need version 5.0.19 to get the token so i’ve wasted some time trying to get it :frowning:
After switching to version 5.0.19, I’ve got the token immediately (didn’t need to use main china land, other works fine).
As I am defining all things only via configuration files (and not using paperUI), it took me some time to find the Thing definition and now IT IS WORKING :slight_smile:

@marcel_verpaalen Big Thanks for the binding! great job!

(Hallo Ween) #530

Can you show me your thing definition? I want to switch to manual configuration?

(Smhgit) #531


Thing miio:vacuum:gf “Xiaomi Robot Vaccum Cleaner” [ host=“”, token=“7066xxxxxxxxxxxxxxxx” ]

gf for me is: ground floor, but you can set any other id

(Hallo Ween) #532

My yeelight lightstrip is shown as

Xiaomi Mi IO Basic device

in paper ui. Do i have to enter this into the thing file or do i have to enter another description for my light?

This is my item:

Switch  Xiaomi_LightStrip_Switch  "Xiaomi Light Strip Power"  {channel="miio:basic:0456A014:power"}

Is “miio:basic:…” the right word for the item or can i also use other words? Maybe “light”? Is this only cosmetic or is there a functional difference also?

(marcel) #534

miio:basic: is indeed the right thingtype.
The basic type is for all devices that have their definition coming from the database entries.
The 3rd part of the thingId you can make whatever you like, it does not need to be the number which you have right now ( e.g. miio:basic:strip1:power)

(Hallo Ween) #535


Another question: I have number items for brightness, color and mode.

brightness works with dimmer on my sitemap.

But color is not working with dimmer. What is the right widget to use on my sitemap? Can i use the colorwheel with this number item?

And what is mode? I always get the value “2” and i can´t change it.

(Jakub Górzyński) #536

Can I somehow enable Air Purifier 2S (this is newer version os AP 2 with PM2.5 sensor and OLED screen). Currently it is discovered as Unsupported device. I hope that interface is the same as for old version at least beside the PM sensor readout. I would be happy to control 2S just like 2.

(marcel) #537

You can add it manually as basic device and update the model string in the config to one of the older models which is supported e.g. to zhimi.airpurifier.v6
You can try different models to see which best match your device.
Let me know which one it it and your exact model string then I can add it to the db

(Jakub Górzyński) #538

AirPurifier 2S is detected as zhimi.airpurifier.ma2. Adding basic device and configuring it as zhimi.airpurifier.v6 worked like a charm. Even LED control turns on/off the OLED screen. Thank you very much for solution.

I cannot add link to miio:basic:e208e4cf:bright and miio:basic:e208e4cf:filterlife, but it’s not a problem. Everything else seams to work fine.

Let me know if and how I could help in adding 2S officially.

(marcel) #539

24-03 Small update to the binding

  • Added AirPurifier 2S detected as zhimi.airpurifier.ma2 to the database @Jakub_Gorzynski
  • Added Philips Eyecare 2 & improve Yeelight 650 (thanks to @dimalo)

Known issues

  • Ports not being closed found by @mhilbush
  • Yeelights still very alpha supported

Note: latest Android MiHome no longer has the tokens in the database. Use 5.0.19 version, see link in the post earlier

(Mark) #540

I took a quick look at the code. It may be something as simple as closing clientSocket in stopReceiverThreat instead of (or in addition to) the calls to interrupt/join. I think that will cause an IOException in receiveData, which is caught and will cause the receiver thread to exit.

(trant) #541

I’ve running the binding now for months and it worked really fine. Yesterday i switched my openhab to docker an now i can’t control my vaccuum and i get no state updates. The paper ui shows me that everything is online. Nothing can be seen in the logs.
Any ideas how i can find out whats going wrong?

Binding versions:

(Michael) #542

How would this look like for every single consumable?
I’ld like to reset the brush, the sensors , etc. individually for my vacuum cleaner. Is this possible?

(trant) #543

Where can i get older versions of the binding?

Found it: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.miio/

Version ist working again

(marcel) #544

You indeed the last build based on 2.2 there. Outside of that, you can always check out older versions and compile yourself.

Having said that, out is very strange, as almost no significant changes have been applied since December, mostly database updates.

What specific issue you encounter?

(trant) #545

My problem was that my vacuum wasn’t reacting on any command, without any errors in the logs. In th paper ui in openhab the status was ‘online’.

(Caroline O) #546

Thanks again for that great binding. I now get to work my phillips eyecare lamp 2 and my new vacuum :grinning:

(Peter Mueller) #547

I updated to latest Mi Home and latest Mi firmware as this enables zone cleaning also in my v1 vacuum. However, now I lost control of the cleaner in openhab. Is there any way to use openhab even with latest firmware, e.g, without going back to 5.0.19?

(Andrew Pawelski) #548

i had a working wifi plug which ai lost contact with. It still worked in the mi home app, the only thing out of place i noticed was the IP address had changed. I have removed it and readded it in the mi home app and also removed from OH. It is no longer discovered - anyone have any ideas?

Also wondering if the token issue people are seeing in Android is a probelm for IOS users?

Yeelight binding?
(Andrew Pawelski) #549

OK answered it myself - no longer autodiscover but chucked in the IP address and the token (from the IOS app still) and it worked