Xiaomi Cloud Vacuum Map Extractor

Hi CM000n, how did you put the image of Map extractor instead of default in the vacuum card?

Hi. I suspect that the answer to my question does not lie in the plane of “Xiaomi Cloud Vacuum Map Extractor”, but I need help.
I`m install «Xiaomi Cloud Vacuum Map Extractor»:
in folder

\config\custom_components\xiaomi_cloud_map_extractor\

copy files:

xiaomi_cloud_connector.py
map_data_parser.py
manifest.json
image_handler.py
const.py
camera.py

configuration.yaml:

camera:

  • platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: [‘all’]
    attributes:
    • calibration_points

Checking the configuration returns an error:
«Platform error camera.xiaomi_cloud_map_extractor - Requirements for xiaomi_cloud_map_extractor not found: [‘pybase64’].»
In log error:
Unable to install package pybase64. WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=‘files_pythonhosted_org’, port=443): Read timed out. (read timeout=15)”)’: /packages/38/b8/1732027d79ac822f19b6e6806ef9bc6817a65a57f577db412fa877d10650/pybase64-1.0.2.tar.gz

And also, for example, when installing HACS in the logs error:
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host=‘files_pythonhosted_org’, port=443): Max retries exceeded with url: /packages/18/54/3d39bae75219e639ef2f1ac65e4bc58480490d01658056584231729c2803/aiogithubapi-2.0.0-py3-none-any.whl (Caused by ReadTimeoutError(“HTTPSConnectionPool(host=‘files_pythonhosted_org’, port=443): Read timed out. (read timeout=15)”))

I.e. as I understood (I am new to HA and Linux is generally zero) Home Assistant sees a new component and tries to install the necessary package, but something does not give it. Although OS updates, HA updates are successful. I.e. on the Internet sees.

Home Assistant 0.118.2
HassOS 4.17
Runs in a vmware VM, from a vmdk image

====== Added after the issue was resolved =======

Yes. My suspicions were confirmed. Restrictions on access to various sites prevent you from installing components. Used instructions bypassed the blockages and everything worked.Thanks.

Tak.

English…?

I think I understand. The reason is the sanctions. Direct file access https_//files_pythonhosted_org/packages/… from a host with a VM missing. Access is only available via a VPN. Now we need to think about how to let HA through a VPN

Hi, It is possible to have only the path of the robot and the robot and hide everything else?
I need to have everything transparent except the path of the robot and the robot.
I try with this config:

camera:
    platform: xiaomi_cloud_map_extractor
    host: 192.168.1.17
    token: aa
    username: aa
    password: aa
    colors:
      color_map_inside: [32, 115, 185, 0]#tolto
      color_map_outside: [19, 87, 148, 0]#tolto
      color_map_wall: [100, 196, 254, 0]#tolto
      color_map_wall_v2: [93, 109, 126, 0]#tolto
      color_grey_wall: [93, 109, 126, 0]#tolto
      color_path: [147, 194, 238]
      color_goto_path: [0, 255, 0]
      color_predicted_path: [255, 255, 0, 0]#tolto
      color_zones: [0xAD, 0xD8, 0xFF, 0]#tolto
      color_zones_outline: [0xAD, 0xD8, 0xFF, 0]#tolto
      color_virtual_walls: [255, 0, 0, 0]#tolto
      color_no_go_zones: [255, 33, 55, 100]
      color_no_go_zones_outline: [255, 0, 0, 120]
      color_no_mop_zones: [163, 130, 211, 0]#tolto
      color_no_mop_zones_outline: [163, 130, 211, 0]#tolto
      color_charger: [204, 204, 204]
      color_robo: [255, 255, 255]
      color_unknown: [0, 0, 0]#tolto
      color_scan: [0xDF, 0xDF, 0xDF, 0]#tolto
    draw:
      - charger
      - path
      - goto_path
      - predicted_path
      - no_go_zones
      - no_mopping_zones
      - vacuum_position
      #- virtual_walls
      #- zones
    map_transformation:
      scale: 1
      rotate: 180
    sizes:
      charger_radius: 6
      vacuum_radius: 8
    attributes:
      - calibration_points
      - charger
      - goto
      - goto_path
      - goto_predicted_path
      - image
      - is_empty
      - map_name
      - no_go_areas
      - no_mopping_areas
      - obstacles
      - path
      - room_numbers
      - rooms
      - vacuum_position
      - vacuum_room
      - walls
      - zones
    scan_interval:
      seconds: 10
    auto_update: true

The result is this:

Remove everything except vacuum_position and path from draw:

Plus you have to define room colors as transparent.

Am I the only person who has this problem with gen 1? Sometimes, quite often, robot is re-drawing walls, doesn’t know if it’s possible to handle this with some parameter?? Any recommendation recommendations welcome.

@3_14 Many thanks, nice job! Enjoying it to a great degree.
I know you said multi-floor is not a priority, but that would make this integration really a well-rounded HA component.

Since installing this (along with the Map Card), my disk usage goes up ~1.2gb per day. Is this expected? I’m only running HA on a 128gb SSD, so in a couple months I’ll be outta space :slight_smile:

Works awesome btw. Loving it.

You can reduce a number of attributes or exclude camera entity from recorder.

Having the same from the start. I tried to find answers on how to prevent it from happening but it all boiled down to: “Get used to it, there’s nothing you can do about it”. Pitty.

Thanks, now I’m fixed.

Hi. Please help me.

  1. My Xiaomi Mi Robot Vacuum Cleaner, model: SDJQR01RR, firmware 3.5.8_004018 when starting a new cleaning, it draws a new map every time and the direction to the North is always different. For this reason, my zone coordinates lose their meaning every time.

  2. On my “Picture Glance Card Configuration” (camera Entity: camera.xiaomi_cloud_map_extractor) the Mode tools are not displayed as shown in the image


    The map itself is displayed. But I can’t send a vacuum cleaner to the point. I can’t set a cleaning zone, etc.
    01

configuration.yaml

camera:

  • platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: [‘all’]
    attributes:
    • calibration_points
    • charger
    • goto
    • goto_path
    • goto_predicted_path
    • image
    • is_empty
    • map_name
    • no_go_areas
    • no_mopping_areas
    • obstacles
    • path
    • room_numbers
    • rooms
    • vacuum_position
    • vacuum_room
    • walls
    • zones
      scan_interval:
      seconds: 10
      auto_update: true
      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: [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]
camera.xiaomi_cloud_map_extractor---State attributes (YAML, optional)

access_token: xxx
calibration_points:

  • vacuum:
    x: 25500
    ‘y’: 25500
    map:
    x: 42
    ‘y’: 93
  • vacuum:
    x: 26500
    ‘y’: 25500
    map:
    x: 62
    ‘y’: 93
  • vacuum:
    x: 26500
    ‘y’: 26500
    map:
    x: 62
    ‘y’: 73
    charger:
    x: 25418
    ‘y’: 25609
    goto: null
    goto_path: null
    goto_predicted_path: null
    image:
    size: 26792
    offset_y: 468
    offset_x: 468
    height: 136
    scale: 1
    rotation: 0
    width: 197
    is_empty: false
    map_name: roboroommap%2F260356747%2F3
    no_go_areas: null
    no_mopping_areas: null
    obstacles: null
    path:
    point_length: 91
    point_size: 4
    angle: 0
    path:
    • x: 25627
      ‘y’: 25600
    • x: 25716
      ‘y’: 25600
    • x: 25690
      ‘y’: 25643
    • x: 25682
      ‘y’: 25724
    • x: 25673
      ‘y’: 25802
    • x: 25611
      ‘y’: 25846
    • x: 25634
      ‘y’: 25831
    • x: 25662
      ‘y’: 25816
    • x: 25630
      ‘y’: 25884
    • x: 25593
      ‘y’: 25951
    • x: 25547
      ‘y’: 25958
    • x: 25479
      ‘y’: 25933
    • x: 25556
      ‘y’: 25928
    • x: 25525
      ‘y’: 25954
    • x: 25468
      ‘y’: 26004
    • x: 25381
      ‘y’: 26024
    • x: 25321
      ‘y’: 25975
    • x: 25225
      ‘y’: 25976
    • x: 25143
      ‘y’: 25956
    • x: 25133
      ‘y’: 25930
    • x: 25140
      ‘y’: 25956
    • x: 25127
      ‘y’: 25921
    • x: 25142
      ‘y’: 25956
    • x: 25135
      ‘y’: 25929
    • x: 25198
      ‘y’: 25956
    • x: 25244
      ‘y’: 26006
    • x: 25306
      ‘y’: 26055
    • x: 25487
      ‘y’: 26062
    • x: 25721
      ‘y’: 26044
    • x: 25910
      ‘y’: 26019
    • x: 26059
      ‘y’: 25960
    • x: 26143
      ‘y’: 25892
    • x: 26029
      ‘y’: 25796
    • x: 25929
      ‘y’: 25707
    • x: 25880
      ‘y’: 25667
    • x: 25833
      ‘y’: 25656
    • x: 25755
      ‘y’: 25641
    • x: 25677
      ‘y’: 25627
    • x: 25616
      ‘y’: 25616
    • x: 25713
      ‘y’: 25615
    • x: 25808
      ‘y’: 25680
    • x: 26033
      ‘y’: 25832
    • x: 26228
      ‘y’: 25961
    • x: 26383
      ‘y’: 26065
    • x: 26572
      ‘y’: 26207
    • x: 26807
      ‘y’: 26391
    • x: 27030
      ‘y’: 26566
    • x: 27251
      ‘y’: 26740
    • x: 27472
      ‘y’: 26915
    • x: 27634
      ‘y’: 27042
    • x: 27738
      ‘y’: 27118
    • x: 27794
      ‘y’: 27159
    • x: 27633
      ‘y’: 27078
    • x: 27386
      ‘y’: 26930
    • x: 27149
      ‘y’: 26776
    • x: 26984
      ‘y’: 26671
    • x: 26804
      ‘y’: 26555
    • x: 26588
      ‘y’: 26372
    • x: 26383
      ‘y’: 26173
    • x: 26182
      ‘y’: 25979
    • x: 26027
      ‘y’: 25830
    • x: 25924
      ‘y’: 25731
    • x: 25872
      ‘y’: 25680
    • x: 25809
      ‘y’: 25661
    • x: 25737
      ‘y’: 25643
    • x: 25662
      ‘y’: 25624
    • x: 25621
      ‘y’: 25614
    • x: 25594
      ‘y’: 25608
    • x: 25622
      ‘y’: 25611
    • x: 25711
      ‘y’: 25612
    • x: 25807
      ‘y’: 25676
    • x: 26033
      ‘y’: 25827
    • x: 26226
      ‘y’: 25956
    • x: 26380
      ‘y’: 26067
    • x: 26572
      ‘y’: 26215
    • x: 26788
      ‘y’: 26405
    • x: 27001
      ‘y’: 26593
    • x: 27211
      ‘y’: 26781
    • x: 27418
      ‘y’: 26966
    • x: 27631
      ‘y’: 27156
    • x: 27826
      ‘y’: 27320
    • x: 27967
      ‘y’: 27441
    • x: 28110
      ‘y’: 27530
    • x: 28300
      ‘y’: 27553
    • x: 28451
      ‘y’: 27622
    • x: 28591
      ‘y’: 27751
    • x: 28705
      ‘y’: 27875
    • x: 28849
      ‘y’: 28009
    • x: 28973
      ‘y’: 28102
    • x: 29035
      ‘y’: 28149
    • x: 29056
      ‘y’: 28165
      room_numbers: []
      rooms: {}
      vacuum_position:
      x: 29056
      ‘y’: 28165
      vacuum_room: null
      walls: null
      zones: null
      friendly_name: Xiaomi Cloud Map Extractor
      entity_picture: >-
      /api/camera_proxy/camera.xiaomi_cloud_map_extractor?token=b3f08d519d0db09fb07a9b5b2d466337dac7399518ac28012a3a38a137df6072
      supported_features: 0
  1. I think my vacuum cleaner doesn’t understand “rooms”. I.e. it doesn’t paint Rooms in different colors. There is no reaction to the launch of the service “xiaomi_miio.vacuum_clean_segment”. I tried segments from 1 to 21.
    Thanks.

Thanks.

  1. There’s no fix for this problem
  2. You have to use this card
  3. Yes, your model doesn’t support rooms

@3_14 excellent work. appreciate it!

an issue which i do not know you’ll be able to fix or not: if the vacuum is not on the dock (i.e. its not charging), it goes to “sleeping” mode as shown in the mi/roborock apps. the official apps are still able to connect to it, however your integration is not. if i bring it out of sleep by briefly starting remote control and then off, your map updates after a while. logs show the integration isn’t able to connect to the vacuum’s IP during that time. I dont know if maybe the apps use UDP or some other method to communicate with the vacuum during its sleep.

minor issue which you should be able to solve quickly:
when i trim the map using the map transformation:

    map_transformation:
      trim:
        top: 15
        bottom: 15
        left: 15
        right: 15

then the defined zones (which are defined by the vacuum’s map coordinates) all shift away from their correct points :slight_smile: if you could get it to honor the trimming percentages and apply those offsets to the zones that’d be great. ps: i defined the zones based on the room coordinates attribute of your integration itself. works perfectly aligned when there’s no trimming.

This integration needs to connect to the vacuum to be able to get data from the Xiaomi cloud. When a vacuum “goes to sleep” it disables WiFi, so it’s impossible to connect to it remotely (Xiaomi cloud must use latest cached map).

Are you sure you have the latest version of the integration? I have fixed the same issue some time ago

xiaomi cloud might be using a cached map, but it is able to wake up the vacuum. Try it yourself - even when vacuum is asleep (shows “sleeping” in the mi app - you can cause this sleep by removing it from dock - say by sending to a target and letting it sit there for some time), you can send it any command and it wakes up. however the map extractor as well as xiaomi vacuum integration doesn’t work during that time.

the trimming bug exists in 1.0.0 (the version i see installed in my HACS)

I use the same library as built-in Xiaomi vacuum integration, so I have the same limitations (my first idea - not tested - is that “normally” vacuum is listening for commands and when it’s “sleeping” it pulls data from the cloud periodically).

Can you create a new issue and provide your configs + screenshots?

created the issue for misplaced zones due to map trimming: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/49

the other one is likely to not bother many people as it happens only when the vacuum is asleep (not docker for a long time) so letting it go…