Xiaomi Cloud Vacuum Map Extractor

I just updated. UI configuration is very easy. Thank you.

But Roborock S6 map wont be load. Do I need continue to use “Robrock map reloader” blueprint / automation?

No, the blueprint won’t work with v3 version - it should not be needed at all. Does the map work in Xiaomi Home? Could you please also share logs from HA?

I am not familiar with logging. But map works in android Roborock app.

This gives you some info?

Logger: custom_components.xiaomi_cloud_map_extractor.connector.vacuums.base.vacuum_base
Source: custom_components/xiaomi_cloud_map_extractor/connector/vacuums/base/vacuum_base.py:83
integration: Xiaomi Cloud Map Extractor (documentation, issues)
First occurred: 15:02:45 (4 occurrences)
Last logged: 15:04:40

FailedMapDownloadException

Wait a second…

But map works in android Roborock app.

This integration doesn’t work when you use Roborock app.

So i have to log out in app or delete device inside app?

Your vacuum has to be added to Xiaomi Home integration for Map Extractor to work.
But if Roborock app works for you then you should just use the built-in Roborock integration

Sorry, I got confused. I actually use the Xiaomi Home app and not Roborock.
Only map wont load. Other functions works fine.

2025-02-13 15_49_09-Dwains Dashboard – Home Assistant

2025-02-13 15_53_33-Settings – Home Assistant

Ok, so the map works in Xiaomi Home, correct? Can you enable debug logging and check HA logs again?

Yes in Xiamo Home it works.

I enabled debug logging and when I check logs there was those errors. I don’t understand this logging because when I watch other people logs then there is more detailed info :grinning:

Logger: py.warnings
Source: components/xiaomi_miio/init.py:12
First occurred: 16:36:32 (1 occurrences)
Last logged: 16:36:32

/usr/local/lib/python3.13/site-packages/miio/miot_device.py:23: FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in enum.member() if you want to preserve the old behavior Bool = partial(_str2bool)

Logger: homeassistant.bootstrap
Source: bootstrap.py:756
First occurred: 16:37:31 (1 occurrences)
Last logged: 16:37:31

Waiting on integrations to complete setup: {(‘xiaomi_cloud_map_extractor’, ‘01JKZ1YKR0VGD0WAFTFE0FJF22’): 1037941.986112205}

Logger: custom_components.xiaomi_cloud_map_extractor.connector.vacuums.base.vacuum_base
Source: custom_components/xiaomi_cloud_map_extractor/connector/vacuums/base/vacuum_base.py:83
integration: Xiaomi Cloud Map Extractor (documentation, issues)
First occurred: 16:38:03 (3 occurrences)
Last logged: 16:38:52

FailedMapDownloadException

Yeah, it would be better to look at the log file directly.
It is available in /config/home-assistant.log

I made Roborock robot vacuum restart few hours ago and then after restart no map at all.
Now i turned Roborock robot vacuum off and about 1 hour later turned on again. And now i get partial map.


I tried pin & go and map is updating when robot moves.

Here are log after i turn this on after 1 hours being off.

Logger: custom_components.xiaomi_cloud_map_extractor.coordinator
Source: helpers/update_coordinator.py:380
integration: Xiaomi Cloud Map Extractor (documentation, issues)
First occurred: 18:54:20 (282 occurrences)
Last logged: 20:04:35

Unexpected error fetching xiaomi_cloud_map_extractor data
Traceback (most recent call last):
File “/config/custom_components/xiaomi_cloud_map_extractor/connector/vacuums/vacuum_roborock.py”, line 54, in should_update_map
code = self._vacuum.status().state_code
~~~~~~~~~~~~~~~~~~~^^
File “/usr/local/lib/python3.13/site-packages/miio/click_common.py”, line 184, in _wrap
return func(self, *args, **kwargs)
File “/usr/local/lib/python3.13/site-packages/miio/integrations/vacuum/roborock/vacuum.py”, line 406, in status
return VacuumStatus(self.send(“get_status”)[0])
~~~~~~~~~^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/site-packages/miio/device.py”, line 107, in send
return self._protocol.send(
~~~~~~~~~~~~~~~~~~~^
command, parameters, retry_count, extra_parameters=extra_parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/local/lib/python3.13/site-packages/miio/miioprotocol.py”, line 161, in send
self.send_handshake()
~~~~~~~~~~~~~~~~~~~^^
File “/usr/local/lib/python3.13/site-packages/miio/miioprotocol.py”, line 74, in send_handshake
raise DeviceException(“Unable to discover the device %s” % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.25.171

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 380, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 281, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/xiaomi_cloud_map_extractor/coordinator.py”, line 35, in update_data
return await self.connector.get_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/xiaomi_cloud_map_extractor/connector/init.py”, line 63, in get_data
if self._should_get_map():
~~~~~~~~~~~~~~~~~~~~^^
File “/config/custom_components/xiaomi_cloud_map_extractor/connector/init.py”, line 112, in _should_get_map
return self._map_cache is None or self._vacuum_connector is None or self._vacuum_connector.should_update_map
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/xiaomi_cloud_map_extractor/connector/vacuums/vacuum_roborock.py”, line 79, in should_update_map
if “token” in de:
^^^^^^^^^^^^^
TypeError: argument of type ‘DeviceException’ is not iterable

Ok, I have to handle this exception more gracefully :+1:

Regarding the map:
It looks a bit wild, does it still look this way? If so, can you download diagnostic data from the integration and send it to me in a private message?

Oh i dont know what just happened. I reinstalled xiaomi map reloder and then map was all good.

When I submitted my image size parameters then map goes wild like previously I showed.
Scale 1 worked correctly. But 2 and above goes crazy and then I tried scale 10 and suddenly It trys to reconnect HA.

I just don’t know what happed but mini PC where HA is installed turns on but cant get connections to HA.

OMG :grinning:

You shouldn’t really go above 4 with image scale, unless your map is really microscopical. It drastically increases resources usage.

Does dreame.vacuum.p2140p supported? I see dreame.vacuum.p2140 in supported devices and I don’t know if it’s same. For me (for dreame.vacuum.p2140p) this integration doesn’t work. I have this error:

2025-03-01 12:11:25.205 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.xiaomi_cloud_map_extractor fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1320, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 291, in update
    self._handle_map_data(self._map_name)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 362, in _handle_map_data
    map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts,
                           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                self._sizes, self._image_config, store_map_path)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum.py", line 36, in get_map
    map_data = self.decode_map(response, colors, drawables, texts, sizes, image_config)
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/vacuum.py", line 24, in decode_map
    return MapDataParserDreame.decode_map(raw_map_string, colors, drawables, texts, sizes, image_config)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/map_data_parser.py", line 51, in decode_map
    unzipped = zlib.decompress(base64.decodebytes(raw_map_string.encode("utf8")))
zlib.error: Error -3 while decompressing data: incorrect header check

Here is raw map data:

GnHn/Vml6jQjgeIJKqHZvOtNERQfDfF6MNvC11A9alESu0YKMIPeASQEsAC3inqEdAAs3EmCV/3uqimObPu3zvFC1ZBwg32kcSnRcQdTK7HJITF8BNb/W7aXrUJ1Cfz4lwFMK4tDPM7qfhOze1K4ZFMDwGDLGE+qBL6s7AxvNvtNq0ZoghmVLtB1E20gTPxBrQPBUynKEtzGnDzNQ3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ZnTT11oyr0PpcX+WotGc0L9KBDzlT8naYLWNsaUSH5JoeX6qyTjr5RaIAgW4JmtoOm4MkeaTtuyA8gGw3oGCRdnNj97re48Vdzhy6wyZl1fyvhGJCd8/6tf96lWfjlkZ8R+AbqVF5q7qhxDAcTrIVc1B8OA74=

The configuration:

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.xxx.xxx
    token: xxxxxxxxxxxxxxxxxxx
    username: xxxxxxxxxxxxxx
    password: xxxxxxxxxxxxxxxx
    country: ru
    draw: ['all']
    attributes:
      - calibration_points
    store_map_raw: true
    force_api: dreame # same result with and without this option

I hope this can help to fix support for this device

Can you try the latest alpha version of the integration?