Vacuum Interactive Map Card

You can:

  1. Create a card with a map from Map Extractor
  2. Follow calibration instructions for FloleVac, but instead of said app use “Copy selection” feature from Map Card’s editor

Or you can just use FloleVac if it works for you

Is it possible to call a script when a zone is clicked, instead of clean those coordinates?

I’ve got all my zones in individual scripts (script.vacuum_office). When a script is called from one of buttons, it updates an input_select so I know which room is being cleaned (The Currently Vacuuming: card). Obviously this only works when a cleaning is triggered from one of those buttons and not when triggered from the map, so I was curious if it’s possible to call my room scripts from the map instead.

Sure thing, service calls for this card are really highly configurable :slight_smile:

map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: '[[selection_unwrapped]]'
    predefined_selections:
      - id: script.vacuum_bedroom
        ...
      - id: script.vacuum_bathroom
        ...

How can ne change the colors on the map?

Example:

Hm, I can’t seem to get the boxes or icons to show up. Here’s my working yaml with zones if that helps. If you could assist in formatting correctly 1 room for a service call, I can probably figure out the rest

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - zones:
          - - 22023
            - 23769
            - 26332
            - 27671
        label:
          text: Office
          x: 24012
          'y': 25523
      - zones:
          - - 26285
            - 22065
            - 29741
            - 27577
        label:
          text: Dining
          x: 27942
          'y': 25807
      - zones:
          - - 23348
            - 21970
            - 29741
            - 23694
        label:
          text: Entry
          x: 25064
          'y': 22818
      - zones:
          - - 29609
            - 17748
            - 34877
            - 24460
        label:
          text: Kitchen
          x: 32610
          'y': 20599
      - zones:
          - - 22639
            - 18525
            - 27137
            - 22142
        label:
          text: Son
          x: 25196
          'y': 20645
      - zones:
          - - 26096
            - 12889
            - 31115
            - 22283
        label:
          text: Game Rm
          x: 27564
          'y': 14536
      - zones:
          - - 33519
            - 12983
            - 37544
            - 18069
        label:
          text: Breakfast
          x: 35716
          'y': 16375
      - zones:
          - - 29619
            - 24237
            - 35414
            - 27721
        label:
          text: Master Bath
          x: 32470
          'y': 25187
      - zones:
          - - 34856
            - 17293
            - 40205
            - 23041
        label:
          text: Living Rm
          x: 36751
          'y': 20361
      - zones:
          - - 35318
            - 23003
            - 39880
            - 27840
        label:
          text: Master Bed Rm
          x: 37675
          'y': 24509
      - zones:
          - - 29619
            - 12841
            - 32889
            - 16913
        label:
          text: Daughter
          x: 31166
          'y': 15698
  - template: vacuum_goto_predefined
    predefined_selections:
      - position:
          - 37651
          - 18940
        icon:
          name: mdi:trash-can
          x: 37651
          'y': 18940
      - position:
          - 33531
          - 19508
        icon:
          name: mdi:water
          x: 33531
          'y': 19508
  - template: vacuum_clean_zone
  - template: vacuum_goto
  - template: vacuum_follow_path

What exactly do you mean? These sections?
image

If so, you have explicitly disabled them. To re-enable them you have to remove lines 11 and 12 from card’s config.

Yep I have those disabled on purpose. I was wanting to see the labels and zones boxes of each room still (i.e - the Office), still be able to click on that, but when I click on office, it calls script.vacuum_office.

I’m pretty sure I’m just not formatting or writing it correctly. Here’s what I tried but the map just comes up blank.

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: '[[selection_unwrapped]]'
      predefined_selections:
        - id: script.vacuum_office
          zone:
            - - 22023
              - 23769
              - 26332
              - 27671
          label:
            text: Office
            x: 24012
            'y': 25523

Ok, I get it now. In vacuum_clean_segment template you have to define outline instead of zone - thanks to that approach you can create irregular rooms.

Outline is a list of points that will be connected with a line. Here you have a guide that will help you in figuring out appropriate coordinates.

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: '[[selection_unwrapped]]'
    predefined_selections:
      - id: script.vacuum_office
        outline:
          - [22023, 23769]
          - [22023, 27671]
          - [26332, 27671]
          - [26332, 23769]
        label:
          text: Office
          x: 24012
          'y': 25523
          offset_y: 35
        icon:
          name: "mdi:chair-rolling"
          x: 24012
          y: 25523

Its still showing up blank for some reason. I’ve removed the outline: section completely to see if I could get just the text or icons to appear, but they dont. Any other suggestions?

Ok, the problem is that IDs are not allowed to contain dots. Use following code instead:

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: '[[script]]'
    predefined_selections:
      - id: 1
        outline:
          - [22023, 23769]
          - [22023, 27671]
          - [26332, 27671]
          - [26332, 23769]
        label:
          text: Office
          x: 24012
          'y': 25523
          offset_y: 35
        icon:
          name: "mdi:chair-rolling"
          x: 24012
          y: 25523
        variables:
          script: script.vacuum_office

or

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: 'script.[[selection_unwrapped]]'
    predefined_selections:
      - id: vacuum_office
        outline:
          - [22023, 23769]
          - [22023, 27671]
          - [26332, 27671]
          - [26332, 23769]
        label:
          text: Office
          x: 24012
          'y': 25523
          offset_y: 35
        icon:
          name: "mdi:chair-rolling"
          x: 24012
          y: 25523

Thanks for all your help btw. Still can’t get either of those to work unfortunately. It just isn’t showing any room outlines or labels. You don’t have to spend any more time on it though, just wanted to report back

Can you show your config? I suppose this is a minor problem that just needs to be found. You can also check browser’s console for any errors.

Sure thing. Here’s what in my configuration file.

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.68.133
    token: !secret roborock_token
    username: !secret roborock_username
    password: !secret roborock_password
    draw: ['all']
    attributes:
      - calibration_points
    colors:
      color_map_inside: [32, 115, 185]
      color_map_outside: [28, 28, 28]
      color_map_wall: [100, 196, 254]
      color_map_wall_v2: [93, 109, 126]
      color_grey_wall: [93, 109, 126]
      color_path: [255, 255, 255]
      color_goto_path: [0, 255, 0]
      color_predicted_path: [255, 255, 0, 0]
      color_zones: [0xAD, 0xD8, 0xFF, 0x8F]
      color_zones_outline: [0xAD, 0xD8, 0xFF]
      color_virtual_walls: [255, 0, 0]
      color_no_go_zones: [255, 33, 55, 127]
      color_no_go_zones_outline: [255, 0, 0]
      color_no_mop_zones: [163, 130, 211, 127]
      color_no_mop_zones_outline: [163, 130, 211]
      color_charger: [0x66, 0xfe, 0xda, 0x7f]
      color_robo: [75, 235, 149]
      color_unknown: [0, 0, 0]
      color_scan: [0xDF, 0xDF, 0xDF]
    scan_interval:
      seconds: 5
    auto_update: true

And here’s the card config you sent me that doesnt draw outlines or labels. Everything is up to date as well.

type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_vacuum_a15
rotate: 180
background_color: green
map_locked: true
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
vacuum_platform: default
tiles: []
icons: []
map_modes:
  - template: vacuum_clean_segment
    repeats_type: NONE
    max_selections: 1
    service_call_schema:
      service: script.turn_on
      service_data:
        entity_id: 'script.[[selection_unwrapped]]'
      predefined_selections:
        - id: vacuum_office
          outline:
            - [22023, 23769]
            - [22023, 27671]
            - [26332, 27671]
            - [26332, 23769]
          label:
            text: Office
            x: 24012
            'y': 25523
            offset_y: 35
          icon:
            name: "mdi:chair-rolling"
            x: 24012
            y: 25523

Ok, I have found the problem: section predefined_selections has invalid indentation - 2 spaces have to be removed. I have updated configs in my previous comments.

Initial data.

  1. Dream l10 pro
  2. root+Valetodo
  3. Xiaomi Vacuum Map Card.

I have 2 main problems with Xiaomi Vacuum Map Card.

  1. The map is not shown,
MAP

type: custom:xiaomi-vacuum-map-card
entity: vacuum.valetudo_flusteredtubbyjay
map_source:
  camera: camera.valetudo_flusteredtubbyjay_map_data
calibration_source:
  camera: true
vacuum_platform: Hypfer/Valetudo

Означает ли это что Xiaomi Vacuum Map Card, не может показать ту карту которую генерируемое Valetodo и мне необходимо использовать " I can’t believe it’s not Valetudo"

  1. 2 question. Component swears “Incorrect calibration, please check your configuration”
    The calibration instructions say that I can use 3 options for obtaining calibration data
    With Xiaomi Cloud Map Extractor (recommended)
    With FloleVac
    With Xiaomi Home

Xiaomi Cloud Map Extractor and Xiaomi Home i can’t use since i installed valetodo and uninstalled everything related to xiaomi cloud.
I can’t use FloleVac either, because Google play says that the FloleVac version is old and not suitable for my devices. Is there another way to get the calibration?

Yes, at this moment you have to use “I can’t believe it’s not Valetudo”. You have to calibrate it manually using approach similar to one for FloleVac, just with Valetudo instead.

But, probably soon, Valetudo will be supported by Map Extractor as well (locally, not over cloud).

You are awesome, thanks so much for spending the time looking into this! Its working perfectly now. I tipped you through Paypal.

1 Like

I’m happy to help, especially in some new and unusual cases :wink:

@3_14 Hello, first of all thanks for the great card. Unfortunately, the room cleaning does not work for me. I get an error message as shown in the picture. Attached is my yaml code.
I would be happy if you could help me.

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
entity: vacuum.alfredo
vacuum_platform: default
tiles:
  - tile_id: status
    entity: vacuum.alfredo
    label: Status
    attribute: status
    icon: mdi:robot-vacuum
    translations:
      starting: Starting
      charger disconnected: Charger disconnected
      idle: Idle
      remote control active: Remote control active
      cleaning: Cleaning
      returning home: Returning home
      manual mode: Manual mode
      charging: Charging
      charging problem: Charging problem
      paused: Paused
      spot cleaning: Spot cleaning
      error: Error
      shutting down: Shutting down
      updating: Updating
      docking: Docking
      going to target: Going to target
      zoned cleaning: Zoned cleaning
      segment cleaning: Segment cleaning
      emptying the bin: Emptying the bin
      charging complete: Charging complete
      device offline: Device offline
  - tile_id: fan_speed
    entity: vacuum.alfredo
    label: Fan speed
    attribute: fan_speed
    icon: mdi:fan
    translations:
      silent: Silent
      standard: Standard
      medium: Medium
      turbo: Turbo
      auto: Auto
      gentle: Gentle
icons:
  - icon: mdi:play
    conditions:
      - entity: vacuum.alfredo
        value_not: cleaning
      - entity: vacuum.alfredo
        value_not: error
      - entity: vacuum.alfredo
        value_not: returning
    tooltip: Start
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:pause
    conditions:
      - entity: vacuum.alfredo
        value_not: docked
      - entity: vacuum.alfredo
        value_not: idle
      - entity: vacuum.alfredo
        value_not: error
      - entity: vacuum.alfredo
        value_not: paused
    tooltip: Pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:stop
    conditions:
      - entity: vacuum.alfredo
        value_not: docked
      - entity: vacuum.alfredo
        value_not: idle
      - entity: vacuum.alfredo
        value_not: error
      - entity: vacuum.alfredo
        value_not: paused
    tooltip: Stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:home-map-marker
    conditions:
      - entity: vacuum.alfredo
        value_not: docked
      - entity: vacuum.alfredo
        value_not: returning
    tooltip: Return to base
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:target-variant
    conditions:
      - entity: vacuum.alfredo
        value_not: docked
      - entity: vacuum.alfredo
        value_not: error
      - entity: vacuum.alfredo
        value_not: cleaning
      - entity: vacuum.alfredo
        value_not: returning
    tooltip: Clean spot
    tap_action:
      action: call-service
      service: vacuum.clean_spot
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:map-marker
    tooltip: Locate
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.alfredo
  - icon: mdi:fan-remove
    conditions:
      - entity: vacuum.alfredo
        attribute: fan_speed
        value: Silent
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.alfredo
        fan_speed: Standard
  - icon: mdi:fan-speed-1
    conditions:
      - entity: vacuum.alfredo
        attribute: fan_speed
        value: Standard
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.alfredo
        fan_speed: Medium
  - icon: mdi:fan-speed-2
    conditions:
      - entity: vacuum.alfredo
        attribute: fan_speed
        value: Medium
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.alfredo
        fan_speed: Turbo
  - icon: mdi:fan-speed-3
    conditions:
      - entity: vacuum.alfredo
        attribute: fan_speed
        value: Turbo
    tooltip: Change fan speed
    tap_action:
      action: call-service
      service: vacuum.set_fan_speed
      service_data:
        entity_id: vacuum.alfredo
        fan_speed: Silent
  - icon: mdi:fan-alert
    conditions:
      - entity: vacuum.alfredo
        attribute: fan_speed
        value_not: Silent
      - entity: vacuum.alfredo
        attribute: fan_speed
        value_not: Standard
      - entity: vacuum.alfredo
        attribute: fan_speed
        value_not: Medium
      - entity: vacuum.alfredo
        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.alfredo
        fan_speed: Silent
map_modes:
  - template: vacuum_clean_segment
    max_selections: 1
    repeats_type: EXTERNAL
    max_repeats: 3
    service_call_schema:
      service: xiaomi_miot.call_action
      service_data:
        entity_id: vacuum.alfredo
        siid: 4
        aiid: 1
        params:
          - piid: 1
            value: 18
          - piid: 10
            value: '{""selects"":[[[[selection_unwrapped]],[[repeats]],3,3,1]]}'
        force_params: true
    predefined_selections:
      - id: 1
        outline:
          - - 17444
            - 21264
          - - 20016
            - 21264
          - - 20115
            - 20621
          - - 20016
            - 20571
          - - 19917
            - 19631
          - - 19719
            - 18592
          - - 19967
            - 18493
          - - 19967
            - 18345
          - - 19373
            - 18295
          - - 19373
            - 17454
          - - 17542
            - 17405
          - - 17394
            - 21264
        label:
          text: Bad
          x: 18680
          'y': 19483
          offset_y: 25
        icon:
          name: mdi:shower
          x: 18680
          'y': 19483
      - id: 2
        outline:
          - - 20610
            - 20126
          - - 21946
            - 20126
          - - 21995
            - 18493
          - - 22639
            - 18196
          - - 22639
            - 17949
          - - 22342
            - 17999
          - - 22243
            - 17603
          - - 20363
            - 17553
          - - 20363
            - 18493
          - - 20561
            - 18493
          - - 20561
            - 20225
        label:
          text: Büro
          x: 21282
          'y': 18917
          offset_y: 25
        icon:
          name: mdi:office-building
          x: 21282
          'y': 18917
      - id: 3
        outline:
          - - 17938
            - 25371
          - - 21303
            - 25321
          - - 21204
            - 21412
          - - 20363
            - 21462
          - - 20214
            - 22006
          - - 17444
            - 22056
          - - 17938
            - 25371
        label:
          text: Schlafzimmer
          x: 20482
          'y': 23615
          offset_y: 25
        icon:
          name: mdi:bed
          x: 20482
          'y': 23615
      - id: 4
        outline:
          - - 22490
            - 25371
          - - 23876
            - 25371
          - - 23876
            - 23342
          - - 24816
            - 23342
          - - 24766
            - 22550
          - - 24271
            - 22550
          - - 24271
            - 21759
          - - 23678
            - 21808
          - - 23678
            - 21412
          - - 22886
            - 21462
          - - 22886
            - 21709
          - - 22540
            - 21808
          - - 22441
            - 25371
        label:
          text: Kinderzimmer
          x: 23258
          'y': 23562
          offset_y: 25
        icon:
          name: mdi:teddy-bear
          x: 23258
          'y': 23562
      - id: 5
        outline:
          - - 27636
            - 19730
          - - 27586
            - 18147
          - - 26894
            - 18048
          - - 26894
            - 17405
          - - 27636
            - 17454
          - - 27685
            - 16861
          - - 30060
            - 16811
          - - 30060
            - 19730
          - - 27586
            - 19780
        label:
          text: Küche
          x: 28744
          'y': 18925
          offset_y: 35
        icon:
          name: mdi:pot-steam
          x: 28744
          'y': 18295
      - id: 6
        outline:
          - - 25112
            - 26756
          - - 30406
            - 26855
          - - 30505
            - 20423
          - - 27388
            - 20571
          - - 27586
            - 18741
          - - 25607
            - 18691
          - - 25409
            - 20423
          - - 20165
            - 20373
          - - 20165
            - 21363
          - - 25112
            - 21412
          - - 25063
            - 26805
        label:
          text: Wohnzimmer
          x: 27982
          'y': 23936
          offset_y: 35
        icon:
          name: mdi:sofa
          x: 27982
          'y': 23936
  - name: Pin & Go
    icon: mdi:map-marker-plus
    run_immediately: false
    coordinates_rounding: true
    selection_type: MANUAL_POINT
    max_selections: 999
    repeats_type: NONE
    max_repeats: 1
    service_call_schema:
      service: xiaomi_miio.vacuum_goto
      service_data:
        x_coord: '[[point_x]]'
        y_coord: '[[point_y]]'
        entity_id: '[[entity_id]]'
    predefined_selections: []
    variables: {}
  - name: Path
    icon: mdi:map-marker-path
    selection_type: MANUAL_PATH
    max_selections: 5
    repeats_type: NONE
    max_repeats: 5
    service_call_schema:
      service: vacuum.do_path
      service_data:
        path: '[[selection]]'
        repeats: '[[repeats]]'
        predefined: 'false'
      target:
        entity_id: '[[entity_id]]'

1 Like