Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor icon indicating copy to clipboard operation
Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor copied to clipboard

Error on unpack map file

Open krisproger opened this issue 2 years ago • 7 comments

Checklist

  • [X] I have updated the integration to the latest version available
  • [X] I have checked if the problem is already reported

The problem

Error in parsing map file header

What version of an integration has described problem?

v2.2.1

What was the last working version of an integration?

none

What vacuum model do you have problems with?

Mijia Omni Robot Vacuum Mop

What version of Home Assistant do you use?

11.1

What type of installation are you running?

Home Assistant OS

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.1.137
    name: "Mijia Omni Robot Vacuum-Mop"
    store_map_raw: true
    store_map_path: /config
    token: !secret xiaomi_mirobot_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    country: "cn"
    draw: ["all"]
    attributes:
      - calibration_points

Errors shown in the HA logs (if applicable)

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:696
First occurred: 12:33:01 (2319 occurrences)
Last logged: 15:49:33

Update for camera.mijia_omni_robot_vacuum_mop fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 696, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.11/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/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

Additional information

map files in base64 and bin here: https://teplitzky.ru/tmp/mop.tar

krisproger avatar Nov 04 '23 09:11 krisproger

I have the same issue

deblynprado avatar Nov 14 '23 15:11 deblynprado

Same error here with Xiaomi Robot Vacuum S10+

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.1.158
    token: !secret xiaomi_mirobot_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    attributes:
      - calibration_points

Log: 2023-11-20 07:57:40.112 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.xiaomi_cloud_map_extractor f ails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 696, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.11/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/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

hoffmannzs avatar Nov 20 '23 06:11 hoffmannzs

Just chiming in ... i was prepared to say here : "Me too!" ... but i relalized my vacuum was offline ... putting it back online fixed the issue, thus it might be related to network extracting issue or else.... maybe this could help some other people :)

(maybe it's not 100% of the reports here ofc)

eMerzh avatar Mar 14 '24 21:03 eMerzh

Mine is online, I can turn on/off via HA, but the map still doesn't work

deblynprado avatar Apr 25 '24 19:04 deblynprado

Same problem with Xiaomi Robot Vacuum X10+(dreame.vacuum.p2114a), both on latest version and 2.2.0

Maudfer avatar Jul 01 '24 06:07 Maudfer

Same with dreame.vacuum.p2114o

shoguevara avatar Aug 14 '24 15:08 shoguevara