Vacuum Interactive Map Card

Of course, so simple…the yaml typos get me all the time. Thanks. Works like a charm!

I have been using this and live add-on and everything works great for my 2 roborock s50 & s55.
Now I have a firmware update to 3.5.8.002034.
Is it safe to do it? Will it break anything?
Thanks!

Don’t have it here, what are the improvements?

Can you share how exactly did you do the calibration? I am having problems with it.

hi there. first of all a big thanks to @3_14 for this great card!

I am trying to make this card work (in combination with another vacuum card) on my 3d floorplan; by aligning it with the calibrated map which i then make transparent. This seems to work but i can’t find a way to position the ‘START’ button since it is glued to the bottom of the card.

( I made card visible for this example but the idea is to have it completely transparent)

as you can see my is solution is far from ideal, also because there is a lot of stuff happening in the background that I don’t need. Is there maybe a way to apply the script of the action of the ‘start-button’ to a custom button? Or does anyone maybe have another suggestion? Thanks!

can samelone share syntax of cleaning script using zones parameters instead of rooms number?

EDIT: found here: Xiaomi Vacuum cleaner Card

First of all, thanks for the fantastic work, i’m not so much of a programmer, so I could not do without all the great work you did.
However I have an issue with my vacuum interactive map and I cannot find what I’m doing wrong.
My configuration in as follows:

vacuum:
  - platform: xiaomi_miio
    host: 192.168.1.210
    token: !secret vacuum_token
    Name: Fred
 
camera:
  - platform: xiaomi_cloud_map_extractor
    name: "Fred vacuum camera"
    host: 192.168.1.210
    token: !secret vacuum_token
    username: !secret vacuum_username
    password: !secret vacuum_password
    draw: ['all']
    attributes:
      - calibration_points    
    colors:
      color_map_inside: [32, 115, 185]
      color_map_outside: [255, 255, 255]
      color_map_wall: [96, 96, 96]
      color_map_wall_v2: [93, 109, 126]
      color_grey_wall: [93, 109, 126]
      color_path: [224, 224, 224]
#      color_path: [147, 194, 238]
      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]
    room_colors:
      1: [255, 204, 204]
      2: [51, 205, 153]
      3: [117, 136, 128]
      4: [52, 152, 219]
      5: [205, 97, 85]
      6: [243, 156, 18]
      7: [88, 214, 141]
      8: [245, 176, 65]
      9: [252, 212, 81]
      10: [72, 201, 176]
      11: [84, 153, 199]
      12: [133, 193, 233]
      13: [245, 176, 65]
      14: [82, 190, 128]
      15: [72, 201, 176]
      16: [165, 105, 18]
    # texts:
    #   - text: "Room 1"
    #     x: 25
    #     y: 25
    #     color: [125, 20, 213]
    map_transformation:
    #   scale: 2
    #   rotate: 180
      trim:
        top: 20
        bottom: 20
        left: 10
        right: 15

When I configure the map like this it works fine:

calibration_points:
  - map:
      x: 190
      'y': 340
    vacuum:
      x: 25500
      'y': 25500
  - map:
      x: 790
      'y': 340
    vacuum:
      x: 33500
      'y': 25500
  - map:
      x: 190
      'y': 1080
    vacuum:
      x: 25500
      'y': 16000
default_mode: zoned_cleanup
entity: vacuum.xiaomi_vacuum_cleaner
language: nl
map_image: /local/img/woonkamer.png
type: 'custom:xiaomi-vacuum-map-card'
zones: null

However when I use the camera map like this:

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.xiaomi_vacuum_cleaner
camera_calibration: true
map_camera: camera.Fred_vacuum_camera
camera_refresh_interval: 5
language: nl
calibration_points: []
default_mode: zoned_cleanup
zones: null

the zoned cleanup does not work, the map however is fine. I must have set something wrong but do not know what. I receive an error in the log:
Logger: frontend.js.latest.202012291
Source: components/system_log/init.py:193
First occurred: 20:41:43 (3 occurrences)
Last logged: 20:41:43

http://192.168.1.10:8123/hacsfiles/lovelace-xiaomi-vacuum-map-card/xiaomi-vacuum-map-card.js:627:50 Uncaught TypeError: Cannot read property ‘convertAB’ of undefined

Hello all,

I’ve been trying to install ‘custom: xiaomi-vacuum-map-card’ for a while. I think I’m doing everything right! (pic 2 and pic 3) however keep getting the following error! What am I doing wrong? (pic. 1)

Can someone tell me what I’m doing wrong?

Thank you for your response.2

You have to add this card to resources

1 Like

Hi and thank you very much for the effort. This looks awesome and i am trying to use it in my Home Assistant.

Unfortunately i am pretty new to HA and i am struggling to get this to work.

I have installed the Lovelace Xiaomi Vacuum Map Card with HACS and under the “resources” tab i can see the “/hacsfiles/lovelace-xiaomi-vacuum-map-card/xiaomi-vacuum-map-card.js” so i think i got that part.

I also installed the Xiaomi Cloud Map Extractor and i am able to get a map from my Vacuum from the camera entity.

I dont understand what i have to do from here to get the card set up on my dashboard and how to calibrate my map.

I guess there are several steps i am missing to get this to work.

Are there any step by step guides i can follow or anyone who can give me any tips?

You have to use:

@3_14 is there a way for the image/Map to scale?

I want it a bit bigger,

i use

        - type: 'custom:xiaomi-vacuum-map-card'
          entity: vacuum.roborock_vacuum_s5
          map_camera: camera.xiaomi_cloud_map_extractor
          camera_calibration: true

And for the cloud_map_extractor i use

    map_transformation:
      rotate: 90
      scale: 2
      trim:
        top: 20
        bottom: 12
        left: 0
        right: 12

This works for your other addon, but not for this one

Heres an image when im using the other integration, works fine, heres my code, with the above from map_transformation, if i remove map_transformation it gets even smaller. so dunno whats happening, tried 2 scale, 90 scale etc

with this code

  • type: custom:dwains-flexbox-card
    items_classes: ‘col-xs-12 col-sm-6 col-sm-6’
    cards:
    {% if (data | fromjson)[‘map’] %}
    • type: custom:dwains-flexbox-card
      padding: true
      cards:
      • type: custom:dwains-heading-card
        item_classes: ‘col-xs-12 col-sm-12 col-md-12 col-lg-12’
        title: Map
      • type: ‘custom:xiaomi-vacuum-map-card’
        items_classes: ‘col-sm-12’
        entity: vacuum.roborock_vacuum_s5
        map_camera: camera.xiaomi_cloud_map_extractor
        camera_calibration: true

Can you specify what do you want to achieve?

sorry i am not good at english

i want this card to fill out the width and height of this page.

Its worked with another solution use cloud map extractor, but when i use scale here it doesnt get bigger, or just a bit

code:

type: custom:dwains-flexbox-card
items_classes: ‘col-xs-12 col-sm-6 col-sm-6’
cards:
{% if (data | fromjson)[‘map’] %}
type: custom:dwains-flexbox-card
padding: true
cards:
type: custom:dwains-heading-card
item_classes: ‘col-xs-12 col-sm-12 col-md-12 col-lg-12’
title: Map
type: ‘custom:xiaomi-vacuum-map-card’
items_classes: ‘col-sm-12’
entity: vacuum.roborock_vacuum_s5
map_camera: camera.xiaomi_cloud_map_extractor
camera_calibration: true
camera:
  - platform: xiaomi_cloud_map_extractor
    host: 10.0.0.5
    token: X
    username: X
    password: X
    draw: ['all']
    attributes:
      - calibration_points 
    map_transformation:
      rotate: 90
      scale: 5

Scale changes only resolution of an image, to get rid of empty blue spaces around a map you have to use trim

im not worried about blue space, i want the image to get bigger, so i dont have all that “white space”. See image here for other integration

Ok, so it’s something you have to do in lovelace config, not camera’s. It is probably achieved using some magic cards made by Dwaine

ok thank you, seems its not possible without doing some major work, trying to see if i can use css card mod with it.

some simple css fixed the issue sorry for bringing it up here