Thanks for your reply i edited it like this for now:
for z in params.replace('kitchen', '20').replace(' ', '').replace('],[', '|').replace('[', '').replace(']', '').split('|'):
and this seems to work actualy.
Now im trying to use your python script to add a pause command and a stop command this way i can use all these command with only 1 IFTTT applet
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)
Haha, this thread has grown so long I forgot that it started with a really well put together tutorial
Our scripts differ a little bit though:
Mine relies on rooms already set up in the Roborock app while yours uses manually defined zones
My script supports cleaning of multiple rooms with one command, i.e. “ok google, clean the kitchen and the office and the hallway”
My script is not case sensitive
I’m using one python script for cleaning all rooms compared to one regular script for each room
I’ve obviously gotten a lot of inspiration from here which I’m really grateful for but I also think the use cases for each script is a little bit different
Friends! How to “geolocate” the vacuum cleaner in the form of a list if the coordinates of the rooms are known?
For example, if the robot is in zone [11111, 22222, 33333, 4444, 1] while cleaning, the message “Bedroom” is returned, [55555, 66666, 77777, 88888, 1] - “Living room”, etc.?
Already implemented a workaround.
Start the general vaccum start clean service, so the vaccum start positioning and load the correct map, then stop, and then send clean by the respective segments!
I want to use nodered, but the service xiaomi_clean_zone is not working. How I can use the zone cleaning with nodered?. Anyone can share the entiry flow?.