Xiaomi Cloud Vacuum Map Extractor

My region in the Xiaomi app is Australia, but I was able to use sg and obtain the map. You just might need to work through the different options and see what works.

I did. See below.

   map_transformation:
     scale: 1
     rotate: 0
     trim:
        top: 32
        bottom: 32
        left: 21.5
        right: 20

Are elements of map drawn correctly? (paths, zones, no-go zones)

Hi,
first, thank you for your work! Much appreciated!

I just installed the integration via hacs. In Lovelace the maps is also there. But if my vacuum does its job, i dont get any lines. Is there a delay or interval and i have to wait a bit longer? In my config i just use the minimal settings.

Thanks.

Hi, Iā€™ve got a S6 Max and I use it over 3 floor with 3 differents maps, how can I configure your code for multiple maps?

Thanks

Stefano

1 Like

@teqqy you have to configure what you want for camera to draw in draw section (documentation)

@martellucci itā€™s not possible yet, didnā€™t have a way to implement it (I have S55 with no floors)

1 Like

No. As far as i understood if i dont configure anything i get all values. But okay, iā€™ll give it a try.

If you donā€™t configure anything you get nothing

If you configure draw: ["all"] camera will draw everything it can.

If you configure e.g.

draw:
  - path
  - vacuum_position

it will draw only path and vacuum position

hacs? is this component availalble trought hacs?

You can add it manually as a custom repository.

I did installed the integration via hacs last Friday.
Everything works perfectly with my S5.
Thanks for this integration @3_14! Great work.

1 Like

Ah, you mean the Lovelace card? Not this custom right? Thatā€™s what confused me

This is ui-lovelace.yaml

      - type: picture-entity
        entity: camera.xiaomi_cloud_map_extractor

and ui:

1 Like

Lovelace card is available in HACS by default, map extractor can be added manually (documentation)

Yes, they are drawn correctly in the camera.

If everything is drawn correctly and calibration points are copied from the attributes then everything should be spot-onā€¦

Can you show (you can do it in a private message) config of the camera, its attributes, camera image, config of a lovelace card and how it looks with debug: true?

Here is the code in Lovelace

- title: Vacuum Map
    path: vacuum-map
    badges: []
    cards:
      - type: 'custom:xiaomi-vacuum-map-card'
        entity: vacuum.xiaomi_vacuum_cleaner
        map_camera: camera.xiaomi_roborock_map
        calibration_points:
          - vacuum:
              x: 29154
              'y': 26175
            map:
              x: 1719
              'y': 610
          - vacuum:
              x: 29167
              'y': 31815
            map:
              x: 1727
              'y': 2
          - vacuum:
              x: 14304
              'y': 25226
            map:
              x: 77
              'y': 627
      - type: picture-glance
        image: 'https://demo.home-assistant.io/stub_config/kitchen.png'
        entities:
          - entity: vacuum.xiaomi_vacuum_cleaner
        title: Roborock Vacuum Map
        camera_image: camera.xiaomi_roborock_map
        camera_view: live
        tap_action:
          action: none

Camera config as below.

- platform: xiaomi_cloud_map_extractor
   host: 192.168.1.81
   token: !secret roborock_token
   username: !secret roborock_id
   password: !secret roborock_pw
   country: sg
   name: Xiaomi Roborock Map
   colors:
     color_map_inside: [32, 115, 185]
     color_map_outside: [19, 87, 148]
     color_map_wall: [100, 196, 254]
     color_map_wall_v2: [93, 109, 126]
     color_grey_wall: [93, 109, 126]
     color_path: [255, 0, 0]
     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: [240, 178, 122]
     2: [133, 193, 233]
     3: [217, 136, 128]
     4: [52, 152, 219]
     5: [205, 97, 85]
   draw:
     - charger
     - path
     - goto_path
     - predicted_path
     - no_go_zones
     - no_mopping_zones
     - vacuum_position
     - virtual_walls
     - zones
   map_transformation:
     scale: 1
     rotate: 0
     trim:
        top: 32
        bottom: 32
        left: 21.5
        right: 20
   attributes:
     - charger
     - goto
     - goto_path
     - goto_predicted_path
     - image
     - no_go_areas
     - no_mopping_areas
     - obstacles
     - path
     - vacuum_position
     - walls
     - zones
     - calibration_points

So you havenā€™t taken calibration from camera. Copy it from attributes and everything should work

Got it. Thanks for your help.

Hello,

How to set the correct calibration values for map: when using Xiaomi Cloud Vacuum Map Extractor ?
I understand that with a .png image itā€™s possible but for Xiaomi Cloud Vacuum Map Extractor I donā€™t know how ā€¦

Thank you