Hi Guys,
this is my first post in the forum so I hope I’m doing everything right. Please tell me if not.
Last Week my Xiaomi Robot Vacuum Gen1 finally arrived after 3 month of waiting. After I flashed it with Valetudo I was looking for a way to automate the zone cleaning so the vacuum does not build a new map every time. I could not find a suitable solution for the way I wanted it to be.
I’m using Input_booleans to activate or deactivate each cleaning zone. Than I’m using a rest command to be able to make a correct service call with templating. It is not working to make the service call directly because the templating does not result in correct json. I read the trick with the rest command in another thread to solve a similar problem.
My config is pretty simple and still a work in progress to automate the zone cleaning. For now I have a simple button to call the script.
I hope this has some use for you.
vacuum_zone_cleaning:
alias: Staubsaugen nach Raum
sequence:
- condition: state
entity_id: group.vacuum_zones
state: "on"
- service: rest_command.vacuum_zone_cleaning
rest_command:
vacuum_zone_cleaning:
url: "http://192.168.2.60:8123/api/services/vacuum/send_command"
method: POST
headers:
content-type: application/json
authorization: !secret rest_api_token
content_type: application/json
payload: >-
{
"entity_id": "vacuum.rockrobo",
"command": "zoned_cleanup",
"params":
{"zone_ids": {{ expand('group.vacuum_zones') | selectattr('state', 'eq', 'on') | map(attribute='name')|list|to_json }}
}
}
input_booleans:
vacuum_livingroom:
name: Wohnzimmer
icon: mdi:robot-vacuum-variant
vacuum_bedroom:
name: Schlafzimmer
icon: mdi:robot-vacuum-variant
vacuum_studyroom:
name: Wohnzimmer
icon: mdi:robot-vacuum-variant
vacuum_guestbedroom:
name: Wohnzimmer
icon: mdi:robot-vacuum-variant
vacuum_hallway:
name: Flur
icon: mdi:robot-vacuum-variant
group:
Vacuum_Zones:
name: Staubsaugerzonen
entities:
- input_boolean.vacuum_livingroom
- input_boolean.vacuum_bedroom
- input_boolean.vacuum_studyroom
- input_boolean.vacuum_guestbedroom
- input_boolean.vacuum_hallway