Vacuum Interactive Map Card

It’s correct. Now use coordinates of 3 corners of this rectangle. You can make yourself sure you got right coordinates by using “goto” mode and holding “start” button.

Which goto mode? I only got these numbers 20458,18972,30208,25822,1. How to transform them in the needed coordinates? Please, give me one simple functional example if possible. Thanks bro!

Anyone created a step-by-step guide for this? I cannot even start to figure it out from the documentation I can find here and on the Github :frowning:

So this is where I am… I:
-Am running latest HA on a Synology NAS in Docker
-Got a Xiaomi S5 running Valetudo 0.4.0
-Don’t use the Xiaomi app or FloleVac
-Have ICantBelieveItsNotValetudo running in Docker
-Got vacuum.roborock and camera.rockrobo_map working in HA
-Defined my zones in Valetudo, and got working scripts for them in HA like:

roborock_clean_living_room:
    alias: "Roborock Clean Living Room"
    sequence:
      - service: vacuum.send_command
        data:
          entity_id: 'vacuum.rockrobo'
          command: 'zoned_cleanup'
          params:
            'zone_ids': ['Living']

-Got this card installed

From here on, I have no idea how to proceed.

If someone know of a step-by-step guide to follow to get this working, please link me.

@3_14, first off, Great work on this card!

Got a question regarding the “service” key:
My vacuum is parked under a sofa that´s a bit to low, that makes the scanner on vacuum to draw the map so it thinks that the vacuum is trapped. Doing a full clean works, but going to specific points or zone cleaning just starts the vacuum and then it thinks it cant reach the destination and aborts.
Sollution for this is to activate Remote Control Mode and just drive it manually for a couple of seconds.
Soo, back to the question:

I want to run a small script that moves the vacuum out and then starts the zone cleaning.
First if, I activated Python Script and copied the exact script you have on your Github page. Next I created this script:

map_card_clean:
  alias: map_card_clean
  sequence:
  - data: {}
    service: vacuum.xiaomi_remote_control_start
  - delay: 00:00:15
  - data:
      duration: 6000
      velocity: 0.2
    service: vacuum.xiaomi_remote_control_move
  - delay: 00:00:08
  - data: {}
    service: vacuum.xiaomi_remote_control_stop
  - delay: 00:00:03
  - service: python_script.vacuum_send_command
    data_template:
      entity_id: "{{entity_id}}"
      command: "{{command}}"
      params: "{{params}}"

Finally, I added “service: script.map_card_clean” to the Card config.
What happens when I try to start a zone clean is that the vacuum moves out from the sofa but then nothing.

I´m sure I´we missed some detail but can´t figure it out, please help! :slight_smile:

Does anything appear in logs? If not maybe the last delay is too small? I would change it to wait_template to be sure that the vacuum has already stopped. (I have a similar setup for my vacuum garage - also with manual mode).

Hint: extend your script by checking if vacuum is docked and only then using remote control. Without this check whenever you use card your vacuum will enter manual mode, even totally unnecessary.

Example:

vacuum_send_command:
  alias: vacuum_send_command
  sequence:
    - service: script.vacuum_leave_garage
    - wait_template: "{{ is_state('script.vacuum_leave_garage', 'on') }}"
    - wait_template: "{{ is_state('script.vacuum_leave_garage', 'off') }}"
    - service: vacuum.stop
      data_template:
        entity_id: "{{entity_id}}"
    - service: script.vacuum_send_command_parsed
      data_template:
        entity_id: "{{entity_id}}"
        command: "{{command}}"
        params: "{{params}}"

Script vacuum_leave_garage as first step has a delay 100ms (to make possible to use wait template in vacuum_send_command) and as a second a condition to continue only if vacuum is docked.

No, nothing special in logs.
Great example with the delays, I´ll try that out.

If you could paste the full code for “script.vacuum_send_command_parsed” and “script.vacuum_leave_garage” I would be more than happy, just to make things even clearer since you use it the exact same way.

Script vacuum_send_command_parsed is exactly the same as vacuum_send_command_multiple_zones from here.

vacuum_leave_garage:
  alias: Vacuum leave garage
  sequence:
    - delay:
        milliseconds: 100
    - condition: state
      entity_id: vacuum.roborock
      state: 'docked'
    - service: script.vacuum_copy_fan_speed
    - service: vacuum.set_fan_speed
      data:
        entity_id: vacuum.roborock
        fan_speed: 105
    - service: script.vacuum_open_garage
    - wait_template: "{{ is_state('switch.vacuum_garage', 'on') }}"
    - service: vacuum.xiaomi_remote_control_start
      data:
        entity_id: vacuum.roborock
    - delay: "00:00:8"
    - wait_template: "{{ not is_state('vacuum.roborock', 'docked') }}"
    - service: vacuum.xiaomi_remote_control_move_step
      data:
        entity_id: vacuum.roborock
        velocity: 0.29
        rotation: 0
        duration: 2500
    - wait_template: "{{ is_state('vacuum.roborock', 'idle') }}"
      timeout: '00:00:05'
    - service: script.vacuum_close_garage
    - service: vacuum.set_fan_speed
      data_template:
        entity_id: vacuum.roborock
        fan_speed: "{{ states.sensor.vacuum_mode.state }}"
    - wait_template: "{{ is_state('switch.vacuum_garage', 'off') }}"

Parts with setting fan speed are unnecessary, they are just for enabling mopping mode when leaving docking station (the quietest one) and restoring previous one after the whole procedure.

1 Like

Big Thanks!!
With a bit tweak (and some error with my .py file) it works as expected now.

As a bonus, with vacuum_send_command_multiple_zones script you can clean more than 5 zones with one call - set ignore_zones_limit property to true in cards configuration

1 Like

Will also wait for this tutorial :slight_smile:

I edited my map with Gimp but it doesn’t update within the card, it shows still the old map!? :confused:

You have to clear browsers cache

That did the trick :see_no_evil:
Thank you, awesome work!

I read that this plugin won’t work with the gen1, is this true?

It will work with gen1, but it will require map calibration each time map in Xiaomi Home rotates itself.
To prevent it from happening you have to use zoned cleanup instead of normal full cleaning (like mentioned above Xiaomi Vacuum Interactive Map Card).

Ok thanks for information.

If the Roborock is rooted on Valetudo will this prevent from rotating each time itself?

I don’t use Valetudo, so I unfortunately can’t answer your question.

Is your card capable of defining no-go zones also without triggering a cleanup? So that I can have a scheduled cleanup every couple of days, but define zones where it should not go using your card?

I am trying to avoid using the xiaomi app as I don’t trust it (I’ve also blocked the vacuum from the internet).

You can only define the no go zones with the mihome app. It’s a one time thing to do.

@patrick_jane Right now I am focused on live maps, but after that I will take a look at wider support for vacuums features.

Is there any chance to get live map without rooting, like in the Flolevac?

I tried to decompile FloleVac to check how do they get map data, it appears that it goes through their servers, so unfortunately I can’t reproduce this feature. I have seen some guy managed to get map data (link), but he have posted it about year ago and stoped responding to comments. Anyway, I still try to find a solution, but I don’t think it is in my reach right now.

1 Like