Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYJ02YM map extraction issue when vacuum decides to create a new map draft #562

Open
2 tasks done
Acrobot opened this issue Oct 27, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@Acrobot
Copy link

Acrobot commented Oct 27, 2024

Checklist

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

The problem

The camera has suddenly stopped working, the last thing I did was add the rooms attribute to the configuration and extracted the rooms using the Vacuum Map Card. After a restart (and update to Hass 2024.10.4 from 10.3) I am met with a flood of errors. Removing the rooms attribute does not seem to help anymore.

What version of an integration has described problem?

v2.2.1

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

viomi.vacuum.v8

What version of Home Assistant do you use?

2024.10.4

What type of installation are you running?

Home Assistant OS

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.1.13
    token: !secret miio2_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    map_transformation:
      scale: 3
      trim:
        left: 30
        right: 45
        top: 40
        bottom: 40
    draw: ['all']
    attributes:
      - calibration_points
      - rooms

Errors shown in the HA logs (if applicable)

Rejestrator: homeassistant.helpers.entity
Źródło: helpers/entity.py:942
Pierwsze zdarzenie: 14:44:28 (32 zdarzenia)
Ostatnio zalogowany: 14:47:02

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

Additional information

No response

@Acrobot Acrobot added the bug Something isn't working label Oct 27, 2024
@Acrobot
Copy link
Author

Acrobot commented Oct 27, 2024

I have debugged the issue, so in fact it was caused by the robot vacuum automatically creating a new map in the app since it restarted mid-cleaning. I'm changing the name of this issue to reflect that (since we should handle it more gracefully).

@Acrobot Acrobot changed the title STYJ02YM map extraction issue STYJ02YM map extraction issue when vacuum decides to create a new map draft Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants