Xiaomi Robot Vacuum Binding

Tags: #<Tag:0x00007fd30f9cfa60> #<Tag:0x00007fd30f9cf8f8> #<Tag:0x00007fd30f9cf7b8>

(marcel) #650

Yes, I expect so. I have the same light and control it with the binding.

(Ward) #651

ok thanks.
I received this lamp from a colleague to test :slight_smile:

Is it correct I need to install the binding via the marketplace? https://marketplace.eclipse.org/content/openhab-xiaomi-vacuum-binding
Don’t see it in the official addons list.

(marcel) #652

indeed, that’s the one. Read in the topic wrt how to retrieve the token (needs older version of the android app)

(Tom) #653

I don’t get the Device Model String appearing and the Thing is offline.

The log shows:

2018-06-12 16:10:26.406 [INFO ] [ing.miio.handler.MiIoAbstractHandler] - Mi IO model roborock.vacuum.s5 identified as: Mi Robot Vacuum v2 (roborock.vacuum.s5). Matches thingtype miio:vacuum

I’ve double-checked the token.

Do I need to enter Device Model String manually?

Not sure what else to do?

Any ideas? I’ve searched the whole thread!


(Tom) #654

Fixed. I didn’t realise I needed to create a manual ‘thing’ file rather than use PaperUI discovery.

Anyway, is online now.

(Oli M) #655

can you please add support for Xiaomi Philips Zhirui Downlight?

Device ID: 71724616
Model info: Unknown
Token: ???
Support: Unknown

It has the same functionality as e.g. the philips bulb

(mcqwerty) #656

@marcel_verpaalen Thank you for this great binding, I have my Roborock S50 working nicely with OH.

I notice from the app that there is a volume setting, (Vacuum settings -> Volume settings), that enables setting the volume of the voice prompts on the robot. I can’t however see any way to set this via OH or any mention of it in your protocol documentation. Would it be possible to add a channel to the binding to enable setting of the volume via OH?

Also, the find_me feature is documented in your protocol docs but as far as I can see, this is not available as a channel to OH, would it be possible to add this also?


(marcel) #657

Can you please find the model (will be shown once you have the token in OH)
Can you than overwrite the model in the config with the philips bulb one. If it is the same, it will function. E.g philips.light.bulb

(marcel) #658

Can you try to execute get_sound_volume and set_sound_volume[50] via the command channel and send me the output. I think those are the commands to control it.

Btw. The findme channel is I believe an advanced channel so needs to be unhide in paperui to enable

(Oli M) #659

when i change the device model string in paperui to philips.light.bulb nothing changes.
it stays as miio.generic device

there also seems to be a bug with (experimental)Execute Test Commands channel.
it is a switch, shouldnt it be a string?

(experimental)Execute Test Commands

(marcel) #660

Please add it (manually) as a basic device. In your case, it already updated itself to an unsupported thingtype.

The switch testcommand was/is executing various commands to test if they are working. This switch will most likely be removed in future versions.

(Oli M) #661

when adding it as basic device with device model string philips.light.bulb it works!
i can switch it on/off and adjust brightness and cct!

However, MiToolkit says the device name is: philips.light.downlight
When addind it as basic device with this device model string i get ssid bssid rssi etc channels but no on/off, brightness, cct.

also it says:
serialNumber 044xxxxx
modelId philips.light.downlight
vendor Xiaomi
wifiFirmware 1.5.0-dev(7f7a714)
hardwareVersion ESP8266
Current firmware version: 1.3.0_0021

(JustAProgrammer) #662


gYeelights_c.sendCommand(new HSBType(new DecimalType(0),new PercentType(100),new PercentType(100)))

in my .rules file actually dims the Yeelights to about 50% of their actuall brightness.
Any Solutions ?

(marcel) #663

I’ve added it in the database with the same parameters as the regular Philips bulb. (should be in the market place in about 30 min) . That way next time it will automatically recognize it as basic device
Let me know if there are channels that don’t work.

note. the ssid bssid rssi etc channels are marked as advanced, hence by default deselected & hidden. You can enable them in paperUi.

(mcqwerty) #664

Results of get_sound_volume:

16-Jun-2018 09:28:16.860 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":33232,"method":"get_sound_volume","params":[]} -> (Device: 05C181DD token: 45687475534771494356674E446C4C4F Queue: 1)
16-Jun-2018 09:28:16.860 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Sending Ping 05C181DD (
16-Jun-2018 09:28:16.863 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Ping 05C181DD ( success
16-Jun-2018 09:28:16.898 [DEBUG] [g.openhab.binding.miio.handler.MiIoAbstractHandler] - Received response for House_MainFloor__Vacuum_S50 type: UNKNOWN, result: [90], fullresponse: {"result":[90],"id":33232}
16-Jun-2018 09:28:33.889 [DEBUG] [org.openhab.binding.miio.handler.MiIoVacuumHandler] - Periodic update for 'miio:vacuum:House_MainFloor__Vacuum_S50' (miio:vacuum)
16-Jun-2018 09:28:33.890 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":33233,"method":"get_dnd_timer","params":[]} -> (Device: 05C181DD token: 45687475534771494356674E446C4C4F Queue: 1)
16-Jun-2018 09:28:33.891 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Sending Ping 05C181DD (

Results of set_sound_volume[50]:

16-Jun-2018 09:33:25.631 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":33276,"method":"set_sound_volume","params":[50]} -> (Device: 05C181DD token: 45687475534771494356674E446C4C4F Queue: 1)
16-Jun-2018 09:33:25.631 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Sending Ping 05C181DD (
16-Jun-2018 09:33:25.634 [DEBUG] [ing.miio.internal.transport.MiIoAsyncCommunication] - Ping 05C181DD ( success
16-Jun-2018 09:33:25.716 [DEBUG] [g.openhab.binding.miio.handler.MiIoAbstractHandler] - Received response for House_MainFloor__Vacuum_S50 type: UNKNOWN, result: "unknown_method", fullresponse: {"result":"unknown_method","id":33276}
16-Jun-2018 09:33:34.060 [DEBUG] [org.openhab.binding.miio.handler.MiIoVacuumHandler] - Periodic update for 'miio:vacuum:House_MainFloor__Vacuum_S50' (miio:vacuum)

I checked the volume level in the app after the command and it has not changed.

I had the ‘more’ open viewing the advanced features and findme was not visible.
See images:

Sorry about the length of that post, just wanted to include all of the channels I have for the vacuum thing to see if I have missed the findMe channel.
If I command the command channel with 'find_me' then the robot responds.


(Oli M) #665

great thanks!
it now gets automatically recognized as philips.light.downlight
power, brightness, cct, scene, toggle, works nice!!

(marcel) #666

Looks indeed like it is not there. I remember I added it once, but I may have removed it at the major refactoring. I’ll check and add it back.

Wrt volume indeed that command was not recognised, can you test command

(mcqwerty) #667

That command does indeed change the volume, however not to 50%!
I did some experimentation, here are my findings:

<=30: Minimum
=60: 50%
>=90: 100%

I would not describe the minimum volume as 0% as the voice prompts are still audible but very quiet.
So for a Dimmer type channel it looks like translating the 0-100 value to a change_sound_volume[n] between 30 and 90 would work.

Regarding 0% volume or muting the voice prompts, I believe that is what the DND feature is supposed to do.
Setting the dnd_enabled switch to ON does not seem to work for me as the app shows that the command was ignored.
Is it possible to set the DND status via the binding?

Also, (and this is not really a binding-specific question), does anyone have any experience of the DND function working? If I manually enable DND through the app and trigger a ‘zoned cleanup’ or a ‘goto target’ the robot still replies with voice prompts.
What I am trying to do, in addition to setting the volume levels given certain conditions, is also to be able to completely mute the voice prompt but still control the vacuum.

(Ondrej Pecta) #668

Hello Marcel,
I just can’t find out, how to send set_power command with single complex param: {“uid”:“1612368538”,“params”:“On”} in a rule by sendCommand to a Things actions#command channel.
I have tried set_power{“uid”:“1612368538”,“params”:“On”} and set_power[{“uid”:“1612368538”,“params”:“On”}] but without success.
Does your binding support these command types, I mean without the list of parameters?
The device is Xiaomi Xiaofang 1080p Camera (isa.camera.isc5) and I have captured this communication with Wireshark:

data= {"id":1300,"method":"set_power","params":{"uid":"1612368538","params":"On"}}
data= {"id":1301,"method":"set_power","params":{"uid":"1612368538","params":"Off"}}


(marcel) #669

The binding only supports sending the parameters as jsonarray, your wireshark sample suggests a json object instead which is not supported.

Did you manually decrypt the wireshark data? Note that the binding always encrypt the data, hence if you did not decrypt it manually you can’t send it.

Note, I recall in the yeelight topic an example of sending similar unencrypted command with a rule, you may want to search for that