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.14k stars 121 forks source link

Xiaomi Robot Vacuum-Mop 2S no map image #360

Closed galamarco closed 1 year ago

galamarco commented 1 year ago

Checklist

The problem

Hello, I have an "Xiaomi Robot Vacuum-Mop 2S" and I would like to show the house map in HA but no map is shown. image

My config are:

 camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.6.63
    token: '514175344c6XXXXXXXXXXXXXX'
    username: '+3934404XXXXXXXXXXXXX'
    password: 'XXXXXXXXXXX'
    force_api: dreame
    draw: ['all']
    attributes:
      - calibration_points

I try force_api xiaomi, viomi, roborock and the problem is the same

In developer tool I have this:

image

The image url generated is this:

image

In error log I have this:

Questo errore ha avuto origine da un'integrazione personalizzata.

Logger: homeassistant.helpers.entity
Source: custom_components/xiaomi_cloud_map_extractor/common/vacuum_v2.py:18
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 15:32:59 (146 occurrences)
Last logged: 15:45:20

Update for camera.xiaomi_cloud_map_extractor fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, 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 27, in get_map
    response = self.get_raw_map_data(map_name)
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum.py", line 45, in get_raw_map_data
    map_url = self.get_map_url(map_name)
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum_v2.py", line 18, in get_map_url
    if api_response is None or "result" not in api_response or "url" not in api_response["result"]:
TypeError: argument of type 'NoneType' is not iterable

What version of an integration has described problem?

2.2.0

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

Xiaomi Robot Vacuum-Mop 2S

What version of Home Assistant do you use?

HA 2022.11.1

What type of installation are you running?

Home Assistant Supervised

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.6.63
    token: '514175344c6XXXXXXXXXXXXXX'
    username: '+3934404XXXXXXXXXXXXX'
    password: 'XXXXXXXXXXX'
    force_api: dreame
    draw: ['all']
    attributes:
      - calibration_points

Errors shown in the HA logs (if applicable)

No response

Additional information

No response

PiotrMachowski commented 1 year ago

Duplicate of #200