Yeah I can see how you add multiple segments to the code if you’re hardcoding the numbers. But in my implementation I have 1 script that I call from an automation passing through the id.
I guess if I removed the “-” from the script then I can pass through the IDs like you’ve written. Might give it a go.
I use Roborock Integration with HA via HACS and followed the above steps for selective room cleaning (Developer Tool, State, Camera.Roborock, find 2-digit Room ID, and then check which ID associates with each room). I wrote the script with UI to specify 3 rooms to clean in specific order (I.e., Hallway, Bedroom, and Bathroom) and triggered the scrip with a click on my Ikea remote. However, the robot always starts with Bedoom instead of Hallway. The same thing happens if I use Selective Room Cleaning in Roborock App and manually select the 3 rooms in such order - it always cleans Bedroom first. The only way I can achieve what I want is to define the order in Sequence option of Roborock App. When I did that the Selective Room Cleaning in both Roborock App and HA works. It should be noted that the robot charging station is located in the Bedroom and the bedroom is the largest room among the three. So, does this mean selective room cleaning with Roborock Integration in HA will never work because the order the rooms are cleaned is governed by Sequence option in Roborock App?
Could someone get the rooms in the map card using the roborock integration? I was able to make an script for cleaning an specific room with its ID, but I don’t know how to clean the specific rooms through the xiaomi map vacuum card, also trying to zone cleanup it says xiaomi_mioo/vacuum_clean_zone service not found, this can be made with the roborock integration? And last, it’s not shown the status, batterty etc.
I am trying to use your script, but I have 2 levels in my house so need to use the vacuum: send command “load_multi_map” with parameters 0 or 1 depending on which rooms I want to vacuum. 0 corresponds with the lower floor and 1 is the first floor. This ensures the vacuum loads the correct map as the room numbers are duplicated on the two different maps.
Is there a way to add into your script if certain rooms are selected, then first send command “load_multi_map” 0 or 1 depending on the rooms?
I would just add an extra input_boolean, if it is “off” it is “0”, if it is “on”, it’s “1”.
Then change the script to call loading the correct map first.
You of course cannot pick a series of rooms that are on both floors. It would be up to you to display. But you could add the floor (“0” or “1”) in the JSON and do an automation that would disable that floors input_booleans for the rooms.
Fortunately for me, my house is one story so I do not have that problem and therefore not implemented. I can understand how to do it, but would be up to you to do so and test.
I use that with a script called on a hold action to send the vacuum to the sink to fill water and wash the mop. The script calls the service roborock.vacuum_goto
goto_point:
alias: GoTo Point
sequence:
- service: roborock.vacuum_goto
data_template:
x_coord: '{% set pointname = "sink" %}
{% for point in state_attr(''sensor.roborock_rooms'',''points'') -%}
{% if point.name == pointname %}
{{point.x}}
{% endif %}
{%- endfor %}
'
y_coord: '{% set pointname = "sink" %}
{% for point in state_attr(''sensor.roborock_rooms'',''points'') -%}
{% if point.name == pointname %}
{{point.y}}
{% endif %}
{%- endfor %}
'
Thanks. I still have a problem, when I run the script.run_vacuum, I get this message that appears → Error rendering data template: TypeError: ‘None Type’ object is not iterable