Vacuum Interactive Map Card

You have the same vaccum than me. Are you using Xiaomi Miio for vacuum? If not, use it. And on platform use default. About the map failed to retrieve, good luck

I see this is method to increase resolution of map. However I am not using the extractor as I use custom roborock integration and roborock app. Is there any other option to make the map clearer.

Thanks

I tried this but didn’t work

type: custom:xiaomi-vacuum-map-card
tiles: []
icons: []
map_transformation:
  scale: 2
  rotate: 180

Hello, i have a Dreame L10S Ultra with Dreame integration that works very well, but i am facing some strange behaviours if i am using a scheduler in HA in order to start at 9:30 from Monday to friday the dusting+washing mode for all the rooms. It seems that everytime i reopen the vacuum card the rooms selected become all unselected and at 9:30 the vacuum starts only with dusting and only in the first room. here below my card configuration and the scheduler:
Vacuum card:

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.dreamebot_l10s_ultra_map
calibration_source:
  camera: true
entity: vacuum.dreamebot_l10s_ultra
vacuum_platform: Tasshack/dreame-vacuum
map_modes:
  - name: Rooms
    icon: mdi:floor-plan
    run_immediately: false
    coordinates_rounding: true
    coordinates_to_meters_divider: 1000
    selection_type: ROOM
    max_selections: 60
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: dreame_vacuum.vacuum_clean_segment
      service_data:
        segments: '[[selection]]'
        repeats: '[[repeats]]'
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: '1'
        icon:
          name: mdi:toilet
          x: -2700
          'y': 8800
        label:
          text: Bathroom
          x: -2700
          'y': 8800
          offset_y: 35
        outline:
          - - -4200
            - 7800
          - - -1200
            - 7800
          - - -1200
            - 9700
          - - -4200
            - 9700
      - id: '2'
        icon:
          name: mdi:bed-king-outline
          x: -3300
          'y': 5750
        label:
          text: Primary Bedroom
          x: -3300
          'y': 5750
          offset_y: 35
        outline:
          - - -4200
            - 3600
          - - -1000
            - 3600
          - - -1000
            - 7800
          - - -4200
            - 7800
      - id: '3'
        icon:
          name: mdi:room-service-outline
          x: 150
          'y': -1050
        label:
          text: Dining Hall
          x: 150
          'y': -1050
          offset_y: 35
        outline:
          - - -4300
            - -3900
          - - 4350
            - -3900
          - - 4350
            - 3600
          - - -4300
            - 3600
    variables: {}
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: cleaning
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: error
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
  - icon: mdi:pause
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: docked
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: idle
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: error
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
  - icon: mdi:stop
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: docked
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: idle
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: error
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: docked
      - entity: vacuum.dreamebot_l10s_ultra
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
  - menu_id: fan_speed
    icon: mdi:fan-remove
    label: Silent
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value: Silent
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
        fan_speed: Silent
  - menu_id: fan_speed
    icon: mdi:fan-speed-1
    label: Standard
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value: Standard
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
        fan_speed: Standard
  - menu_id: fan_speed
    icon: mdi:fan-speed-2
    label: Strong
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value: Strong
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
        fan_speed: Strong
  - menu_id: fan_speed
    icon: mdi:fan-speed-3
    label: Turbo
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value: Turbo
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
        fan_speed: Turbo
  - icon: mdi:fan-alert
    conditions:
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value_not: Silent
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value_not: Standard
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value_not: Strong
      - entity: vacuum.dreamebot_l10s_ultra
        attribute: fan_speed
        value_not: Turbo
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.dreamebot_l10s_ultra
        fan_speed: Silent
tiles:
  - tile_id: battery_level
    entity: vacuum.dreamebot_l10s_ultra
    label: Battery
    attribute: battery_level
    icon_source: vacuum.dreamebot_l10s_ultra.attributes.battery_icon
    unit: '%'
  - tile_id: fan_speed
    entity: vacuum.dreamebot_l10s_ultra
    label: Fan speed
    attribute: fan_speed
    icon: mdi:fan
    translations:
      silent: Silent
      standard: Standard
      medium: Medium
      turbo: Turbo
      auto: Auto
      gentle: Gentle
  - tile_id: mop_pad_humidity
    attribute: mop_pad_humidity
    label: Mop pad
    icon: mdi:water-percent
    entity: vacuum.dreamebot_l10s_ultra
    precision: 0
    translations: {}
  - tile_id: cleaned_area
    attribute: cleaned_area
    label: Cleaned area
    icon: mdi:ruler-square
    unit: m²
    entity: vacuum.dreamebot_l10s_ultra
    precision: 0
    translations: {}
  - tile_id: cleaning_time
    attribute: cleaning_time
    label: Cleaning time
    icon: mdi:timer-sand
    unit: min
    entity: vacuum.dreamebot_l10s_ultra
    precision: 0
    translations: {}
  - tile_id: cleaning_count
    attribute: cleaning_count
    label: Cleaning count
    icon: mdi:counter
    unit: x
    entity: vacuum.dreamebot_l10s_ultra
    precision: 0
    translations: {}
  - tile_id: total_cleaned_area
    attribute: total_cleaned_area
    label: Total cleaned area
    icon: mdi:set-square
    unit: m²
    entity: vacuum.dreamebot_l10s_ultra
    precision: 0
    translations: {}
additional_presets: []
map_locked: true
two_finger_pan: true

Scheduler:

type: custom:scheduler-card
include:
  - vacuum.dreamebot_l10s_ultra
exclude: []
title: Dreame L10S Ultra
discover_existing: false

I don’t think it can be done in other integrations. You can’t change it via the card.

Rooms selected in the map card are not sent anywhere until you click “play” button. What service do you call using the scheduler?

Hi Piotr and thanks for replying! Honestly in the scheduler i just used the UI configuration, setting “Start” at a certain time and days (from Mon to Fri), i didn’t set a call for a speciffic service

Ok, I don’t think I can help you, this seems to be related to the integration you use to add the vacuum to HA. It definitely doesn’t depend on the map card

indeed, i think i misuderstood :slight_smile: thanks for the great card and the whole work done in any case, very helpful!

Hello Piotr,

thanks for this awesome lovelace card!
Is it possible to have some of the rooms preselected when switching to the ‘room cleanup’ mode?

No, it’s not possible at this moment

1 Like

Hey all,

Is it possible to transform my map?

I want to zoom in a bit and crop the right side.

i use the hacs roborock integration and this is my config:

    - type: custom:xiaomi-vacuum-map-card
      title: Wohnung
      view_layout:
        grid-area: map
      card_mod:
        class: header
        style: |
          ha-card {
            --map-card-primary-color: #FFFFFF10;
            --map-card-secondary-color: none;
            --map-card-secondary-text-color: #9da0a2;
            --map-card-zoomer-background: none;
            --map-card-predefined-rectangle-fill-color: none;
            --map-card-predefined-rectangle-line-color: none;
            --map-card-predefined-rectangle-line-color-selected: rgba(255, 255, 255, 0.5);
            --map-card-predefined-rectangle-fill-color-selected: rgba(42, 124, 194, 0.1);
            --map-card-predefined-rectangle-icon-background-color-selected: rgb(42, 124, 194);
            --map-card-internal-big-radius: 0.6em !important;
          }
          div.map-wrapper, div.controls-wrapper {
            padding: var(--tablet-popup-content-padding);
            padding-top: 0;
            padding-bottom: 0;
            letter-spacing: normal;
          }
          div.tiles-wrapper, div.vacuum-controls, #map-zoomer-overlay {
            display: none;
          }
          div.map-controls-wrapper {
            padding-top: 24px;
          }
          paper-button {
            --mdc-icon-size: 2em;
            color: #9da0a2 !important;
            padding: 0.42em;
          }
      language: de
      entity: vacuum.roborock_s8
      map_source:
        camera: camera.roborock_s8_map
      calibration_source:
        camera: true
      vacuum_platform: humbertogontijo/homeassistant-roborock
      map_locked: true
      map_modes:
        - template: vacuum_clean_zone
        - template: vacuum_clean_zone_predefined
          predefined_selections:
            - zones: [[17616, 24281, 23101, 27450]]
              icon:
                name: mdi:silverware-fork-knife
                x: 20550
                y: 26620
            - zones: [[11559, 26113, 14718, 29816]]
              icon:
                name: mdi:bed
                x: 14148
                y: 27549
            - zones: [[11453, 23603, 17511, 25998]]
              icon:
                name: mdi:door
                x: 15301
                y: 25468
            - zones: [[23089, 24984, 28190, 28281]]
              icon:
                name: mdi:sofa
                x: 25703
                y: 26620
            - zones: [[19152, 27417, 23325, 29434]]
              icon:
                name: mdi:fridge
                x: 20678
                y: 28413
            - zones: [[15448, 26395, 18183, 29356]]
              icon:
                name: mdi:shower
                x: 17093
                y: 28189
        - template: vacuum_goto
        - template: vacuum_follow_path

Could you share the entire code of this window?

Sure.

action: fire-dom-event
browser_mod:
  service: browser_mod.popup
  data:
    title: Rocky v2
    timeout: 300000
    style: |
      --popup-max-width: calc(385px + 550px);
      --primary-color: transparent; /* hide timeout progress */
    card_mod:
      style:
        # card divider border
        layout-card$grid-layout$: |
          hui-vertical-stack-card {
            border-right: 1.5px solid rgba(0, 0, 0, 0.2);
            border-radius: 0;
            transition: none;
          }
          /* phone */
          @media screen and (max-width: 800px) {
            hui-vertical-stack-card {
              border-right: none;
              border-bottom: 1.5px solid rgba(0, 0, 0, 0.2);
            }
          }
    content:
      type: custom:layout-card
      layout_type: custom:grid-layout
      layout:
        margin: 0
        grid-template-columns: 385px 495px
        grid-template-rows: 1fr
        grid-template-areas: |
          "info map"
        mediaquery:
          #phone
          "(max-width: 800px)":
            grid-template-columns: 1fr
            grid-template-rows: repeat(2, 1fr)
            grid-template-areas: |
              "info"
              "map"
      cards:

        ### Übersicht

        - type: vertical-stack
          view_layout:
            grid-area: info
          cards:
          - type: entities
            title: Übersicht
            card_mod:
              class: header
              style: |
                .card-content {
                  padding: var(--tablet-popup-content-padding);
                  padding-bottom: 0;
                }
            entities:

            - entity: sensor.roborock_s8_letzte_reinigung_ende 
            - entity: input_boolean.heute_gesaugt
              name: Heute gesaugt
            - entity: counter.anzahl_reinigungen
              name: Reinigungen bis Leerung

            - type: custom:bar-card
              width: 55%
              height: 2em
              decimal: 0
              unit_of_measurement: '%'
              positions:
                icon: outside
                indicator: 'off'
                name: outside
              severity:
                - color: '#303435'
                  from: 11
                  to: 999
                - color: '#6d2525'
                  from: 0
                  to: 10
              entity_row: true
              entities:
                - entity: vacuum.roborock_s8
                  attribute: battery_level
                  name: Akku
                  icon: mdi:battery
                - entity: sensor.template_vacuum_filter
                - entity: sensor.template_vacuum_mainbrush
                - entity: sensor.template_vacuum_sidebrush
                - entity: sensor.template_vacuum_sensors

#            - type: custom:more-info-card
#              entity: vacuum.roborock_s8
#              card_mod:
#                style:
#                  # hide everything but ha-select
#                  $: |
#                    h1 {
#                      display: none !important;
#                    }
#                  .: |
#                    h1, state-card-content {
#                      display: none !important;
#                    }
#                    .card-content {
#                      padding: 1.5em 0 0 0.7em;
#                    }
#                  more-info-vacuum$:
#                    .: |
#                      div.flex-horizontal>div, div:nth-child(2), ha-attributes {
#                        display: none;
#                      }
#                      ha-select {
#                        display: contents;
#                      }
#                    ha-select:
#                      $:
#                        # no icon so remove label inset
#                        .: |
#                          .mdc-floating-label {
#                            inset-inline-start: 0 !important;
#                          }
#                        # fix transparent menu background color
#                        mwc-menu$: |
#                          mwc-list {
#                            background: var(--card-background-color);
#                          }

          - type: custom:mod-card
            card_mod:
              style:
                # horizontal bottom buttons
                hui-horizontal-stack-card$: |
                  #root {
                    justify-content: space-evenly !important;
                    padding: var(--tablet-popup-button-padding);
                  }
            card:
              type: horizontal-stack
              cards:
                - type: custom:button-card
                  entity: vacuum.roborock_s8
                  icon: mdi:play-pause
                  tap_action:
                    action: call-service
                    service: >
                      [[[
                        return `[[[
                          return entity.state === 'docked' || entity.state === 'paused'
                            ? 'vacuum.start'
                            : 'vacuum.pause';
                        ]]]`
                      ]]]
                    service_data:
                      entity_id: vacuum.roborock_s8
                  template: icon_only

                - type: custom:button-card
                  entity: vacuum.roborock_s8
                  icon: mdi:battery-charging
                  tap_action:
                    action: call-service
                    service: vacuum.return_to_base
                    service_data:
                      entity_id: vacuum.roborock_s8
                  template: icon_only

                - type: custom:button-card
                  icon: mdi:delete-empty
                  tap_action:
                    action: call-service
                    service: vacuum.send_command
                    service_data:
                      entity_id: vacuum.roborock_s8
                      command: app_goto_target
                      params: [19560, 25632]
                  template: icon_only

        ### Karte Wohnung

        - type: custom:xiaomi-vacuum-map-card
          title: Wohnung
          view_layout:
            grid-area: map
          card_mod:
            class: header
            style: |
              ha-card {
                --map-card-primary-color: #FFFFFF10;
                --map-card-secondary-color: none;
                --map-card-secondary-text-color: #9da0a2;
                --map-card-zoomer-background: none;
                --map-card-predefined-rectangle-fill-color: none;
                --map-card-predefined-rectangle-line-color: none;
                --map-card-predefined-rectangle-line-color-selected: rgba(255, 255, 255, 0.5);
                --map-card-predefined-rectangle-fill-color-selected: rgba(42, 124, 194, 0.1);
                --map-card-predefined-rectangle-icon-background-color-selected: rgb(42, 124, 194);
                --map-card-internal-big-radius: 0.6em !important;
              }
              div.map-wrapper, div.controls-wrapper {
                padding: var(--tablet-popup-content-padding);
                padding-top: 0;
                padding-bottom: 0;
                letter-spacing: normal;
              }
              div.tiles-wrapper, div.vacuum-controls, #map-zoomer-overlay {
                display: none;
              }
              div.map-controls-wrapper {
                padding-top: 24px;
              }
              paper-button {
                --mdc-icon-size: 2em;
                color: #9da0a2 !important;
                padding: 0.42em;
              }
          language: de
          entity: vacuum.roborock_s8
          map_source:
            camera: camera.roborock_s8_map
          calibration_source:
            camera: true
          vacuum_platform: humbertogontijo/homeassistant-roborock
          map_locked: true
          map_modes:
            - template: vacuum_clean_zone
            - template: vacuum_clean_zone_predefined
              predefined_selections:
                - zones: [[17616, 24281, 23101, 27450]]
                  icon:
                    name: mdi:silverware-fork-knife
                    x: 20550
                    y: 26620
                - zones: [[11559, 26113, 14718, 29816]]
                  icon:
                    name: mdi:bed
                    x: 14148
                    y: 27549
                - zones: [[11453, 23603, 17511, 25998]]
                  icon:
                    name: mdi:door
                    x: 15301
                    y: 25468
                - zones: [[23089, 24984, 28190, 28281]]
                  icon:
                    name: mdi:sofa
                    x: 25703
                    y: 26620
                - zones: [[19152, 27417, 23325, 29434]]
                  icon:
                    name: mdi:fridge
                    x: 20678
                    y: 28413
                - zones: [[15448, 26395, 18183, 29356]]
                  icon:
                    name: mdi:shower
                    x: 17093
                    y: 28189
            - template: vacuum_goto
            - template: vacuum_follow_path

you have to modify the camera template

2 Likes

Hello Piotr, hello community,

is there a way to evaluate whether a room has been already cleaned on the current day (e.g. with help of the vacuums position)?

1 Like

In the integration no - you’ll have to build it yourself. Probably a series of boolean helpers you store on/off states for each room.

I didnt use the xiaomi cloud extractor.
But I found a way:

          map_source:
            camera: camera.roborock_s8_map
            crop:
              top: 0
              left: 50
              right: 125
              botton: 50

You can check if vacuum is in a specific room using data from vacuum_room attribute (only if you use Map Extractor). Based on this data you can extrapolate if specific room was cleaned

1 Like

The Ecovacs integration release.
I already integrated. Nice

1 Like