Vacuum Interactive Map Card

I’ve been loving this integration. Made automating the vacuuming just so much more flexible! Unfortunately with the latest update my map seems to be broken. I can’t seem to get it to update, just have the ‘failed to retrieve map from vucuum’ message.

I can see there’s a breaking change listed for the map_camera in the changelog, but I can’t seem to find any info on how to update on my end to get it working across any of the github’s documentation.

I’m using the default Xiaomi Miio integration I think.

Here’s my config as was working in the last version (additional zones occur below the “office” but I cut them off).

type: custom:xiaomi-vacuum-map-card
title: Sweepin Seagal
preset_name: Live map
entity: vacuum.sweepin_seagal
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - zones:
          - - 28300
            - 32300
            - 24200
            - 29200
        label:
          text: Office
          x: 26500
          'y': 31200
          offset_y: 35
        icon:
          name: mdi:chair-rolling
          x: 26500
          'y': 31200

I tried to update the card as well using the new visual editor, but it’s not working either:

type: custom:xiaomi-vacuum-map-card
entity: vacuum.sweepin_seagal
vacuum_platform: default
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
title: Sweepin Seagal
two_finger_pan: false
map_locked: false

Config for the cloud_map_extractor:

#Roborock map
camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.0.140
    token: 
    username: 
    password: 
    draw: ['all']
    attributes:
      - calibration_points

Any ideas as to why I can’t get the map to load now?

The problem is on Map Extractor side:

heyhey.
I manged to get my Roborock S8 working with the HACS integration, and ofcourse Im using your vacuum card, which I really love. (Im not the handy boy, and i prefer controling things with a mouse rather than with my fingers touching on too small displays).
But there is one thing I dont get running. This is cleaning a room with more than 1 cycle.
For zones it works perfectly fine, but my code cleanes a room only onetime, even if i selected 2 or 3 cycles:
Do you have any idea what Im missing?

map_modes:
  - name: Bereiche
    icon: mdi:select-drag
    selection_type: ROOM
    repeats_type: INTERNAL
    max_repeats: 3
    service_call_schema:
      service: roborock.vacuum_clean_segment
      service_data:
        segments: '[[selection]]'
      target:
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: '16'
map_modes:
  - name: Bereiche
    icon: mdi:select-drag
    selection_type: ROOM
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: roborock.vacuum_clean_segment
      service_data:
        segments: '[[selection]]'
        repeats: '[[repeats]]'
      target:
        entity_id: '[[entity_id]]'

Hey! would you please post a code example of the new feature: * Dropdown menus in icons row?

thank you

What do you want to acheive?

As you maybe know, your code works perfectly fine.
really, thanks a lot!

But I got another question.
Im using 2 maps on this robot, and show them in your card via:

  - icon: mdi:home-floor-1
    tooltip: Laden
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 0
  - icon: mdi:home-floor-2
    tooltip: Flur
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 1

For the first map called “Laden” I defined the rooms as shown in post #1543
How do I define rooms for the map called “Flur”?

I´d like to put fan modes in dropdown menu, as the picture you shown.

You can follow these steps:

  1. Change the map to a second floor
  2. Add following config in map_modes
      - template: vacuum_clean_segment
        name: Flur rooms
    
  3. Click “Generate rooms”

You will get an additional entry in Map modes dropdown.

It should be like this by default unless you have redefined the icons section in your config.

1 Like

I’d like to modify some of them, There are options like “custom” I wouldn’t like to bee shown. Also I’d like to add translations to some of the names in the drop-down menu.

Thank you again

Ok, in this case you have to add following code to every icon you want in a specific menu:

menu_id: fan_speeds_menu

and adjust conditions to be the other way round (to make them true when the specific item is selected; only one icon from the specific menu should be selected)

1 Like

Hey Piotr
Sorry for asking again. But I dont get any rooms on my floor.
I copied the two lines of code you postet in my configuration and pressed “generate rooms”, but nothing happens.
I also tried a new control, but without success either.
Than I tried to add them like the (working) first floor via:

map_modes:
  - name: Bereiche
    icon: mdi:select-drag
    selection_type: ROOM
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: roborock.vacuum_clean_segment
      service_data:
        segments: '[[selection]]'
        repeats: '[[repeats]]'
      target:
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: '16'

But generating rooms didnt deliver anything again.
And adding rooms here made them show up only on map 1 (the first fllor).
Any idea what I did worng?

Please post your full config

Heyhey
Thanks for watching my Code :slight_smile:
I did delete all my attempts for the rooms in the 2nd floor (AS i suppose IT will confuse some1 WHO knows what he ist doing, more than IT helps) Also I deleted the configurations for the rooms in the 1st floor (Just left the IDs - except the First one - the Others Look exactly the Same) , to keep Code a Bit smaller. (I did define really Lots of Points)
I now want to load 2nd floor map and seeing the rooms in there.
P.S Sorry for my weird capitalisation. Am using a Mobile Phone, and forgot to Set dictionary to english…

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.roborockladenvorne_map
calibration_source:
  camera: true
entity: vacuum.roborockladenvorne
vacuum_platform: send_command
title: vorne
map_modes:
  - name: Bereiche
    icon: mdi:select-drag
    selection_type: ROOM
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: roborock.vacuum_clean_segment
      service_data:
        segments: '[[selection]]'
        repeats: '[[repeats]]'
      target:
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: '16'
        icon:
          name: mdi:backspace
          x: 2000
          'y': 30000
        label:
          text: hinten
          x: 2000
          'y': 30000
          offset_y: 35
        outline:
          - - 428
            - 42129
          - - 428
            - 41701
          - - 257
            - 41701
          - - 257
            - 40930
          - - 342
            - 40930
          - - 342
            - 36479
          - - 599
            - 36479
          - - 599
            - 34596
          - - 0
            - 34511
          - - 0
            - 32884
          - - 514
            - 32884
          - - 599
            - 32542
          - - 599
            - 26465
          - - 0
            - 26465
          - - 0
            - 25010
          - - 3595
            - 25010
          - - 3595
            - 32456
          - - 2054
            - 32456
          - - 2054
            - 34682
          - - 1969
            - 35281
          - - 1797
            - 40674
          - - 2910
            - 40674
          - - 2825
            - 42129
      - id: '17'
      - id: '18'
      - id: '19'
      - id: '20'
      - id: '21'
      - id: '22'
      - id: '23'
      - id: '24'
      - id: '25'
      - id: '26'
      - id: '27'
      - id: '28'
      - id: '29'
      - id: '30'
  - template: vacuum_clean_zone
  - template: vacuum_goto
tiles:
  - tile_id: status
    entity: vacuum.roborockladenvorne
    label: Status
    attribute: status
    icon: mdi:robot-vacuum
    translations:
      starting: Startet
      charger_disconnected: Ladestation offline
      idle: Idle
      remote_control_active: Remote control active
      cleaning: reinigt
      manual_mode: Manueller Modus
      charging: laden
      charging_problem: Ladeproblem
      paused: Pause
      spot_cleaning: Spotreinigung
      error: Error
      shutting_down: Herunterfahren
      updating: Updating
      docking: dockt an
      going_to_target: Fahre zum Ziel
      zoned cleaning: Zonenreinigung
      segment cleaning: Raumreinigung
      charging_complete: Komplett geladen
      device_offline: Gerät offline
      washing the mop: Wischtuch reinigen
      returning home: Rückfahrt zur Ladestation
      emptying_the_bin: Behälter entleeren
      going to wash the mop: Rückspülung
  - tile_id: battery_level
    entity: vacuum.roborockladenvorne
    label: Batterie
    attribute: battery_level
    icon: mdi:battery-charging-100
    unit: '%'
  - tile_id: errors
    entity: sensor.roborockladenvorne_current_error
    label: Fehler
    icon: mdi:alert
  - tile_id: station
    entity: sensor.roborockladenvorne_dock_status
    label: Station
    icon: mdi:robot-vacuum
    translations:
      starting: Starting
      water_empty: Reinigungswasser leer
      duct_blockage: Absaugen nicht möglich
      waste_water_tank_full: Abwassertank voll
  - tile_id: sensor_dirty_left
    label: Sensorreinigung
    unit: h
    multiplier: 0.0002777777777777778
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: reset_consumable
        params: sensor_dirty_time
        entity_id: vacuum.roborockladenvorne
    entity: sensor.roborockladenvorne_sensor_dirty_left
    icon: mdi:eye-outline
    precision: 0
  - tile_id: filter_left
    label: Staubsaugerfilter
    unit: h
    multiplier: 0.0002777777777777778
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: reset_consumable
        params: filter_work_time
        entity_id: vacuum.roborockladenvorne
    entity: sensor.roborockladenvorne_filter_left
    icon: mdi:air-filter
    precision: 0
    translations: {}
  - tile_id: main_brush_left
    label: Hauptbürste
    unit: h
    multiplier: 0.0002777777777777778
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: reset_consumable
        params: main_brush_work_time
        entity_id: vacuum.roborockladenvorne
    entity: sensor.roborockladenvorne_main_brush_left
    icon: mdi:brush
    precision: 0
    translations: {}
  - tile_id: side_brush_left
    label: Seitenbürste
    unit: h
    multiplier: 0.0002777777777777778
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: reset_consumable
        params: side_brush_work_time
        entity_id: vacuum.roborockladenvorne
    entity: sensor.roborockladenvorne_side_brush_left
    icon: mdi:brush
    precision: 0
    translations: {}
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.roborockladenvorne
        value_not: cleaning
      - entity: vacuum.roborockladenvorne
        value_not: error
      - entity: vacuum.roborockladenvorne
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.roborockladenvorne
  - icon: mdi:pause
    conditions:
      - entity: vacuum.roborockladenvorne
        value_not: docked
      - entity: vacuum.roborockladenvorne
        value_not: idle
      - entity: vacuum.roborockladenvorne
        value_not: error
      - entity: vacuum.roborockladenvorne
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.roborockladenvorne
  - icon: mdi:stop
    conditions:
      - entity: vacuum.roborockladenvorne
        value_not: docked
      - entity: vacuum.roborockladenvorne
        value_not: idle
      - entity: vacuum.roborockladenvorne
        value_not: error
      - entity: vacuum.roborockladenvorne
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.roborockladenvorne
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.roborockladenvorne
        value_not: docked
      - entity: vacuum.roborockladenvorne
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.roborockladenvorne
  - icon: mdi:target-variant
    conditions:
      - entity: vacuum.roborockladenvorne
        value_not: docked
      - entity: vacuum.roborockladenvorne
        value_not: error
      - entity: vacuum.roborockladenvorne
        value_not: cleaning
      - entity: vacuum.roborockladenvorne
        value_not: returning
    tooltip: Clean spot
    tap_action:
      action: call-service
      service: vacuum.clean_spot
      service_data:
        entity_id: vacuum.roborockladenvorne
  - icon: mdi:home-floor-1
    tooltip: Laden
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 0
  - icon: mdi:home-floor-2
    tooltip: Flur
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 1


I have prepared a cleaned-up version of the config for you. Copy this config and click “Generate room config” button (after switching to the second floor) - the rooms will be populated in “Flur rooms” section.

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.roborockladenvorne_map
calibration_source:
  camera: true
entity: vacuum.roborockladenvorne
vacuum_platform: humbertogontijo/homeassistant-roborock
title: vorne
map_modes:
  - template: vacuum_clean_segment
    name: Bereiche
    predefined_selections:
      - id: '16'
        icon:
          name: mdi:backspace
          x: 2000
          'y': 30000
        label:
          text: hinten
          x: 2000
          'y': 30000
          offset_y: 35
        outline:
          - - 428
            - 42129
          - - 428
            - 41701
          - - 257
            - 41701
          - - 257
            - 40930
          - - 342
            - 40930
          - - 342
            - 36479
          - - 599
            - 36479
          - - 599
            - 34596
          - - 0
            - 34511
          - - 0
            - 32884
          - - 514
            - 32884
          - - 599
            - 32542
          - - 599
            - 26465
          - - 0
            - 26465
          - - 0
            - 25010
          - - 3595
            - 25010
          - - 3595
            - 32456
          - - 2054
            - 32456
          - - 2054
            - 34682
          - - 1969
            - 35281
          - - 1797
            - 40674
          - - 2910
            - 40674
          - - 2825
            - 42129
      - id: '17'
      - id: '18'
      - id: '19'
      - id: '20'
      - id: '21'
      - id: '22'
      - id: '23'
      - id: '24'
      - id: '25'
      - id: '26'
      - id: '27'
      - id: '28'
      - id: '29'
      - id: '30'
  - template: vacuum_clean_segment
    name: Flur rooms
  - template: vacuum_clean_zone
  - template: vacuum_goto
append_tiles: true
tiles:
  - tile_id: status
    replace_config: true
    label: Status
    order: 1
    translations:
      starting: Startet
      charger_disconnected: Ladestation offline
      idle: Idle
      remote_control_active: Remote control active
      cleaning: reinigt
      manual_mode: Manueller Modus
      charging: laden
      charging_problem: Ladeproblem
      paused: Pause
      spot_cleaning: Spotreinigung
      error: Error
      shutting_down: Herunterfahren
      updating: Updating
      docking: dockt an
      going_to_target: Fahre zum Ziel
      zoned cleaning: Zonenreinigung
      segment cleaning: Raumreinigung
      charging_complete: Komplett geladen
      device_offline: Gerät offline
      washing the mop: Wischtuch reinigen
      returning home: Rückfahrt zur Ladestation
      emptying_the_bin: Behälter entleeren
      going to wash the mop: Rückspülung
  - tile_id: battery_level
    label: Batterie
    replace_config: true
    order: 2
  - tile_id: errors
    entity: sensor.roborockladenvorne_current_error
    label: Fehler
    icon: mdi:alert
    order: 3
  - tile_id: station
    entity: sensor.roborockladenvorne_dock_status
    label: Station
    icon: mdi:robot-vacuum
    order: 4
    translations:
      starting: Starting
      water_empty: Reinigungswasser leer
      duct_blockage: Absaugen nicht möglich
      waste_water_tank_full: Abwassertank voll
  - tile_id: sensor_dirty_left
    label: Sensorreinigung
    replace_config: true
    order: 5
  - tile_id: filter_left
    label: Staubsaugerfilter
    replace_config: true
    order: 6
  - tile_id: main_brush_left
    label: Hauptbürste
    replace_config: true
    order: 7
  - tile_id: side_brush_left
    label: Seitenbürste
    replace_config: true
    order: 8
append_icons: true
icons:
  - icon: mdi:home-floor-1
    tooltip: Laden
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 0
  - icon: mdi:home-floor-2
    tooltip: Flur
    tap_action:
      action: call-service
      service: roborock.vacuum_load_multi_map
      service_data:
        entity_id: vacuum.roborockladenvorne
        map_flag: 1

Hey
Thanks for the changing in code. Didnt realise there is a roborock platform.
Ill take a look at this and change my code.
But populating the rooms doesnt work.
I created a new card, copied your code in, switched to second floor. After clicking creating rooms config, nothing happens. But I’ve seen this way im able to create rooms in 2nd floor my own.
Its not coolest work, but would be fine for me.
If you want any further info from here, why it isnt working, im here for you.
But for my creating rooms myself is fine - so I dont need to bother you any longer.

Really Thanks for your big help!

I created a new card, copied your code in, switched to second floor. After clicking creating rooms config, nothing happens.

Well, it worked on my HA :confused: do you have anything non-standard? Are rooms available as an attribute of the camera after switching the floor?

Im Sorry, but can you tell me how to find out?

They should be available in the attributes of the camera entity