PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor

This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
MIT License
1.13k stars 122 forks source link

Unable to load the map #420

Closed StayPirate closed 1 year ago

StayPirate commented 1 year ago

Checklist

The problem

Description

I followed the instruction, but I'm not able to see the map. Instead I get the following string printed camera_image

image

What version of an integration has described problem?

v2.2.0

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

dreame.vacuum.r2228o

What version of Home Assistant do you use?

Home Assistant 2023.3.6

What type of installation are you running?

Home Assistant Supervised

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 172.16.5.5
    token: *************************
    username: *******@protonmail.com
    password: **********************
    country: de
    draw: ["all"]
    attributes:
      - calibration_points

Errors shown in the HA logs (if applicable)

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/dreame/image_handler.py:81
Integration: xiaomi_cloud_map_extractor ([documentation](https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor), [issues](https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues))
First occurred: 15:33:45 (433 occurrences)
Last logged: 16:14:05
Update for camera.xiaomi_cloud_map_extractor fails

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 739, 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/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 52, in decode_map
    return MapDataParserDreame.parse(unzipped, colors, drawables, texts, sizes, image_config, map_data_type)
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/map_data_parser.py", line 80, in parse
    rism_map_data = MapDataParserDreame.decode_map(
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/map_data_parser.py", line 52, in decode_map
    return MapDataParserDreame.parse(unzipped, colors, drawables, texts, sizes, image_config, map_data_type)
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/map_data_parser.py", line 75, in parse
    map_data.image, map_data.rooms = MapDataParserDreame.parse_image(image_raw, header, colors, image_config,
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/map_data_parser.py", line 154, in parse_image
    image, image_rooms = ImageHandlerDreame.parse(image_raw, header, colors, image_config, map_data_type)
  File "/config/custom_components/xiaomi_cloud_map_extractor/dreame/image_handler.py", line 81, in parse
    default = ImageHandler.ROOM_COLORS[segment_id >> 1]
IndexError: list index out of range

Additional information

Apart from the map, the buttons properly work.

StayPirate commented 1 year ago

dreame.vacuum.r2228o is the Dreame L10s Ultra, and I don't see it listed in the supported devices. Maybe that's the problem? If yes, is there anything I can provide/do to help with its integration?

PiotrMachowski commented 1 year ago

This issue is a duplicate of #335 You can find a temporary quick fix there as well

StayPirate commented 1 year ago

Thanks, I close this one as duplicate.

StayPirate commented 1 year ago

@PiotrMachowski I think you can safely add dreame.vacuum.r2228o AKA Dreame L10s Ultra to the list of the supported devices.

PiotrMachowski commented 1 year ago

Have the fix worked for you?

StayPirate commented 1 year ago

yes, as I wrote at https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/335#issuecomment-1490712307 I had to edit a different file compare to the one shown at https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/335#issuecomment-1420129698.

I see you mentioned that a fix was on the way (https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/335#issuecomment-1420124466), do you have an ETA for the next release?

PiotrMachowski commented 1 year ago

There's no specific ETA, right now I work on the Map Card, then I will move to Map Extractor