Xiaomi Cloud Vacuum Map Extractor

Thanks Piotr

This is my issue log, any suggestions?

image

What vacuum model do you have? (In “dotted” format - e.g. roborock.vacuum.a19)

Thank you very much mate!!!

Hi there

Is this model supported : Mi Robot Vacuum-Mop P / viomi.vacuum.v8 / STYTJ02YM ?

I am getting the following in the logs:

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py:243
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 11:59:47 (237 occurrences)
Last logged: 12:19:26

Update for camera.xiaomi_cloud_map_extractor fails

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 515, in async_update_ha_state await self.async_device_update() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 718, in async_device_update await task File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run result = self.fn(*self.args, **self.kwargs) File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 278, in update self._handle_map_data(map_name) File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 335, in _handle_map_data map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts, 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/viomi/vacuum.py”, line 23, in decode_map return MapDataParserViomi.parse(unzipped, colors, drawables, texts, sizes, image_config) File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 86, in parse MapDataParserViomi.parse_section(buf, ‘unknown2’, map_id) File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 243, in parse_section raise ValueError( ValueError: error parsing section unknown2 at offset 0xcd33c: magic check failed. Magic: 0x21000f4, Map ID: 0x0

Yes, it is. There seems to be an unknown point on your map, it should disappear after a full cleaning.

Thank you for the reply. Do you mean I should start the vacuum, let it run and the map will then update ?

Yes, it should

Hi

I started the vacuum several times and let it run. I am still not able to get the map displayed.

any help/guidance will be much appreciated.

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py:204
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 13:34:57 (206 occurrences)
Last logged: 13:52:10

Update for camera.xiaomi_cloud_map_extractor fails

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 515, in async_update_ha_state await self.async_device_update() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 718, in async_device_update await task File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run result = self.fn(*self.args, **self.kwargs) File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 278, in update self._handle_map_data(map_name) File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 335, in _handle_map_data map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts, 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/viomi/vacuum.py”, line 23, in decode_map return MapDataParserViomi.parse(unzipped, colors, drawables, texts, sizes, image_config) File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 62, in parse map_data.zones = MapDataParserViomi.parse_cleaning_areas(buf) File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 204, in parse_cleaning_areas zones.append(Zone(p1.x, p1.y, p3.x, p3.y)) AttributeError: ‘NoneType’ object has no attribute ‘x’

Have you used zone cleaning?

No, I have not. I just select/touch the normal play/start cleaning button.

Should I try ZONE CLEANING ? (Will I be able to do that since no map is displayed to select a zone ?)

I removed the vacuum integration, map extractor and vacuum card.

I then re-installed the vacuum integration: Viomi Vacuum V8 by @tykarol

Then re-installed the latest Xiaomi Cloud Map Extractor (today’s update).

I am able to control the vacuum but still the map does not update.

Any advice please ?

Thank you

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py:204
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 10:39:52 (165 occurrences)
Last logged: 11:05:31

Update for camera.xiaomi_cloud_map_extractor fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 515, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 710, in async_device_update
raise exc
File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 278, in update
self._handle_map_data(map_name)
File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 335, in _handle_map_data
map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts,
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/viomi/vacuum.py”, line 23, in decode_map
return MapDataParserViomi.parse(unzipped, colors, drawables, texts, sizes, image_config)
File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 62, in parse
map_data.zones = MapDataParserViomi.parse_cleaning_areas(buf)
File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 204, in parse_cleaning_areas
zones.append(Zone(p1.x, p1.y, p3.x, p3.y))
AttributeError: ‘NoneType’ object has no attribute ‘x’

You can replace /config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py file with this version, but it might not fully solve your problem.

Thank you - I did replace that file and restarted HA but unfortunately same result.

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py:244
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 11:36:13 (72 occurrences)
Last logged: 11:42:08

Update for camera.xiaomi_cloud_map_extractor fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 515, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 718, in async_device_update
await task
File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 278, in update
self._handle_map_data(map_name)
File “/config/custom_components/xiaomi_cloud_map_extractor/camera.py”, line 335, in _handle_map_data
map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts,
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/viomi/vacuum.py”, line 23, in decode_map
return MapDataParserViomi.parse(unzipped, colors, drawables, texts, sizes, image_config)
File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 86, in parse
MapDataParserViomi.parse_section(buf, ‘unknown2’, map_id)
File “/config/custom_components/xiaomi_cloud_map_extractor/viomi/map_data_parser.py”, line 244, in parse_section
raise ValueError(
ValueError: error parsing section unknown2 at offset 0x9e1cd: magic check failed. Magic: 0x700c00fe, Map ID: 0x0

Actually this is a different result :wink: this one requires some more work to handle.

Generally speaking your map should be fine after a few full cleanings, so your problem might disappear before I will fix it.

Great - thank you very much for all the help!

Trying to get it to work with a Xiaomi Mi Mop-2 Lite - ijai.vacuum.v10
But I keep getting this message:

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
    store_map_raw: true
    store_map_image: true
    store_map_path: "/tmp"

I can use control the vacuum from HA with a vacuum card.
Is it possible for it to even work?

Unfortunately ijai vacuums are not supported at this moment

1 Like

Damn. I missed that. Thank you! :slight_smile:

I’m not sure if your vacuum/app work the same as mine (2x Roborock vacs, Xiaomi Home app), but I thought I’d just cover of something basic. Have you enabled Map Saving in the vacuum app? For mine, this isn’t enabled by default, and if your vacuum is new to you, you may have overlooked it.

I think that the problem is a little bit different here. Viomi map in Map Extractor has some cases when data is unknown and it sometimes breaks parsing. Usually it sorts itself out after a few full cleanings