Xiaomi Robot Vacuum Binding

binding
vacuum
xiaomi
Tags: #<Tag:0x00007f1831aa3f48> #<Tag:0x00007f1831aa39a8> #<Tag:0x00007f1831aa32f0>

(Miriam) #686

Hello,
I download and installed this binding today – great job!
But… I have one problem.
I had defined the item xy_ResetConsumable (where xy is myRoborock). Resetting the Consumables via PaperUI works fine, but I don’t know to set up the item in my sitemap.
Can you please help me with the correct definition of mappings (I think this is the main problem)?
I tried with

Selection item=xy_ResetConsumables mappings=[resetMainbrush=“ResetMainBrush”, resetFilter=“ResetFilter”, resetSensors=“ResetSensors”, resetSidebrus=“ResetSidebrush”]

and

Selection item=xy_ResetConsumables mappings=[Mainbrush=“ResetMainBrush”, Filter=“ResetFilter”, Sensors=“ResetSensors”, Sidebrus=“ResetSidebrush”]

but both variants doesn’t work.

Sorry if the question seems to be too easy, but I’m new.


(Brian M. Pedersen) #687

When vacuuming with defined coordinates, is the origin (0,0) defined as the charging station?


(Christopher Hemmings) #688

Download flolevac on Android and connect to you it vac through that. You can set a zone using the map and hold down the go button it will copy the coordinates


(Cernon) #689

in an other thread I found the info that the station has the coordinates 25500/25500. Every mm is one point, more to right and forward and less to left and backward. That works for me, so I don’t need an App.


(Cernon) #690

that looks nice. Is it right that you define two zones in one command? clean the vacuum than two zones?


(Adrian Bonacker) #692

Hey,
finally after one day of work and the experience of the other people in this topic i got my xiaomi vacuum v1 working with the “zoned clean up” in openhab, and it works perfectly!

Because i have no android device i had to use an Android emulator and the Flulevac App out of the play store to get the coordinates for the different rooms.

this is my sitemap (i linked the sitemap items with the roborock thing in the paper UI):

Group item=gVac
{
                Switch item=rockrobo_zonecleaning label="Raum Reinigen" mappings=[1="Wohnzimmer",2="Küche",3="Flur",4="Schlafzimmer",5="Badezimmer",6="Kinderzimmer"]
                Switch item=actionControl label="Funktionen" mappings=[vacuum="Start", pause="Pause",spot="Spot", dock="Dock"]
                Switch item=actionFan label="Saugstärke" mappings=[38="Leise", 60="Normal", 77="Power",90="Maximun", -1="Andere"]
                Default item=statusBat label="Batterie"
                Default item=statusArea label="Gereinigte m2"
                Default item=statusTime label="Reinigungszeit"
                Group item=gVacStat label="Status Details"
                Group item=gVacCons label="Gerätezustand"
                Group item=gVacDND label="Nicht Stören"
                Group item=gVacHist label="Reinigungsverlauf"
                Group item=gVacNetwork label="Netzwerk"
}


my items (the Room Switches are visible for Alexa and Homekit):

Switch WZsaugen "Wohnzimmer saugen" [ "Switchable" ]
Switch KZsaugen "Kinderzimmer saugen" [ "Switchable" ]
Switch Kusaugen "Küche saugen" [ "Switchable" ]
Switch Flursaugen "Flur saugen" [ "Switchable" ]
Switch SZsaugen "Schlafzimmer saugen" [ "Switchable" ]
Switch BZsaugen "Badezimmer saugen" [ "Switchable" ]
String Dock "Dock" {channel="miio:vacuum:XXXXXXXX:actions#control"}
String rockrobo_zonecleaning "Zone"

my rules:

rule "Zone Cleaning"
when
Item rockrobo_zonecleaning received command
then
switch (receivedCommand.toString)
{
case "1":
{
        sendCommand(actionCommand,"app_zoned_clean[[25279,23696,30029,27196,1]]")
}
case "2":
{
        sendCommand(actionCommand,"app_zoned_clean[[31403,25481,34203,27131,1]]")
}
case "3":
{
        sendCommand(actionCommand,"app_zoned_clean[[30060,25662,31560,29612,1]]")
}
case "4":
{
        sendCommand(actionCommand,"app_zoned_clean[[26444,27131,30294,30931,1]]")
}
case "5":
{
        sendCommand(actionCommand,"app_zoned_clean[[31157,28018,34107,29668,1]]")
}
case "6":
{
        sendCommand(actionCommand,"app_zoned_clean[[30060,25662,31560,29612,1]]")
}
}
end

//WZ Switch Commands
rule "WZ saugen ON"
when
Item WZsaugen received command ON
then
sendCommand(rockrobo_zonecleaning,1)
end
rule "WZ saugen OFF"
when
Item WZsaugen received command OFF
then
sendCommand(Dock,"dock")
end

//Küche Switch Commands
rule "Ku saugen ON"
when
Item Kusaugen received command ON
then
sendCommand(rockrobo_zonecleaning,2)
end
rule "Ku saugen OFF"
when
Item Kusaugen received command OFF
then
sendCommand(Dock,"dock")
end

//Flur Switch Commands
rule "Flur saugen ON"
when
Item Flursaugen received command ON
then
sendCommand(rockrobo_zonecleaning,3)
end
rule "Flur saugen OFF"
when
Item Flursaugen received command OFF
then
sendCommand(Dock,"dock")
end

//SZ Switch Commands
rule "SZ saugen ON"
when
Item SZsaugen received command ON
then
sendCommand(rockrobo_zonecleaning,4)
end
rule "SZ saugen OFF"
when
Item SZsaugen received command OFF
then
sendCommand(Dock,"dock")
end

//BZ Switch Commands
rule "BZ saugen ON"
when
Item BZsaugen received command ON
then
sendCommand(rockrobo_zonecleaning,5)
end
rule "BZ saugen OFF"
when
Item BZsaugen received command OFF
then
sendCommand(Dock,"dock")
end

//KZ Switch Commands
rule "KZ saugen ON"
when
Item KZsaugen received command ON
then
sendCommand(rockrobo_zonecleaning,6)
end
rule "KZ saugen OFF"
when
Item KZsaugen received command OFF
then
sendCommand(Dock,"dock")
end

//Update Switches when Charging
rule "Saugen Switches OFF"
when
Item statusStatus received update "Charging"
then
postUpdate(WZsaugen, OFF)
postUpdate(Kusaugen, OFF)
postUpdate(SZsaugen, OFF)
postUpdate(Flursaugen, OFF)
postUpdate(BZsaugen, OFF)
postUpdate(KZsaugen, OFF)
end

When the room needs more than one zone just add the coordinates in the actionCommand separated with a comma

I didn´t try, if the zoned clean up has the same coordinates when the roborock made a new map. as long as i only use the zoned clean up the map will be same. for my one level flat without stairs it´s no problem.

at least i want to say thanks for building this binding and everybody here sharing his experiences :slight_smile:


(Miriam) #693

Hello,
can somebody show the items in sitemaps for Reset_Customable? Which is the correct mapping?

Thank you.


(marcel) #694

In theory yes, but you still need to implement the client.
I give more hope to this project. As far as I understand it basically renders the map on the device itself.
Hence we would not need any client lib to pull the image.


(Jay) #695

I bought a Roborock the other day and installed the Xiaomi Mi Smart Home binding to try linking it to my OpenHab. Is this possible without having a Xiaomi Gateway? This isn’t very clear in the documentation.


(Roel) #696

You need to extract the token from your roborock as described in the first post of this topic.


(Cernon) #697

I have this string. Not fully tested.

Switch item=ConsumableReset label="Reset []"  icon="reset" mappings=[main_brush_work_time="Hauptbürste", side_brush_work_time="Seitenbürste", filter_work_time="Filter", sensor_dirty_time="Sensor"]

(Miriam) #698

Thank you… that seems to be the correct mapping (the app doesn’t crash if i try to reset the sensors and the remaining percentage now is 100!)


(Miriam) #699

I had the problem with getting the token. The MiToolkit requested a passphrase because the device is encrypted (by default!). A modified Boot-Image must be installed!

With Apple OSX it was quite easier to get the token. A description (in german) is here:

A short description in english:

  • install the mi-home-app via app-store and set up your vacuum.
  • after that make an unencrypted backup of your device
  • open the unencrypted backup with iphonebackupviewer (link is given in the german description)
  • go to appdomain-com.xiaomi.mihome and search for a file beginning with a number and ends with _mihome.sqlite, e.g. 1719973717_mihome.sqlite
  • extract this database and open it with an editor
  • here you can find a 96-digit code containing only numbers and charts (a exemple is shown in german description)
  • copy this 96-digit code in the “input text”-field on aes.online-domain-tools.com, and put 32 zeros in the field “key”.
  • you get a 32-digit decoded token in a table wich you had to insert in “token”-field of the binding.

(Sören Beye) #700

Not quite. Currently, the map is rendered inside the browser so you can’t just fetch an image file. However this is still WIP and I’m not sure how it will turn out


(marcel) #701

The conversion from 96 digit to 32byte is done by the binding as well. So you can enter the 96 code right in the thing config.


(marcel) #702

Ah… indeed than that was too optimistic.
But with habpanel can this possible work?


(Pumino79) #703

Hi marcel I have a problem binding the xiaomi philips wifi lamp ( https://www.gearbest.com/flush-ceiling-lights/pp_633589.html ).
I have installed both the binding “Xiaomi Mi IO Binding ver. market:binding-3499123 - 1.0” and “Xiaomi Mi Smart Home Binding ver. binding-mihome - 2.3.0.SNAPSHOT” but when I try fo find the lamp I don’t find anything and I proceed with manual binding. I have tried all the combination of device (Xiaomi Mi IO Basic device, Xiaomi Mi IO device, Xiaomi Robot Vacuum, Xiaomi Unsupported Mi IO device) but in any case I was able to control the wifi lamp. I have the token and it works because I also have miivacuum robot and I can see all the info from openhab.
Waiting for your kindly reply.


(David De Marco) #704

Have just tried this using the number I got using the text editor method of opening the sqlite file and then just pasted that into the binding. System is online!!


(lamero) #705

Firmware can be upgraded safely? Binding will work?


(Matthias Dohr) #706

i updated, no problem yet