Help with zone cleaning parameters - Xiaomi vacuum

Hi Schneider! Good news I found a valetudo branch with clickable zoned cleaning .I compiled this piece of software and will test and report … then it should be possible to select zoned cleaning within a map . But u need complete map before which includes full clean and don’t carry your robot around :wink: I’ll report tomorrow if it works well

2 Likes

Amazing stuff mate! Good luck!

Tested the new feature.it seems to work but still in beta.as soon as there was a cleanup of the code and integration in valetudo I’ll make a post here

1 Like

Hi, I’m right, that you’re all using Valetudo?
For me the zoned cleaning via hass.io isn’t working at all. I have the following script for example:

vacuum_wohnzimmer:
    alias: Wohnzimmer saugen
    sequence:
      - service: vacuum.send_command
        data:
          entity_id: vacuum.roborock
          command: app_zoned_clean
          params: [22250,27500,29400,25000,1]

When I run it the vacuum says “starting zone cleaner”, boosts up, than without driving says “finished zone cleaning going back to dock.”

If I’m using Valetudos new Zone Website it works perfectly…
Does anybody has an idea?

Btw: Goto works great.

vacuumgoto:
    alias: Vacuum go to
    sequence:
      - service: vacuum.send_command
        data:
          entity_id: vacuum.roborock
          command: app_goto_target
          params: [29300, 27300]

Found my issues…
params have to be
params: [[22250,27500,29400,25000,1]]

and on my other script i typed

service: vacuum.send_command
data_template:

Which has to be “data”. If one of this typos are in the script the roborock seems to start cleaning, but the values aren’t right, so it cancels then.

I submit a pull request with a new service xiaomi_clean_zone_start
Download this file xiaomi_miio.py and put it in /custom_components/vacuum until my pull request will be approved.

Example of use with automation:

- id: '1546608481220'
  alias: Test vacuum zone
  trigger:
  - event: start
    platform: homeassistant
  condition: []
  action:
  - data:
      entity_id: vacuum.xiaomi_vacuum
      reps: 3
      zone: [[23510,25311,25110,26361]]
    service: vacuum.xiaomi_clean_zone_start

Here my github pull request: https://github.com/home-assistant/home-assistant/pull/19777

1 Like

Is this working for you? Just seen, that you tried to set the value using a template, which I’m trying to do with my vacuum since 2 days for setting the volume.

When I’m inserting my input_number into your script like this:

action:
  - service: vacuum.send_command
    data_template: 
      entity_id: vacuum.roborock
      command: change_sound_volume
      params: '{{ ("[" + (states("input_number.vacuum_volume") | int | string + "]") )}}'

Still nothing happens. Currently my guess is, that the „vacuum.send_command“ doesn’t support data_template, as not even „params: [10]“ or similar is working is working then…

Thank’s for your job! Works like a charm!

PS. For those who will use this component
warning: do not confuse date: and data_template:
If you use variables you must always put data: as examples here: https://github.com/home-assistant/home-assistant/pull/19777

2 Likes

Does this allow you to resume a zoned cleanup? If it gets stuck, errors, or paused?

I never tried It…

Is your PR with xiaomi_clean_zone_start also supporting zones as templates?

Currently I had to create 8 scripts to clean every single room. Adding input_booleans for each of them and then run a script mentioned in the “Howto: Xiaomi vacuum zoned cleaning” to run the scripts that are having activated input_booleans.

If the xiaomi_clean_zone_start supports also zones as templates I could include them as a list when calling the cleaning script and and short my scripts by 1/8.
Greets

1 Like

No… in this moment you can only use repeats as template.

Okay, would it be possible by home assistant design to use templates in zone, too?

after PR is approved, I will work on it

3 Likes

I have now used a version update in the next code to send the robot to a certain area. Since last update (0.86.3) this code has not been working. Is there an alternative to this?

script:
  vacuum_all_home:
      alias: "Vacuum All The House Space"
      sequence:
        - service: vacuum.send_command
          data:
            entity_id: vacuum.xiaomi_vacuum_cleaner
            command: app_goto_target
            params: [[23341,19451,32741,30201,1]] ## כל הבית ##

  vacuum_bedroom:
        alias: "Vacuum Corridor"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[28489,22014,30139,26214,1]] ## פרוזדור ##
 
  vacuum_dining_room:
        alias: "Vacuum Dining Room"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[26253,21948,28503,25948,1]] ## פינת אוכל #
  
  vacuum_kitchen:
        alias: "Vacuum Kitchen"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[26115,19477,28315,22027,1]] ## מטבח ##
  
  vacuum_living_room:
        alias: "Vacuum Living Room"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[23327,21890,26077,26040,1]] ## סלון ##
  
  vacuum_guestroom:
        alias: "Vacuum Dogs area"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              command: app_zoned_clean
              params: [[28624,25960,31574,30260,1]] ## אזור הכלבים

I think the service app_goto_target not need a zone but is still necessary a point (x,y)

  vacuum_kitchen:
        alias: "Vacuum Kitchen"
        sequence:
          - service: vacuum.send_command
            data:
              entity_id: vacuum.xiaomi_vacuum_cleaner
              params: [[26115,19477,28315,22027,1]] ## מטבח ##

I tried this way - not working :frowning:

You can give an example please

Here there Is my pull request (https://github.com/home-assistant/home-assistant/pull/19777) that contains vacuum.xiaomi_clean_zone service.
Follow the instructions in pull request

I understand there is a patch in this file …

https://github.com/marcogazzola/home-assistant/blob/dev/homeassistant/components/vacuum/xiaomi_miio.py

In the pull request, i have added a new service: vacuum.xiaomi_clean_zone service

1 Like