Vacuum Interactive Map Card

Thank you very much Piotr! this is exactly it! I had read the posts and thought that referred to this card, but not the integration. Went back to the map extractor documentation and I think I didn´t have it as it was added after I installed it and didn´t read the changes when updating.

Appreciate the help!!

Perhaps stupid now, but am i supposed to use card-mod for this or do i need to change somethign somewhere else.

For this one: --map-card-secondary-color

You can add it to your theme in yaml file

This looks really great! Been using V1 for a long time in lovelace. Got V2 working in lovelace too.
I’m struggeling to add V2 within the YAML file. I would like to add the manual path feature.

Any chance you can who how it is connected from the YAML file to lovelace? Will I just add your demo code to the config yaml file?

I’m having some troubles with my map. It used to display properly, at some time didn’t anymore. I removed and reinstalled through HACS. But the first zone I drew is now stuck like some kind of wart on the map… can’t get rid of it, uninstalling/reinstalling doesn’t fix it, cleaning cache doesn’t either… I’m lost.

Can you help out?

image

Edit: Ah… it seems the card remembers the last zone I drew and keeps that as a blue box. Still, I would love to get rid of it. Is that possible?

You have to install this script and use vacuum_follow_path template in map_modes

It’s not card, but the camera. You have to change

    draw: ["all"]

to:

    draw:
      - charger
      - cleaned_area
      - goto_path
      - ignored_obstacles
      - ignored_obstacles_with_photo
      - no_go_zones
      - no_mopping_zones
      - obstacles
      - obstacles_with_photo
      - path
      - predicted_path
      - room_names
      - vacuum_position
      - virtual_walls
1 Like

I dont want to come off sounding inconsiderate. I very much appreciate the integration update. But the instructions for this arent very clear to be honest.

I still cant get any of it to work.

type: custom:xiaomi-vacuum-map-card
entity: vacuum.rosie
map_source:
  camera: camera.vacuum_map
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_goto
  - template: vacuum_clean_zone_predefined
  - template: vacuum_follow_path

    predefined_selections:
      - zones:
          - - 24245
            - 25190
            - 27495
            - 27940
          - - 27492
            - 26789
            - 28942
            - 27889
      - zones:
          - - 25317
            - 29250
            - 26755
            - 30757
      - zones:
          - - 25180
            - 25142
            - 30384
            - 29182
      - zones:
          - - 30441
            - 25737
            - 33775
            - 28064
      - zones:
          - - 31510
            - 30455
            - 37109
            - 33977
      - zones:
          - - 32202
            - 28693
            - 36983
            - 30329
      - zones:
          - - 33775
            - 25045
            - 37109
            - 28819
      - zones:
          - - 37046
            - 25611
            - 40569
            - 28819
      - zones:
          - - 36920
            - 22277
            - 40632
            - 25611
      - zones:
          - - 40128
            - 24793
            - 44972
            - 26429
      - zones:
          - - 43588
            - 26240
            - 44972
            - 27498
      - zones:
          - - 44532
            - 25359
            - 51137
            - 26366
      - zones:
          - - 46734
            - 22151
            - 51200
            - 25485
      - zones:
          - - 44029
            - 22214
            - 47614
            - 23786
      - zones:
          - - 44972
            - 23724
            - 47111
            - 25296
      - zones:
          - - 42771
            - 23849
            - 45035
            - 24793
      - zones:
          - - 41324
            - 22654
            - 42771
            - 24856
      - zones:
          - - 30108
            - 29005
            - 32319
            - 30798
  - name: Path
    icon: mdi:map-marker-path
    selection_type: MANUAL_PATH
    max_selections: 5
    repeats_type: NONE
    max_repeats: 5
    service_call_schema:
      service: script.vacuum_follow_path
      service_data:
        path: '[[selection]]'
        repeats: '[[repeats]]'
        predefined: 'false'
      target:
        entity_id: '[[entity_id]]'
  - name: Manual Point
    icon: mdi:map-marker-plus
    selection_type: MANUAL_POINT
    max_selections: 5
    repeats_type: NONE
    max_repeats: 5
    service_call_schema:
      service: vacuum.do_point
      service_data:
        point: '[[selection]]'
        point_x: '[[point_x]]'
        point_y: '[[point_y]]'
        repeats: '[[repeats]]'
        predefined: 'false'
      target:
        entity_id: '[[entity_id]]'
style: |
  ha-card {
    border: solid 6px var(--accent-color);
    border-radius: 0px;
    background: rgba(0,0,0,.8);
    box-shadow: none;    
   }
keep:
  margin: true
  box_shadow: true
  background: false
  outer_padding: true
  border_radius: true
vacuum_platform: default

gives me this error:

Mode MANUAL_PATH does not support predefined selections

and adding the script into my scripts.yaml. leads to a bunch of errors as well:

any help would be appreciated

edit: okay I figured out where to add the template instead of the mapmode at the top, I put it under

  - name: Path
    template: vacuum_follow_path

now im getting errors from the script:
templerror

Here you have a fixed config:

type: custom:xiaomi-vacuum-map-card
entity: vacuum.rosie
map_source:
  camera: camera.vacuum_map
calibration_source:
  camera: true
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_goto
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - zones:
          - - 24245
            - 25190
            - 27495
            - 27940
          - - 27492
            - 26789
            - 28942
            - 27889
      - zones:
          - - 25317
            - 29250
            - 26755
            - 30757
      - zones:
          - - 25180
            - 25142
            - 30384
            - 29182
      - zones:
          - - 30441
            - 25737
            - 33775
            - 28064
      - zones:
          - - 31510
            - 30455
            - 37109
            - 33977
      - zones:
          - - 32202
            - 28693
            - 36983
            - 30329
      - zones:
          - - 33775
            - 25045
            - 37109
            - 28819
      - zones:
          - - 37046
            - 25611
            - 40569
            - 28819
      - zones:
          - - 36920
            - 22277
            - 40632
            - 25611
      - zones:
          - - 40128
            - 24793
            - 44972
            - 26429
      - zones:
          - - 43588
            - 26240
            - 44972
            - 27498
      - zones:
          - - 44532
            - 25359
            - 51137
            - 26366
      - zones:
          - - 46734
            - 22151
            - 51200
            - 25485
      - zones:
          - - 44029
            - 22214
            - 47614
            - 23786
      - zones:
          - - 44972
            - 23724
            - 47111
            - 25296
      - zones:
          - - 42771
            - 23849
            - 45035
            - 24793
      - zones:
          - - 41324
            - 22654
            - 42771
            - 24856
      - zones:
          - - 30108
            - 29005
            - 32319
            - 30798
  - template: vacuum_follow_path
style: |
  ha-card {
    border: solid 6px var(--accent-color);
    border-radius: 0px;
    background: rgba(0,0,0,.8);
    box-shadow: none;    
   }
keep:
  margin: true
  box_shadow: true
  background: false
  outer_padding: true
  border_radius: true
vacuum_platform: default

Here you have a source of problems with script:
image

You shouldn’t provide entity id of your vacuum in it. Just remove it and everything should be ok

much appreciated, works now.

Also think ive got the rest figured out as well. Such an amazing job, for an amazing custom integration. Massive amount of options, almost overwhelming to be honest. So much that its hard to put in perspective what can be done.
I think it just needs a few more examples under each block of options. That would be a tremendous help.

Thanks, truly a great thing here.,

Yeah, there are a lot of options and documentation is not perfect (I really hate writing docs :smiley: ), but I will try to improve it

1 Like

Hello, I’m having an issue with the “Rooms” function. I pulled my room segment numbers. I have segment IDs 16,17,18,19. I used the vacuum_follow_path function to create the outline. However, when I select the room I want cleaned from the dropdown. The vacuum undocks itself then immediately redocks. Do I have to use a room number from Xiaomi or can I create a new one? Help?

type: custom:xiaomi-vacuum-map-card
entity: vacuum.edna
map_source:
  camera: camera.xiaomi_cloud_map_extractor
  crop:
    top: 180
    bottom: 180
    left: 100
    right: 100
calibration_source:
  camera: true
vacuum_platform: default
map_modes:
  - template: vacuum_clean_zone
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - icon:
          name: mdi:sofa
          x: 23537
          'y': 28724
        zones:
          - - 19615
            - 25056
            - 28298
            - 31647
      - icon:
          name: mdi:silverware
          x: 24830
          'y': 33169
        zones:
          - - 20574
            - 31661
            - 29097
            - 35429
      - icon:
          name: mdi:washing-machine
          x: 25548
          'y': 37013
        zones:
          - - 23558
            - 35388
            - 28353
            - 38624
  - template: vacuum_clean_segment
    predefined_selections:
      - room: Downstairs
        id: 16
        outline:
          - - 24963
            - 25088
          - - 22217
            - 25123
          - - 22182
            - 26096
          - - 24998
            - 26026
          - - 25032
            - 26165
          - - 24754
            - 26235
          - - 24754
            - 26895
          - - 25171
            - 26930
          - - 25206
            - 30823
          - - 22495
            - 30857
          - - 22530
            - 29189
          - - 21174
            - 29120
          - - 19645
            - 29293
          - - 19680
            - 31691
          - - 21035
            - 31622
          - - 21105
            - 32838
          - - 21870
            - 32908
          - - 21765
            - 34680
          - - 25171
            - 34750
          - - 25137
            - 35480
          - - 23573
            - 35515
          - - 23538
            - 38573
          - - 26979
            - 38538
          - - 26909
            - 36627
          - - 28299
            - 36592
          - - 28230
            - 35376
          - - 29134
            - 35341
          - - 29168
            - 31796
          - - 26596
            - 31726
          - - 26596
            - 26061
          - - 28195
            - 26061
          - - 28230
            - 25123
map_locked: true

Your config looks ok. You have to use room numbers retrieved from the vacuum. What vacuum model do you have?


Great card.
How can I remove the 3 incircled icons?

Remove append_icons from config

1 Like

That did the trick :slight_smile:

Andreas, I guess you have buttons for the different floor maps? Can you share your icon config?

Here you go

icons:
  - icon: mdi:numeric-0-box
    tooltip: Kælder
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roberta
        command: load_multi_map
        params: 3
  - icon: mdi:home-floor-0
    tooltip: Stueetagen
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roberta
        command: load_multi_map
        params: 0
  - icon: mdi:home-floor-1
    tooltip: 1. sal
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roberta
        command: load_multi_map
        params: 1
  - icon: mdi:home-floor-2
    tooltip: 2. sal
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        entity_id: vacuum.roberta
        command: load_multi_map
        params: 2

I will try to incorporate this feature in present chooser :wink:

Thanks a lott, this helps a newbie :wink: