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

No image when docked #449

Closed tomlut closed 1 year ago

tomlut commented 1 year ago

Checklist

The problem

I have the following camera configurations for my two Roborock S50 vacuums:

- platform: xiaomi_cloud_map_extractor
  name: Upstairs Vacuum
  host: 10.1.1.13
  token: !secret vacuum_token_2
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 3600
  colors:
    color_map_outside: [0, 0, 0, 0]
  map_transformation:
    rotate: 270
  attributes:
    - calibration_points

- platform: xiaomi_cloud_map_extractor
  name: Downstairs Vacuum
  host: 10.1.1.12
  token: !secret vacuum_token_1
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 3600
  colors:
    color_map_outside: [0, 0, 0, 0]
  attributes:
    - calibration_points

I also have an automation that gets more frequent updates when the vacuums are not docked or in the errored state, e.g. for downstairs vac :

- id: bcaf7f1a-c6a6-410e-938b-8d404c0fb0ca
  alias: "Fast Update Downstairs Vacuum Camera"
  trigger:
  - platform: time_pattern
    minutes: "/1"
  action:
  - service: homeassistant.update_entity
    target:
      entity_id: camera.downstairs_vacuum
  initial_state: off
  mode: restart

- id: 39bcf1ba-a3e5-4d95-97a3-90c45369c370
  alias: Start/Stop Downstairs Vacuum Camera Fast Scan Interval
  trigger:
  - platform: state
    entity_id: vacuum.robovac_downstairs
    to:
  action:
  - if:
    - condition: or
      conditions: 
      - condition: state
        entity_id: vacuum.robovac_downstairs
        state: docked
      - condition: state
        entity_id: vacuum.robovac_downstairs
        state: error
    then:
    - service: automation.turn_off
      target:
        entity_id: automation.fast_update_downstairs_vacuum_camera
    - service: homeassistant.update_entity
      target:
        entity_id: camera.downstairs_vacuum
    else:
    - service: automation.turn_on
      target:
        entity_id: automation.fast_update_downstairs_vacuum_camera
  mode: single

When the vacuums are cleaning I see the map. When the vacuums are docked I only get "Failed to retrieve map from vacuum" for the camera image and there are no calibration points and the state is "idle".

At first I thought this was just because of the long update interval in the camera config but when the vacuum is docked if I manually call the homeassistant.update_entity service for either camera this does not change the camera state.

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?

Roborock S50

What version of Home Assistant do you use?

core-2023.6.3

What type of installation are you running?

Home Assistant OS

Camera's configuration

- platform: xiaomi_cloud_map_extractor
  name: Upstairs Vacuum
  host: 10.1.1.13
  token: !secret vacuum_token_2
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 3600
  colors:
    color_map_outside: [0, 0, 0, 0]
  map_transformation:
    rotate: 270
  attributes:
    - calibration_points

- platform: xiaomi_cloud_map_extractor
  name: Downstairs Vacuum
  host: 10.1.1.12
  token: !secret vacuum_token_1
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 3600
  colors:
    color_map_outside: [0, 0, 0, 0]
  attributes:
    - calibration_points

Errors shown in the HA logs (if applicable)

No response

Additional information

No response

tomlut commented 1 year ago

Oh, additionally, the map is visible in the Mi Home App when the vacuums are docked.

tomlut commented 1 year ago

And it is working again. Why?

I have no idea.

PiotrMachowski commented 1 year ago

It's a Xiaomi thing I guess...