Howto: Xiaomi vacuum zoned cleaning

The command is deprecated. You have to use xiaomi_miio.vacuum_clean_zone.

Please refer to the docs

how do i get map numbers?

how do i use it

miiocli vacuum --ip <ip of the vacuum> --token <your vacuum token> get_room_mapping
Bash

I searched google but I didnā€™t find a guide on how to get zone numbers

You will need to install miiocli on a different Linux machine, since it is not a part of HAOS.

But it is easier to just try every room number and see where your robot friend is going. Start from 16 and up I believe. You will have the room numbers in no time.

I tried
other numbers donā€™t work either

service: vacuum.send_command
data:
entity_id: vacuum.viomi_se
command: app_segment_clean
params: [20]

Is this a Miio compatible vacuum? I donā€™t see app_segment_clean in the docs?

it is not a custom component
thatā€™s why itā€™s not possible ok

I already found the mistake was as you wrote
does not know app_segment_clean

know
set_mode_withroom

does not work
repetitions: 2

  • service: vacuum.send_command
    data:
    command: set_mode_withroom
    params:
  • 0
  • 1
  • 1
  • 10
    target:
    entity_id: vacuum.viomi_se
    mode: single

mitsenoj, can you share your node red flow?, Iā€™m very interesting to use your approach.

Thanks in advance,

No problem - @josemsubcn do I share JSON of the flow under export ?

For me trick was to set up a sensor to indicate if vacuum was charging mid clean - that way flow doesnt continue to next room if it returns to top up batteries:

vacuum_cleaning_state:

        friendly_name: Cleaning Status

        value_template: >-

          {%- if is_state("vacuum.xiaomi_vacuum_cleaner","returning") -%}

            {%- if (states.vacuum.xiaomi_vacuum_cleaner.attributes.battery_level | int < 21) -%}

              Charge_return

            {%- else -%}

              False

            {%- endif -%}

          {%- else -%}

            {%- if is_state("vacuum.xiaomi_vacuum_cleaner","docked") and (states.vacuum.xiaomi_vacuum_cleaner.attributes.battery_level | int < 81) -%}

              Charging

            {%- else -%}

              {%- if not is_state("vacuum.xiaomi_vacuum_cleaner","docked") -%}

                True

              {%- else -%}

                False

              {%- endif -%}  

            {%- endif -%}

          {%- endif -%}

mitsenoj

Yes, to share the flow you need to export:

and then select current flow in the dialog, then select JSON and then copy to clipboard and past in the forum:

Thanks in advance,

Jose

here we are: - couldnt post it raw here - said it was too big :frowning: - link to txt file:

https://drive.google.com/file/d/1-2uyxVV5LedQi7OXC886kxCuo9nmgndM/view?usp=sharing

Is there a way to send the vacuum to clean a room quietly and only turn on the ā€˜turboā€™ mode once itā€™s really start to clean?

Every time iā€™m sending it to clean a room, the xiaomi s5 drives to that room on ā€œturboā€ mode (the cleaning mode it is on), and makes a lot of noise even before it starts to clean.

I was trying to adjust my script for:

  1. Adjust fan speed to quite
  2. go to a target zone (which is close to that area iā€™d like it to clean)
  3. adjust fan speed to turbo
  4. start cleaning the area

However for some strange reason, once the roborock is doing one action - it wonā€™t proceed to the next actionsā€¦

I was trying to play a bit with delays \ waits with no luckā€¦
Does anyone else have a solution for that?

Thanks a lot mitsenoj

Jose

@josemsubcn Did you add the senors are showed above this post little higher up - the flow checks this sensor to figure out if it is returning to charge or just finished the room. Wont make sense without it. The long pause is just to give time for sensor to update correctly as coms to vaccum is delayed.

1 Like

Hi!
I got a new Mi Vacuum Mop P.
I downloaded the latest frimware, from the playstore.
First time the robot created the map, and I defined the cleaning zones.
The dockingstation is in the kichen. If I select the living room, and it start cleaning, the robot, triing to cross the middle of the wall. But, if I select a cleaning area, in the living room, the robot will find the getway and go to cleaning. If I stop it, in the living room, and select the living room, and start the cleaning, it clean corretly, and after it return back to the chager in the kichen.
The scheduled tasks canā€™t work of cours, because the robot canā€™t cross the wall.
So many times, I redifinded the areas, but it didnā€™t help me.
How I can solve this problem?
Thanks all helps!

1 Like

Well I got the Roborock s7 and did a full clean ā€œmappingā€ of the house. I tried to find my selective number for room cleaning and I put in numbers from 16-26 to see where it went. It found and worked on numbers 16,17,18,19 and 21 for some reason 20,23,24 and 26 returned invalid calibration, check configurations and number 22 did the same room as 16. Why ? is there a limit to the numbers? and why 22 and 16 did the same room. In the iphone the mihome app works fine by room selection.

Well I re-mapped the whole house again and now everything fell in line. Rooms 16-24 all mapped correctly, with no duplicates or skipped numbers

I have a Roborock S5 successfully set up in HA with Xiaomi Cloud Map Extractor
I followed the debug: true trick explained in that video to get my kitchen coordinates (couldnā€™t figure out how to get room numbers if that even exists on a S5 :man_shrugging: )

vacuum01

I then created the following script :

alias: Vacuum kitchen
sequence:
  - service: vacuum.send_command
    target:
      entity_id: vacuum.vacuum
    data:
      command: app_zoned_clean
      params:
        - 28625
        - 23989
        - 32288
        - 27123
mode: single
icon: mdi:robot-vacuum

My vacuum says ā€œstarting zone cleanupā€ but seems to ignore my coordinates and goes for a full floor cleanup :crying_cat_face:
Do you know what I missed or what would be a good approach to debug ? thanks !

2 Likes

Why donā€™t you use the clean segment command where you basically enter the ID of the room that was created in the app? That should be a bit easier.

I wish I could use the room IDs, that would be more straightforward but I couldnā€™t figure out where to find them in the Xiaomi Home app šŸ¤·

Just use the command and test with different ids (starting from 1), you then see in the app which room the vac is going to clean. If you modify rooms in the app, they usually get a new ID (so a number higher than your actual room count) and their prior ids then just gonna be unused.

To be able to use the room cleaning you need to make sure to have finished a full clean so that the app is going to create the rooms