[Howto] Buttons for Room Cleaning (with Queuing) for [Xiaomi Miio] (Robot Vacuum)

Danke Andrew! (: I guess I was being to vague in above, apologies. So, I have this whole “Blueprint” here working, I can trigger the room cleaning via the dashboard and my vaccum does what it’s supposed to.

THIS is the part I am after, what did you do to make this switch trigger a room cleaning?
I have created a switch via the UI (as per your screenshot), but how do I “link” this switch to the room cleaning of a specific room? I looked through your script but was unable to find anything that “links” to a boolean switch.

got you, actually thats quite simple, I use Node-Red for that.

When the input.boolean is on, the corresponding map (I live in a 2-story house) gets loaded, then it waits 10 secs and runs the cleaning-script with the data: {“room”:“wohnzimmer”}

Now you can build an input.boolean for each room and adjust the data in the call-service window.

runs perfectly within Homekit :wink:

1 Like

Hi all,

Is the clean rooms with the names possible with a roborock S4 ?
I saw the tutorial with the S6.

Thank you.
Lyes

Hi,

using this code, I receive “Error rendering data template: UndefinedError: ‘room’ is undefined” - I know this is due to my non existing competence to trace down my error.

I am anyways more than thankful for a little lift here.

Cheers,
K

I will try to use this script with Dreamebot L10 pro…
After some changes (device id, entity id…) for use with My vacuum cleaner I got error:
Unable to discover device over cloud

When i push button to clean some room all buttons chenge state to on and icons become yellow.
Is it possible to fix this that only pushed buttons go to state on and change icon color?

i have a edream vacuum, sub brand of Xiaomi i have it working with the edream card.
but when i install the HACS Xiaomi Miio i get a model unknown…
it there a way to still get costum keys

Just wondering if (once we have all the room IDs) this would be a shorter way for a button to clean a specific room:

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: vacuum.send_command
  target:
    device_id: 123456
  data:
    command: app_segment_clean
    params: 20
entity: script.robot_vacuum_room_cleaning
icon: mdi:pot-steam
name: kitchen

You lose the ability to queue the rooms with this.

Hi All,

Like previously described by @1kohm @mattbedit I too experience that calling the service directly from Developer Tools or as an Automation, results in the vacuum starting only to declare itself done after a few seconds, and return to dock.

Any ideas on how to solve this?

Thank you!

/Max

I have same error here. Did you manage to figure it out ?

I checked the value of all the “input_number.roborock_room_enum_room” in the developper tools and they are correct.

Then I tried to force the value of the "room_id " variable, and it worked (it cleaned the specific room)…
So ,instead of

        params: |
                {% set room_id = states("input_number.roborock_room_enum_"+room)
                | int %} {{room_id}}

I set

        params: |
                {% set room_id = 21 %} {{room_id}}

I also tried

        params: |
                {% set room_id = states("input_number.roborock_room_enum_"+room)
                | int(0) %} {{room_id}}

No error this time. The script runs but It does not clean anything (I think it takes the 0 value).

Ok I’ve just figured it out…

When I created the input_number, i copy/past input_number.roborock_room_enum_room in the name field.
And I realized that the entity was renamed input_number.input_number_roborock_room_enum_room

So when creating those input_number, name them
roborock_room_enum_room

Hi there, anyone tried this with valetudo os?

I own 3, a Roborock S5x and two DREAME S10L ultra, basement, ground level and first floor. The valetudo map integration certainly works, but requires to send them single commands for what to do when.

I don’t know about you guys, but we always vacuum and then mob, don’t like the vacuum kicking dirt onto the wet area while doing both at once. Basement is easy, just clean all every day.

But since we work mostly from home, it’s kind of difficult to automate that on the two other levels. It’s just to variable where we are and what we do. Having a phone conference, or designing something in CAD (cardboard aided design :wink: ) while that thing makes a racket in the background, just not possible. And since we work for different companies, we have two offices.

So I really would like to have buttons, to individually queue it’s tasks every morning depending on our calendar. Of course we can’t pull our work calendar into our HA… So it will be manual queueing…

Any ideas?

Hey mannebk,

there’s no reason why this shouldn’t work - but it will need probably a lot of adjustments.

I fixed the issues with when to run the robot with some automations, and motion sensors and door sensors. So for example my kitchen has a trigger, that if it sees 20 minutes continuous motion it will be flipping a switch, to mark the floor as dirty.

And if there’s noone in the kitchen or in the hallway for 20 minutes plus the doors from the hallway to other rooms are all closed, it will queue the kitchen and the hallway (if that one is marked as dirty as well).

Hallway gets marked dirty by number of door openings, so every time you come in from outside you’ll bring some dirt in. So after 10 times opening the door it will mark the hallway as dirty.

Those automations are in addition to regular scheduling of doing one pass per day.

So to sum it up: If none is home and thus no motion is detected the robot will clean once a day in the morning, once the “don’t do scheduling at night” block is gone, and mark the rooms as clean.

  • If there are 20 minutes of usage in the kitchen, it will re-mark the kitchen floor as dirty.
  • If there are 10 openings of the front door, it will re-mark the floor in the hallway as dirty
  • If there’s 20 minutes nobody in the hallway and the kitchen, and all other doors are closed (or no motion in the rooms with open doors are detected) the robot will start cleaning the rooms which are marked dirty.
  • In the evening I mark all floors as dirty, and the loop starts again in the morning.

Regarding wiping and vacuuming:

My vacuum doesn’t support raising the mob, and thus I need to make both at the same time.

Which works mostly fine. But doing double passes on a room however is bad, as the small amounts of dirt which do get kicked into the wet areas will be picked up wet on the second pass.

So I stay away from the double or triple pass functions, as this results in the robot getting itself dirty.

1 Like