Xiaomi Robot Vacuum Binding

I’ve added (experimental) support for your light. Please update your binding and give it a try.

This device is added as well

1 Like

Marcel, Thanks a lot, I am not sure If I doing it correctly …

I got new file https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.miio/2.4.0-SNAPSHOT/org.openhab.binding.miio-2.4.0-SNAPSHOT.jar

And instead of
Thing miio:basic:0533726B “Philips ZhiRui bedside lamp” [ host=“1xxxx”, token=“xxx”, model=“philips.light.bulb” ]

I did
Thing miio:basic:0533726B “Philips ZhiRui bedside lamp” [ host=“1xxxx”, token=“xxx”, model=“philips.light.moonlight” ]

In first I got power and other stuff and I was able switch on off
Second with binding update I see only Items Network and Action - Execute Command

even with my items file:

// Philips ZhiRui bedside lamp WIFI
Switch power “Power” {channel=“miio:basic:0533726B:power”}
Dimmer brightness “Brightness” {channel=“miio:basic:0533726B:brightness”}
Dimmer cct “Correlated Color Temperature” {channel=“miio:basic:0533726B:cct”}
Number scene “Scene” {channel=“miio:basic:0533726B:scene”}
Number dv “DV” {channel=“miio:basic:0533726B:dv”}
Switch switchscene “Switch Scene” {channel=“miio:basic:0533726B:switchscene”}
Switch delayoff “Delay Off” {channel=“miio:basic:0533726B:delayoff”}
Switch toggle “Toggle” {channel=“miio:basic:0533726B:toggle”}

----- EDIT

When I do miio.things like

Thing miio:basic:0533726B “Philips ZhiRui bedside lamp” [ host=“1xxxx”, token=“xxx” ]

I get messages:
Mi IO model philips.light.moonlight identified as: Xiaomi Philips ZhiRui bedside lamp (philips.light.moonlight). Matches thingtype miio:basic
and then
Database entry for model ‘philips.light.moonlight’ cannot be found.

Thank you :slight_smile:

@CoolTom :frowning: my bad… I made a typo in the database entry (entered philips.light.moon instead of philips.light.moonlight ) I fixed it now…

Thanx a lot. Working as before … just … only power on/off work (and toggele have same effect as power on/off) :))))
Change color, britness, switch scenes etc. doesnt work … not sure what is DV and delay off …

how to check what is worng …

// Philips ZhiRui bedside lamp WIFI
Switch PZBL_power “Power” {channel=“miio:basic:0533726B:power”}
Dimmer PZBL_brightness “Brightness” {channel=“miio:basic:0533726B:brightness”}
Dimmer PZBL_cct “Correlated Color Temperature” {channel=“miio:basic:0533726B:cct”}
Number PZBL_scene “Scene” {channel=“miio:basic:0533726B:scene”}
Number PZBL_dv “DV” {channel=“miio:basic:0533726B:dv”}
Switch PZBL_switchscene “Switch Scene” {channel=“miio:basic:0533726B:switchscene”}
Switch PZBL_delayoff “Delay Off” {channel=“miio:basic:0533726B:delayoff”}
Switch PZBL_toggle “Toggle” {channel=“miio:basic:0533726B:toggle”}

log show like
Item ‘PZBL_brightness’ received command 43
PZBL_brightness changed from 100 to 43
PZBL_brightness changed from 43 to 100
PZBL_toggle changed from ON to OFF
PZBL_power changed from OFF to ON

@CoolTom I copied the data from other Philips light.
Only specific implemented to your light was the reading of the power on/off

Rest of the properties need to be tested. If items don’t work, pls set the log to debugging and send it with PM so I can look at the responses

Thnx. Marcel, more hint how to force lamp sent comands out and capture/debug them?

What about this description https://github.com/rytilahti/python-miio/issues/351

# Model name

# Supported properties
["pow", "sta", "bri", "rgb", "cct", "snm", "spr", "spt", "wke", "bl", "ms", "mb", "wkp"]

# Supported methods
add_mb                          # Add miband
enable_bl                       # Night light
enable_sub_voice                # Sub voice control?
enable_voice                    # Voice control
get_band_period                 # Bracelet work time
get_mb_rssi                     # Miband RSSI
get_mb_mac                      # Miband MAC address
set_bricct                      # Brightness & Color temperature
set_brirgb                      # Brightness & RGB
set_bright                      # Brightness
set_cct                         # Color temperature
set_rgb                         # RGB
go_night                        # Night light / read mode

Sending cmd get_prop with params ['pow', 'sta', 'bri', 'rgb', 'cct', 'snm', 'spr', 'spt', 'wke', 'bl', 'ms', 'mb', 'wkp'] ['off', 0, 1, 16741971, 1, 0, 0, 15, 0, 1, 1, 1, [0, 24, 0]]


yes, that helps. Can you please suggest the names for there properties
Likewise, for the relevant commands, please suggest / test the format of the parameters that need to be provided.

to do that, you need to use the command channel the parameters go between brackets.
you can see results by enableing debuf (see very first topic on how to do so)

Thanks Marcel, your binding now works excellent, response is quick as well,
I am giving up yeelight binding as it won’t get item status, only output command and still always offline,
Is it possible that you may do more on lighting in your coding part,
there is 2 thing missing,

  1. off when choice 0, can your code as when received command as 0 then ignore response from light about brightness and give command off to power until power is on, then get update again?
  2. when moon light mode is on, brightness of moon light will be response at another location although you change brightness value will adjust moon mode brightness, but value will soon change back to day light brightness value

I was checnking first post. Debug like run this on cmd in openhab?

log:set debug org.openhab.binding.miio
log:display org.openhab.binding.miio

Can you please write how to send commands over command channel? its some cmd tool or using your binding or …

Thanks a lot, Like to help, but I am lost with this …

@CoolTom indeed… that is to get the debugging.
To send commands, enable the channel in paperUI (using the ‘show more’ in the channel list as it is a channel marked as advanced) and link an String item to the channel.

You can than send the command to the created string item. It will send the command to the Xiaomi device and update the channel with the response.

Thnx Marcel. I will do and report soon.

I had the same issue that the coordinates map has changed. What I did I’ve returned the vacuumm to the dock (dock in same place) started full cleanup, few seconds and then stop it. My map seems to be similar to the map which I saved the coordinates. Can it be that there is a repeatable way to force the robot to return back to the same map?


I have the token of the robot. No I want to connect Xiaomi color light. Do I need a token (to the lamp)? If so, I need to downgrade the app again. Will I get new token to the vacuum when I am doing that?

Thx for the help

I’ve see stories of people claiming having success that way… They made the starting path limited, so robot always had to start the same way… that way maybe you can control it the coordinate system

@smhgit you need the token for each device.
So yes… The same downgrade cycle again.

My personal solution… I have an old phone, no longer in normal usage… That one had the old mihome version, and I prevent it from getting updates… The tokend get synced over all phones you have.

1 Like

Yes I saw it, but what i think I saw was that starting clean (not zone) rebase the map, assuming robot is in the same position. If this is the case (and I am not sure), a rule can rebase the map every day, just to be sure …


Is there a way to be notify when the yeelight (basic) switched on / offf (online / offline) - something like LIFX have with the thing status info?

For the vacuum?


Just wanted to say thanks for the awesome binding! Now I don’t have to switch to that mi home app from habpanel all the time!

Oh and it seems that with the newest roborock update the map can be stored, so maybe the repositioning issue with zoned cleanups after a full cleanup will be gone as the SLAM will match the stored map… We’ll see!