[SOLVED] Xiaomi Valetudo Zone Cleanup MQTT Command

Hello Together,
i try to setup the Zone Cleaning for the S50 Roborock. Unfortunately to send to Cords don’t work.

Ther for try to use MQTT Commands. With this Command the Robot went to the right place.

mosquitto_pub -h localhost -p 1883 -u xxxx-P yyyy- -t 'valetudo/rockrobo/custom_command' -m "{\"command\":\"zoned_cleanup\",\"zone_ids\":[\"kitchen\"]}"

But i have no idea how the Thing should look.

Can give my anybody an hint ?
regards Mario

I found an solution

Type string : Zone_Cleanup [ stateTopic=“valetudo/rockrobo/attributes”, transformationPattern=“JSONPATH:$.state”, commandTopic=“valetudo/rockrobo/custom_command”, formatBeforePublish="{“command”:“zoned_cleanup”,“zone_ids”:["%s"]}"]

Directly with the binding it works like this for me:

Items:

Switch XiaomiRobotVacuum1SStartCleaning_Proxy "Zone starten []"
String XiaomiRobotVacuum1SActionsCommands "Execute command" {channel="miio:vacuum:0F8F154D:actions#commands"}
Group gVacClean "Staubsauger"
Switch VacAll_Proxy "Alles" (gVacClean,gRestore)
Switch VacKit_Proxy "Küche" (gVacClean,gRestore)
Switch VacWz_Proxy "Wohnzimmer" (gVacClean,gRestore)
Switch VacFlu_Proxy "Flur" (gVacClean,gRestore)
Switch VacAbstell_Proxy "Abstellraum" (gVacClean,gRestore)
Switch VacLR_Bad1_Proxy "Badezimmer" (gVacClean,gRestore)

Rule:

rule "start vaccuum"
when
    Item XiaomiRobotVacuum1SStartCleaning_Proxy received command 
then
     if (receivedCommand==ON) {
        if (gVacClean.members.filter[r|r.state == ON].size != 0) {  
        sCoordinates = ""                                           
        gVacClean.members.filter[r|r.state == ON].forEach[r|         
            sCoordinates=sCoordinates + transform("MAP","vacuum.map",r.label) + ","   
        ]
        sCoordinates = sCoordinates.substring(0,sCoordinates.length - 1)       
        if(VacAll_Proxy.state == ON) sCoordinates=transform("MAP","vacuum.map","Alles")     
        XiaomiRobotVacuum1SActionsCommands.sendCommand("app_zoned_clean["+sCoordinates+"]") 
         }
     }
     else  {
        XiaomiRobotVacuum1SActionsCommands.sendCommand("app_charge") 
     }
 
end

vacuum.map

Alles=[19750,24500,30000,33300,1]
Küche=[19750,28500,24700,33300,1]
Wohnzimmer=[26200,24500,30000,28500,1],[24800,28500,30000,33300,1]
Flur=[22700,24500,26000,28500,1]
Abstellraum=[19500,27000,22500,28500,1]
Badezimmer=[19750,24500,22500,26300,1]

Code snippets are from this post:

1 Like