Vacuum Interactive Map Card

@TheGsus
For me “scaling” the map sizes with cropping was enough.
Im using 4 of this robo guys in HomeAssistant an put them in a 2x2 grid with vertical and horizontal grids.
Here i did put 2 robos with about same size next to each other and did the rest with cropping (which is built in the map card).

ok. sounds good. I will try this if i have the time left. But as I am missing some rooms in other floors the size mismatch where i am coming from might be too much. I will see. Meanwhile I will create a feature request

Hallo.
Is there a way to use Interactive Map Card with a Lefant M1 vacuum ?
It works in Tuya Smart and shows map too.

It should be possible. You would have to provide a thorough description of available services and entities here

I’m using xiaomi C101, It can be possible to use this card? You know, this model is not tested platform.

*There are LiDAR and IR camera(I think. I can see the red light in camera part) on this robot. Looks very similar with Dreame vacuum, But I’m not sure this is same.

Hello,

I have a problem, try search in all internet but not found a solution.
I have multi-map in my roborock s7 but i cant fount way to select them on HA.
If i use roborock app when select 1 map this map appear on map HA and when select map 2 this map appear on HA mas the unique way to change them is in roborock app

Any solution for this ?

Thanks

@Fxia Which integration do you use to add this vacuum to HA?

@LinkX Which integration do you use to add vacuum map to HA?

Hello,

I use Xiaomi Cloud Map Extractor

Thanks

With Roborock app?

I use roborock app on cellphone because I cant change map in vacuum card. I want only use roborock integration with vaccum map card but cant change maps in card

Hello,

Unfortunately my sensor not save 2 maps. My actual map sensor only know what actual map.
In roborock integration i dont have a sensor that save info about my 2 floors

1st floor is “Casa”
2nd floor is “Varanda”

HI,

As finally i have wall screen to control home… I start to use this great card.
And I found that when I select room vacuum (Roborock S6) goes to different room - looks like strat cleaning whole floor. I have room numbers in camera entity null:

I added rooms_number, rooms to map extractor config.

Vaccum added by Xiaomii Miio Integration

So. .where I made mistake?

Camera config:


   - platform: xiaomi_cloud_map_extractor
     host: !secret xiaomi_vacuum_host
     token: !secret xiaomi_vacuum_token
     username: !secret xiaomi_cloud_username
     password: !secret xiaomi_cloud_password
     force_api: xiaomi
     draw: ['all']
     attributes:
       - calibration_points
       - rooms
       - room_numbers
       - map_name
       - charger
       - cleaned_rooms
       - country
       - goto_path
       - goto_predicted_path
       - walls
       - no_go_areas
       - no_mopping_areas
     colors:
        color_charger: [255,0,255]
        color_map_outside: [19, 87, 148, 0]#tolto
     map_transformation:
       trim:
         top: 15
         bottom: 15
         left: 15
         right: 15

Camera entity attributes:

Card:

type: custom:xiaomi-vacuum-map-card
title: ''
preset_name: Parter
activate_on_switch: true
activate:
  service: vacuum.send_command
  service_data:
    entity_id: vacuum.roborock_s5_max
    command: load_multi_map
    params: 0
entity: vacuum.roborock_s5_max
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_clean_segment
    predefined_selections:
      - id: '16'
        icon:
          name: mdi:broom
          x: 23050
          'y': 30125
        label:
          text: Room 16
          x: 23050
          'y': 30125
          offset_y: 35
        outline:
          - - 19100
            - 25250
          - - 27000
            - 25250
          - - 27000
            - 35000
          - - 19100
            - 35000
      - id: '17'
        icon:
          name: mdi:broom
          x: 24775
          'y': 29150
        label:
          text: Room 17
          x: 24775
          'y': 29150
          offset_y: 35
        outline:
          - - 24000
            - 27250
          - - 25550
            - 27250
          - - 25550
            - 31050
          - - 24000
            - 31050
      - id: '18'
        icon:
          name: mdi:broom
          x: 26300
          'y': 24950
        label:
          text: Room 18
          x: 26300
          'y': 24950
          offset_y: 35
        outline:
          - - 23400
            - 22600
          - - 29200
            - 22600
          - - 29200
            - 27300
          - - 23400
            - 27300
      - id: '19'
        icon:
          name: mdi:broom
          x: 32225
          'y': 28150
        label:
          text: Room 19
          x: 32225
          'y': 28150
          offset_y: 35
        outline:
          - - 29250
            - 23900
          - - 35200
            - 23900
          - - 35200
            - 32400
          - - 29250
            - 32400
      - id: '20'
        icon:
          name: mdi:broom
          x: 31050
          'y': 21625
        label:
          text: Room 20
          x: 31050
          'y': 21625
          offset_y: 35
        outline:
          - - 29250
            - 19700
          - - 32850
            - 19700
          - - 32850
            - 23550
          - - 29250
            - 23550
      - id: '21'
        icon:
          name: mdi:broom
          x: 34050
          'y': 21775
        label:
          text: Room 21
          x: 34050
          'y': 21775
          offset_y: 35
        outline:
          - - 32850
            - 19700
          - - 35250
            - 19700
          - - 35250
            - 23850
          - - 32850
            - 23850
      - id: '22'
        icon:
          name: mdi:broom
          x: 22550
          'y': 30400
        label:
          text: Room 22
          x: 22550
          'y': 30400
          offset_y: 35
        outline:
          - - 22350
            - 29950
          - - 22750
            - 29950
          - - 22750
            - 30850
          - - 22350
            - 30850
  - template: vacuum_goto
  - template: vacuum_follow_path
additional_presets:
  - preset_name: Pietro
    activate_on_switch: true
    activate:
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roborock_s5_max
        command: load_multi_map
        params: 1
    entity: vacuum.roborock_s5_max
    map_source:
      camera: camera.xiaomi_cloud_map_extractor
    calibration_source:
      camera: true
    map_modes:
      - template: vacuum_clean_zone
      - template: vacuum_clean_segment
        predefined_selections:
          - id: '16'
            icon:
              name: mdi:broom
              x: 25925
              'y': 25250
            label:
              text: Room 16
              x: 25925
              'y': 25250
              offset_y: 35
            outline:
              - - 22500
                - 22800
              - - 29350
                - 22800
              - - 29350
                - 27700
              - - 22500
                - 27700
          - id: '17'
            icon:
              name: mdi:broom
              x: 25025
              'y': 28750
            label:
              text: Room 17
              x: 25025
              'y': 28750
              offset_y: 35
            outline:
              - - 22700
                - 26900
              - - 27350
                - 26900
              - - 27350
                - 30600
              - - 22700
                - 30600
          - id: '18'
            icon:
              name: mdi:broom
              x: 28175
              'y': 19650
            label:
              text: Room 18
              x: 28175
              'y': 19650
              offset_y: 35
            outline:
              - - 25700
                - 16500
              - - 30650
                - 16500
              - - 30650
                - 22800
              - - 25700
                - 22800
          - id: '19'
            icon:
              name: mdi:broom
              x: 20575
              'y': 24650
            label:
              text: Room 19
              x: 20575
              'y': 24650
              offset_y: 35
            outline:
              - - 18000
                - 22750
              - - 23150
                - 22750
              - - 23150
                - 26550
              - - 18000
                - 26550
          - id: '20'
            icon:
              name: mdi:broom
              x: 29275
              'y': 28800
            label:
              text: Room 20
              x: 29275
              'y': 28800
              offset_y: 35
            outline:
              - - 26750
                - 26050
              - - 31800
                - 26050
              - - 31800
                - 31550
              - - 26750
                - 31550
          - id: '21'
            icon:
              name: mdi:broom
              x: 20150
              'y': 28575
            label:
              text: Room 21
              x: 20150
              'y': 28575
              offset_y: 35
            outline:
              - - 17850
                - 26650
              - - 22450
                - 26650
              - - 22450
                - 30500
              - - 17850
                - 30500
      - template: vacuum_goto
      - template: vacuum_follow_path
style: |
  ha-card {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .map-wrapper {
    flex-grow: 10;
    width: 500px;
  }
  .controls-wrapper {
    flex-grow: 3;
    width: 300px;
  }
vacuum_platform: default
two_finger_pan: true
map_locked: true

Can you open the editor, select a room to clean, click “Copy service call” and paste it here?

{
  "domain": "roborock",
  "service": "vacuum_clean_segment",
  "serviceData": {
    "segments": [
      17
    ],
    "entity_id": "vacuum.roborock_s5_max",
    "repeats": 1
  }
}

BTW… how this service call distinguihs, t ogo to room fomr map for 0 floor or 1st floor?
As in config there is 2 different room configs, so this 17 segment reefer to which coordinates?
We have parter here:

  params: 0
entity: vacuum.roborock_s5_max
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_clean_segment
    predefined_selections:
      - id: '16'
        icon:
          name: mdi:broom
          x: 23050
          'y': 30125
        label:
          text: Room 16
          x: 23050
          'y': 30125
          offset_y: 35
        outline:
          - - 19100
            - 25250
          - - 27000
            - 25250
          - - 27000
            - 35000
          - - 19100
            - 35000
      - id: '17'
        icon:
          name: mdi:broom
          x: 24775
          'y': 29150
        label:
          text: Hall_dol
          x: 24775
          'y': 29150
          offset_y: 35
        outline:
          - - 24000
            - 27250
          - - 25550
            - 27250
          - - 25550
            - 31050
          - - 24000
            - 31050

and 1st floor:

 - preset_name: Pietro
    activate_on_switch: true
    activate:
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roborock_s5_max
        command: load_multi_map
        params: 1
    entity: vacuum.roborock_s5_max
    map_source:
      camera: camera.xiaomi_cloud_map_extractor
    calibration_source:
      camera: true
    map_modes:
      - template: vacuum_clean_zone
      - template: vacuum_clean_segment
        predefined_selections:
          - id: '16'
            icon:
              name: mdi:broom
              x: 25925
              'y': 25250
            label:
              text: Room 16
              x: 25925
              'y': 25250
              offset_y: 35
            outline:
              - - 22500
                - 22800
              - - 29350
                - 22800
              - - 29350
                - 27700
              - - 22500
                - 27700
          - id: '17'
            icon:
              name: mdi:broom
              x: 25025
              'y': 28750
            label:
              text: Room 17
              x: 25025
              'y': 28750
              offset_y: 35
            outline:
              - - 22700
                - 26900
              - - 27350
                - 26900
              - - 27350
                - 30600
              - - 22700
                - 30600

And now after debbuging…
I call service from vacuum, right?

{
  "domain": "vacuum",
  "service": "vacuum_clean_segment",
  "serviceData": {
    "segments": [
      17
    ],
    "entity_id": "vacuum.roborock_s5_max"
  }
}

but this call:

service: xiaomi_miio.vacuum_clean_segment
data:
  segments: 17
target:
  entity_id: vacuum.roborock_s5_max

works as expected…
so in card I need to change somwhere this to call this service

In card I use default, which as I suppose based on YOur documentation is excalty this service… :slight_smile:

so even with choose this default, it not call proper serice, am I right?

With this default paltform choosen, service call is not what I expect for Xiaomi_mioo:

{
  "domain": "vacuum",
  "service": "send_command",
  "serviceData": {
    "command": "app_segment_clean",
    "entity_id": "vacuum.roborock_s5_max",
    "params": [
      {
        "segments": [
          18
        ],
        "repeat": 1
      }
    ]
  }
}

Another edit (sorry, I work as Test Architect in IT :D)

Zone cleanup call proper service:

{
  "domain": "xiaomi_miio",
  "service": "vacuum_clean_zone",
  "serviceData": {
    "zone": [
      [
        23217,
        23017,
        29783,
        29033
      ]
    ],
    "repeats": 1,
    "entity_id": "vacuum.roborock_s5_max"
  }
}

GoTo also call proper and works

{
  "domain": "xiaomi_miio",
  "service": "vacuum_goto",
  "serviceData": {
    "x_coord": 27077,
    "y_coord": 24293,
    "entity_id": "vacuum.roborock_s5_max"
  }
}

Path cleaning not work:

{
  "domain": "script",
  "service": "vacuum_follow_path",
  "serviceData": {
    "service": "xiaomi_miio.vacuum_goto",
    "mode": "individual",
    "path": [
      [
        27365,
        23593
      ],
      [
        28643,
        23758
      ],
      [
        27942,
        24747
      ],
      [
        26500,
        24747
      ],
      [
        27365,
        23469
      ]
    ],
    "entity_id": "vacuum.roborock_s5_max"
  }
}

because according documentation, there is no path mode in got service call

And last test (I don;t know why) - I used wrong button to strat clean, see picture:

@mackbeth Yeah, at this moment room cleaning uses vacuum.send_command instead of xiaomi_miio.vacuum_clean_segment because of issue in HA itself (Segment/Room repetition for vacuum no working · Issue #59110 · home-assistant/core · GitHub, Vacuum Segment Cleaning Disobeys Repeat Cleanings · Issue #69950 · home-assistant/core · GitHub). It should behave in the same way.


You got this service call with default platform selected?


It doesn’t call xiaomi_miio.vacuum_goto service. It calls script.vacuum_follow_path service (available after adding this script) and passes xiaomi_miio.vacuum_goto as an argument.


Soooooooooo, does it work now?

Yes…

So using this blue “play” button call proper service… is it described in card documentation? I thought that both buttons execute same code… so looks like this black execute send command, and blue xiaomi_miio.vacuum, right? :smiley:

Also as you see, atleast I check manually by direct service calls, send _command doesn’t work - whole floor is cleaned. Only xiaomi_miio_vacuum.celan_segment clean schoosen room, so those command not behave in same way.

According " You got this service call with default platform selected?"

Nope, my mistake… wrong platform selected.

For Follow Path: where I should put this script? Normally as other scripts?

It’s here

I think you have mixed something up…

The play button that is right below the map (white one on your screenshot) should call vacuum.send_command service.

The second one (black one on your screenshot) should call vacuum.start service to start full cleaning.

Yup, exactly.