Skip to content

Lovelace Xiaomi Vacuum Map Card Map Support ​

The Lovelace Xiaomi Vacuum Map Card provides a user-friendly way to fully control map-based vacuums in Home Assistant.

Although the card is fully compatible with the Dreame Vacuum integration, its automatic configuration generation has some limitations and missing features. To resolve this, the card can either be configured using an automatic template or through manual configuration.

Automatic (with Template) Recommended ​

To automatically generate a complete card configuration with room and zone cleaning support, the Home Assistant Template Editor is utilized.

If the My Home Assistant integration is active, the button below can be used to navigate directly to the Template Editor:

Template tools of

If manual navigation is required, follow these steps:

  1. Navigate to the Developer Tools panel in Home Assistant.
  2. Select the Template tab from the top menu.
  3. Paste the template code provided below into the left-hand editor pane.
  4. Copy the resulting YAML output generated in the right-hand Result pane.
  5. Paste the generated output into the Lovelace card configuration.
Show Template
yaml
{# ----------------- PROVIDE YOUR OWN ENTITY IDS HERE ----------------- #}
{% set camera_entity = "camera." %}
{% set vacuum_entity = "vacuum." %}
{# ------------------- DO NOT CHANGE ANYTHING BELOW ------------------- #}
{% set attributes = states[camera_entity].attributes %}

type: custom:xiaomi-vacuum-map-card
vacuum_platform: default
entity: {{ vacuum_entity }}
map_source:
  camera: {{ camera_entity }}
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone
    max_selections: 10
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: dreame_vacuum.vacuum_clean_zone
      service_data:
        entity_id: '[[entity_id]]'
        zone: '[[selection]]'
        repeats: '[[repeats]]'
  - template: vacuum_clean_segment
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: dreame_vacuum.vacuum_clean_segment
      service_data:
        entity_id: '[[entity_id]]'
        segments: '[[selection]]'
        repeats: '[[repeats]]'
    predefined_selections:
{%- for room_id in attributes.rooms | default([]) %}
{%- set room = attributes.rooms[room_id] %}
      - id: {{room_id}}
        outline:
          - - {{room["x0"]}}
            - {{room["y0"]}}
          - - {{room["x0"]}}
            - {{room["y1"]}}
          - - {{room["x1"]}}
            - {{room["y1"]}}
          - - {{room["x1"]}}
            - {{room["y0"]}}
{%- endfor %}
  - name: Clean Spot
    icon: mdi:map-marker-plus
    max_repeats: 3
    selection_type: MANUAL_POINT
    repeats_type: EXTERNAL
    service_call_schema:
      service: dreame_vacuum.vacuum_clean_spot
      service_data:
        entity_id: '[[entity_id]]'
        points: '[[selection]]'
        repeats: '[[repeats]]'

Update Entity Names

Do not forget to update the camera_entity and vacuum_entity values with your own entity names after pasting the template into the editor.

Manual (from Configurator) ​

When configuring the card manually via the dashboard UI, several parameters must be explicitly set after adding the card:

  1. Select the vacuum entity belonging to the device provided by the dreame_vacuum integration from the Vacuum Entity dropdown.
  2. Select the corresponding Current Map (camera.{device_name}_map) entity belonging to the exact same device from the Map Entity dropdown.
  3. Select Tasshack/dreame-vacuum from the Vacuum Platform dropdown.

Platform Selection

The vacuum platform defaults to xiaomi miio. It is critical to change this from the dropdown and explicitly set it to Tasshack/dreame-vacuum. If it is not changed, the device will become unavailable when a command is sent from the card because the default commands are not recognized by the integration and the device will fail to respond.

Once the correct entities and platform are selected, click the Generate rooms config button to build the room configuration, and then click Save to apply the changes.

yaml
type: custom:xiaomi-vacuum-map-card
entity: # Your vacuum entity
map_source:
  camera: # Map Entity
calibration_source:
  camera: true
vacuum_platform: Tasshack/dreame-vacuum

Official Documentation ​