Howto: Xiaomi vacuum zoned cleaning

como vc conseguiu as coordenadas?

I downloaded the app from the Russian website.
Iā€™ve installed it and re-added the robot (I think mine is the xiaomi robot v1). I canā€™t see any option for network info under general settings. What am I doing wrong?

Is it advalible in it?
If you dont understand russian - i can help.

The app is English and the Russian website gets translated by Google so no problem from that point of view, thanks

i have 2-nd gen of robot bit now itā€™s under valetudo - so it dont work with xiaomi cloud

Hello, I have a viomi.vacuum.v8 vacuum, I have tried the FloleVac app with login to EU server, but it says it canā€™t retrieve the data.
How I use the manual setup from FloleVac app?

1 Like

I had this issue once too, I reinstalled the app and that helpedā€¦

Hi,

I use these instructions to zone clean my apartment.
I have some chairs which are a problem for the mi VacuĆ¼m. So I made a map which excludes these chairs.
Sometime this is going okay. But not always.
The vacuum is lost totally and cleans only one room or so.
After a full clean of the whole appartement, the next time I do a zoned cleaning, which excluding the chairs, it is going okay again.
I really donā€™t know where to start troubleshooting with this.
Can you guys please help me with this?

I was looking exactly for this. The problem is that the vacuum integration of home assistant itself does not support ā€œzone cleaningā€, so weā€™d have to do some development there first to support the zone trait for vacuums in google assistant.

what i ended up doing was my own custom hack: i copy pasted the google_assistant component in the config/custom_component folder and did the following changes:

diff google_assistant/trait.py ../homeassistant/components/google_assistant/trait.py 
538,549d537
<     zones = {"Bedroom Corridor": [16],
<              "Kitchen": [17],
<              "Dining Room": [18],
<              "Entrance": [20],
<              "Master Bedroom": [21],
<              "Living Room": [22],
<              "Study Room": [25],
<              "Carpet": [26],
<              "Living areas": [17, 18, 20, 22, 26],
<              "Bedroom areas": [16, 19, 21, 24]}
558d545
<         _LOGGER.info("Registering vacuum in google assistant with zones: %s", str(list(self.zones.keys())))
562,563c549
<             != 0,
<             "availableZones": list(self.zones.keys())
---
>             != 0
577,596c563,569
<                 if params["zone"]:
<                     _LOGGER.info("Vacuum start zone command received with zone: '%s'", params["zone"])
<                     _LOGGER.info("Sending app_segment_clean command to vac with zone IDs: '%s'", str(self.zones[params["zone"]]))
<                     await self.hass.services.async_call(
<                         self.state.domain,
<                         vacuum.SERVICE_SEND_COMMAND,
<                         {ATTR_ENTITY_ID: self.state.entity_id,
<                          "command": "app_segment_clean",
<                          "params": self.zones[params["zone"]]},
<                         blocking=True,
<                         context=data.context,
<                     )
<                 else:
<                     await self.hass.services.async_call(
<                         self.state.domain,
<                         vacuum.SERVICE_START,
<                         {ATTR_ENTITY_ID: self.state.entity_id},
<                         blocking=True,
<                         context=data.context,
<                     )
---
>                 await self.hass.services.async_call(
>                     self.state.domain,
>                     vacuum.SERVICE_START,
>                     {ATTR_ENTITY_ID: self.state.entity_id},
>                     blocking=True,
>                     context=data.context,
>                 )

as far as hacks go, this is a pretty dirty one as it is forcing your custom zones directly into the google assistant vacuum support trait, but hey - it works. now i can tell google assistant ā€œstart cleaning in the kitchenā€ or ā€œstart cleaning the living areasā€ without all the script and IFTTT hackery suggested by the op above.

Some dev who has time should definitely try to add zone support to HAā€™s vacuum integration and then add zone support to the google assistant integration. PLEASE :slight_smile:

Yes, I played before with code changed too, I also had zone cleaning workingā€¦ Allthough I use nabucasaā€¦ And thatā€™s not possible to load as custom :frowning:

I donā€™t want to use the local Google anymore

Btw, what are those numbers, like 17, 18 ā€¦ ?
I guess you donā€™t have an s50? Some other model that supports rooms?
I have an s50, I need to work with coordinatesā€¦ Donā€™t think my model supports rooms

Yes, S50 with latest firmware now supports rooms.

These are room IDs. Hereā€™s how you retrieve them:

Thnx for infoā€¦ Now we need Google supporting those :wink:

Who can create a PR for this? :wink:

I am using Room/segmented Cleaning and although pause works - vacuum.start starts a brand new clean house cycle - so current room clean is ignored ?

Is anyone else having this issue - I have a card setup with pause and a start clean button.
service: vacuum.pause & service: vacuum.start

In zone cleaning - pause and then sending vacuum.start works to resume the cleaning where it left off

Have tried double pause but it doesnā€™t work. Any suggestions?

I think this is a limitation/bug of the vacuum firmware.
If you pause it with the physical button on the vacuum and then press again to resume it will as well start a brand new cleanup instead of resuming.
If you uses zones then pause/resume works with HA and physical button.

I have never found a way of HA reliably resuming the cleaning, but I found that sending the direct commands to the vacuum seems to work properly.

So I built the following automation, based on a sensor where I store the type of cleaning (disregard the trigger part, as this is just triggered from an iOS actionable notification):

### Resume Vacuum Cleanup when action is chosen from iOS ###
### Possible commands in python-miio/miio/vacuum.py ###
### from https://github.com/rytilahti/python-miio ###
  - alias: 'Resume Vacuum from iOS'
    trigger:
      platform: event
      event_type: ios.notification_action_fired
      event_data:
        actionName: VACUUM_RESUME
    action:
      - service: vacuum.send_command
        data_template:
          entity_id: vacuum.aspirador
          command: >-
            {% if is_state('sensor.current_cleanup_type', 'segment_clean') %}
              resume_segment_clean
            {% elif is_state('sensor.current_cleanup_type', 'zoned_clean') %}
              resume_zoned_clean
            {% elif is_state('sensor.current_cleanup_type', 'clean') %}
              start
            {% endif %}

Hope this helps, although it is not exactly what you asked for, it actually works perfectly well.

1 Like

@pplucky Thank you - works a treat !

1 Like

@masterfink thanks for the node red code - I had to modify my wait command though as my vacuum needs to recharge if I select all my rooms - this causes a problem as the return to dock is read as room finished - so last few rooms get missed.

Ended up solving it by adding a template sensor to figure out the difference between return to dock for charging vs finished room clean - so mine waits for my sensor.vacuum_cleaning_state to be false:

Might help someone:

      vacuum_cleaning_state:
        friendly_name: Cleaning Status
        entity_id:
          - vacuum.xiaomi_vacuum_cleaner
        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 -%}

Had to add an extra pause in the flow.

Other change is my rooms deselect in lovelace as it finishes each one, so you can see the progress:

Can @fillilutten or somebody else explain on how to do that without Node Red? I just have Home Assistant. I have valetudo running on my vacuum and zones are configured. But I cant find a way to start zoned cleanup. I have been trying with this:

start_zoned:
  alias: start zoned
  icon: mdi:stairs
  mode: single
  sequence:
  - data:
      command: zoned_cleanup
      entity_id: vacuum.tachikoma
      params:
        zone_ids:
        - stairs
    service: vacuum.send_command

But its not working. Any help?