Vacuum Interactive Map Card

Thank you very much !

I already have a map card created using the xiaomi cloud map extractor.

I also have a 3D floor plan image which I would like to use as my map in a new card.

I’ve been reading through the documentation and have successfully added my image, but I’m having trouble calibrating it.

Using my existing card, I’ve collected the coordinates of the docked position, plus two more ‘points’ that I have sent the vacuum to. I’ve then loaded my 3D floor plan image into GIMP and collected the coordinates of those same points in the image.

I’m a bit stuck getting those details into my card yaml. I am getting an error saying ‘duplicated mapping key’.
Below is my card yaml:

type: custom:xiaomi-vacuum-map-card
map_source:
  image: /local/images/2707-FP-8am.png
calibration_source:
  camera: true
  calibration_points:
    vacuum:
      x: 24557
      'y': 26471
    map:
      x: 1115
      'y': 714
    vacuum:
      x: 22571
      'y': 29259
    map:
      x: 969
      'y': 487
    vacuum:
      x: 19150
      'y': 29301
    map:
      x: 687
      'y': 474  
entity: vacuum.robot_vacuum
vacuum_platform: default

What am I doing wrong?
Do I still need the ‘camera: true’ line?
I’m assuming once I get it working I can overlay details such as rooms and paths over my 3D floor plan?

Here you have a fixed config:

type: custom:xiaomi-vacuum-map-card
map_source:
  image: /local/images/2707-FP-8am.png
calibration_source:
  calibration_points:
  - vacuum:
      x: 24557
      'y': 26471
    map:
      x: 1115
      'y': 714
  - vacuum:
      x: 22571
      'y': 29259
    map:
      x: 969
      'y': 487
  - vacuum:
      x: 19150
      'y': 29301
    map:
      x: 687
      'y': 474  
entity: vacuum.robot_vacuum
vacuum_platform: default

I’m assuming once I get it working I can overlay details such as rooms and paths over my 3D floor plan?

Unfortunately that’s not exactly how it works. You can overlay your room controls (outlines, icons), but no live data from your vacuum will be overlayed

Thanks very much. Live data is not essential for me. What a great card!

1 Like

By the way, if your floorplan has perspective distortion you might want to add a fourth calibration point

1 Like

I was getting high CPU usage:

Found out it was this: Xiaomi Cloud Map Extractor

Known issue? And possible to fix it?

Why did you quote me out of context?

That comment was about your database size but it reads like I was dismissing your CPU use.

Oops. That was by accident. I changed it now.

I assume that you haven’t changed config of camera? This is really weird, I use this integration on Pi3b+ and my CPU usage is ~ 20%. You can disable map updates when vacuum is docked to reduce CPU usage

I’ll check it out. I’m also using a Pi3B+.

But the biggest issue remains that I can’t make the vaccuum clean a room twice or three times.

Unfortunately there’s not much I can do about it :confused:

Great card!

Is there any way to hide “Cleaning count”?

Currently the only way to do it is to override autogenerated tiles with your own ones. You can retrieve autogenerated config and adjust it: guide

1 Like

Hello everyone, i’ve been playing around with this card recently. Before a basic setup of Go To cleaning and zone cleaning (not predefined) was working well.
Now i’m trying to add rooms cleaning and i’m getting stuck.
When i try to clean a room, the predefined zone appears on the map, the Roborock S5 undock makes a 360 turn and says something like “room not found” and automatically docks again.

Also since i changed the code, the zone cleaning is available in the cleaning modes menu, but it doesn’t let me design a zone on the map. :grimacing:

Any idea what did i messed up? :sweat_smile:

Here the map:

and below the code of my card:

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
entity: vacuum.roborock_vacuum_s5
vacuum_platform: default
language: it
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: 1
        outline:
          - - 18000
            - 32466
          - - 18000
            - 24751
          - - 24927
            - 24751
          - - 24974
            - 29270
          - - 33250
            - 29270
          - - 33250
            - 30400
          - - 26449
            - 30400
          - - 26449
            - 32266
          - - 23500
            - 32266
          - - 23500
            - 30554
          - - 22406
            - 30554
          - - 22454
            - 32466
        icon:
          name: mdi:sofa
          x: 21600
          'y': 29200
      - id: 2
        outline:
          - - 25160
            - 24751
          - - 25160
            - 28551
          - - 27257
            - 28551
          - - 27257
            - 29267
          - - 28446
            - 29267
          - - 28446
            - 24751

You used invalid room IDs

1 Like

Thank you so much, so easy and clear!
Sorry for the probably stupid question :sweat_smile:

Hey guys,

sorry this may seem basic to many of you but I cant find the answer.

I have two vacuums and cant work out how to give the second a camera

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.59.72
    token: token
    username: username
    password: password
    draw: ['all']
    attributes:
      - calibration_points
      - rooms
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.59.73
    token: token
    username: username
    password: password
    draw: ['all']
    attributes:
      - calibration_points
      - rooms
camera:
  - platform: xiaomi_cloud_map_extractor
    name: camera_1
    host: 192.168.59.72
    token: token
    username: username
    password: password
    draw: ['all']
    attributes:
      - calibration_points
      - rooms
  - platform: xiaomi_cloud_map_extractor
    name: camera_2
    host: 192.168.59.73
    token: token
    username: username
    password: password
    draw: ['all']
    attributes:
      - calibration_points
      - rooms
1 Like

I want the outside of the map to be transparent, but the card background of the buttons to still be visible.

If i make the whole card transparent the map and the buttons background dissappear.

If i make color_map_outside transparent, card-background-color from my theme shows insted.

you can add following line to your theme:

map-card-zoomer-background: transparent
1 Like