Hi Georg,
I have a work around that I’ve been using. I have an S4Max, not sure if other robots can do this or not but here is what I do:
- I created two maps, one for each floor of my house.
- When I move my robot form one floor to the next, I put it on the floor (not the dock) and hit the dock button. It attempts to return to the dock. Usually it says “invalid map” and returns to the dock. Next I hit the clean button, it comes off of the dock and says “positioning”. It will drive a round for a minute but eventually it figured out which map is the correct one for the floor it is on and says “position established”. I then hit the home button again and it goes to the dock knowing what floor it is on.
Using the get_floor_mappings command I was able to determine the rooms and their IDs for each floor.
You can see each room number has a distinct ID even when the number is repeated between floors:
//Second Floor Map
//{"id":8830,"result":[[16,"536001005515"],[17,"536001005513"],[18,"536001005511"],[20,"536001005519"],[21,"536001005517"]],"exe_time":100}
//First Floor Map
//{"id":12270,"result":[[16,"536001005545"],[17,"536001005547"],[18,"536001005549"]],"exe_time":100}
I have a set of rules to determine what floor it is on. The Test Rooms rule is run actually by another rule anytime the statue changed to charging - which happens whenever the vac returns to the dock.
rule "Test Roborock Rooms"
when
Item testroborooms received command
then
logInfo("test robo rooms", "!!!!!!!!!!!!!!!!!!!!!! testing rooms")
actionCommand.sendCommand("get_room_mapping")
end
rule "What Floor"
when
Item actionCommand received update
then
//When a floor map is received parse it and set to the approproate floor or warn of unknown floor
//2nd floor - actionCommand changed to {"id":8830,"result":[[16,"536001005515"],[17,"536001005513"],[18,"536001005511"],[20,"536001005519"],[21,"536001005517"]],"exe_time":100}
//1st floor - actionCommand changed to {"id":3010,"result":[[16,"536001005545"],[17,"536001005547"],[18,"536001005549"]]
logInfo("Clean Room", "!!!!!!!!!!!!!!!!!!!!!! Floor Check")
val firstRoomNumber = transform("JSONPATH", "$.result[0][0]", actionCommand.state.toString)
if (firstRoomNumber == "16"){
logInfo("Clean Room", "!!!!!!!!!!!!!!!!!!!!!! First Room = 16")
val room16ID = transform("JSONPATH", "$.result[0][1]", actionCommand.state.toString)
if (room16ID == "536001005515") {
mapFloor.sendCommand(2)
logInfo("Clean Room", "!!!!!!!!!!!!!!!!!!!!!! First Room ID = 536001005515 - We're on the 2nd floor")
} else if (room16ID == "536001005545") {
mapFloor.sendCommand(1)
logInfo("Clean Room", "!!!!!!!!!!!!!!!!!!!!!! First Room ID = 536001005545 - We're on the 1st floor")
} else {
logInfo("Clean Room", "!!!!!!!!!!!!!!!!!!!!!! First Room ID = " + room16ID + " There is no floor with room 16 that matches this room ID. Look s liek you've changed your mapping")
}
}
end
So - essentially I let the vacuum determine for itself what floro it is on and load the correct map on its own. I then determine what floor it is on by parsing the room mapping IDs. This isn’t really needed, but I use it to set visibilities on my site map for things that are floor specific:
For example, I have single room cleaning set up for each room, and only have the correct set of rooms displayed for the floor the vac is on. I also have a spot cleaning set up that is only on the first floor. Also, I have a go to point set up for the var to meet me by the garbage on the first floor so I can easily empty the dust bin. So I only show that on my sitemap when the vac is on the first floor:
Selection item=cleanRoom mappings=[0="Select Room to Clean", 18="Bub Room", 20="Computer Room", 21="Hallway", 16="Master Bedroom", 17="Upstairs Bathroom"] visibility=[mapFloor==2]
Selection item=cleanRoom mappings=[0="Select Room to Clean", 16="Kitchen", 17="Dining Room", 18="Living Room"] visibility=[mapFloor==1]
Switch item=cleanLVCarpet mappings=[ON="Clean"] visibility=[mapFloor==1]
Switch item=meetbyTrash mappings=[ON="Go"] visibility=[mapFloor==1]