To answer myself and maybe help someone else out here, I ended up creating a python script which takes a string of room names (e.g. “kitchen and kids room” ) and then starts selective room cleaning like this:
python_scripts/vacuum_room.py
# Vacuum specific room(s), multiple names for a room can be used
roomConfig = {
16: ["kitchen"],
17: ["living room"],
18: ["nursery", "kids room"]
}
entity_id = data.get("entity_id")
area = data.get("area").lower()
roomsToClean = []
for roomNumber, roomNames in roomConfig.items():
for name in roomNames:
if name in area:
roomsToClean.append(int(roomNumber))
continue
if entity_id is not None and len(roomsToClean) > 0:
service_data = {"entity_id": entity_id, "command": "app_segment_clean", "params": roomsToClean}
hass.services.call("vacuum", "send_command", service_data, False)
I’ve summarized my working setup in full here:
https://community.home-assistant.io/t/selective-room-cleaning-with-google-assistant-and-xiaomi-roborock-s6-using-ifttt/