Hi
first of all you must create items for each action and zone you want to control, here is an example: replace with your values: example :
Switch RobotVacuumNAMEOFTHEZONEArea
items files look like this :
/*Aspi*/
Group gVacuumArea "Nettoyage de Zone" <movecontrol>
Switch RobotVacuumActionSalleamangerArea "Nettoyage Salle a manger" <lawnmower> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionCuisineArea "Nettoyage Cuisine" <kitchen> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionSalonArea "Nettoyage Salon" <sofa> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionEntreeArea "Nettoyage Entrée" <frontdoor> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionCouloirArea "Nettoyage Couloir" <corridor> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionDressingArea "Nettoyage Dressing" <washingmachine> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionChambre_de_clementArea "Nettoyage Chambre de clément" <boy_2> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionBureauArea "Nettoyage Bureau" <office> (gVacuumArea) [ "Switchable" ]
Switch RobotVacuumActionMaisonArea "Nettoyage Maison" <groundfloor> (gVacuumArea) [ "Switchable" ]
then you need to install in paper ui / addon / transformation / RegEx Transformation
also in paper ui / addon / transformation / Map Transformation
then create a rule file like this one :
rule "Vacuum Cleaning Area Request"
when
Member of gVacuumArea changed to ON
then
// Only if the mi robot is currently on the dock
if (RoborockVacuum_StatusState.state == "Charging") {
val areaName = transform("REGEX", "RobotVacuumAction(\\w+)Area", triggeringItem.name)
val areaMap = transform("MAP", "vacuum_area.map", areaName)
if (areaMap != "")
RoborockVacuum_ActionsCommands.sendCommand('app_zoned_clean[' + areaMap + ']')
}
end
and finally create a map of your home in the transform directory and named it : vaccum_area.map
in this file, thanks to the android app flole vac found here [https://play.google.com/store/apps/details?id=de.flole.xiaomi], put the coordinates of your zones by launching a complete cleaning session, after cleaning completed and the map realized, define each zone by pressing “add zone”, then long press “cleaning button” and get the coordinates, put them in the vaccum_area.map you’ve created, it should be like this :
Salleamanger=[24801,25158,30901,27708,1]
Cuisine=[23262,27978,27462,29828,1]
Salon=[28598,29752,31948,33652,1]
Entree=[26934,28011,30984,29061,1]
Chambre_de_clement=[28449,33804,32249,37454,1]
Dressing=[24560,33818,28360,37468,1]
Couloir=[27414,28840,28264,33690,1]
Piece_de_vie=[23417,25285,32067,33735,1]
Bureau=[24680,29983,27330,31683,1]
Maison=[23280,25080,32230,37530,1]
Each zone name must be the same as in your item files !
to finish in your sitemap copy this :
Frame label="Aspirateur"{
Group item=gVac {
Switch item=actionControl mappings=[vacuum="Vacuum", pause="Pause",spot="Spot", dock="Base"]
Switch item=actionFan mappings=[38="Silence", 60="Normal", 77="Fort",90="Max", 1="Custom"]
Group item=gVacuumArea
Default item=statusBat
Default item=statusArea
Default item=statusTime
Group item=gVacStat
}
note the Group item= gVaccumArea same as in your item file.
i made it trhought this topic:
https://community.openhab.org/t/xiaomi-robot-vacuum-binding/31317/578
look may 2018 in history