Roborock Map/Camera is not shown every 24h

Hi,

I have strange problems with my Roborock S7+ for the last 4-6 weeks. I used the Miio integration to display the map of the roborock and this work great for 1 year. In the last 4-6 weeks I have problem with the map. It is often not shown with the message Failed to retrieve map from vacuum. I have the same problem in the Xiaomi app. Sometimes I can get it back to work when restart the roborock.
When I wait 1-2 days the map get back without doing anything, but often the map fetching fails after 1-6h again.

The strange thing is that I can still contact the robot to send it “home”, start cleaning and I can send it custom commands (segments) to clean a specific room.

I have a unifi network with a UDM Pro. I already restarted every AP and switch, but nothing really changed.

Does anybody had similar experience or have some advice?

Greetings
Michael

1 Like

I have notised this myself (Roborock S6+). I also have problems to get it into the phone app (or HA) the same way that you have with the Xiaomi app. I thinking of going back to the Roborock app since we now have proper integration for it.

There are many people reporting this for the third party map extractor camera integration. I think a limit has been put on the number of API calls. If you exceed that limit for the day it stops responding.

2 Likes

Does this also support the camera integration? Do you have any link to the new integration?

Thanks for the answer. Rate-Limiting would make sense, but only for the map?

No sure about the camera, I have not tested it yet but according to the docs it should.

EDIT: No, it should not according to the docs but may be added in the future.

1 Like

It seems that they add the map feature in future versions according to the docs. It seems that I have to patient until this is officially integrated.

1 Like
1 Like

I tried the hint from the linked GitHub issue an after 6 days it works perfect. It is a rate limiting problem which makes sense when you think about it.

Roborock Integration

In the long-run the native roborock integration will be the goal because camera and controls are handle by one integration and can there lower the GET requests to the xiaomi cloud. But there are many missing features right now. I assume 2-3 months to get all the features.

Solution via Automations

Adding 2 automations fix the problem for now and works perfectly (there are some rare edge cases). Here are my 2 automation for the case somebody need this as well.

Increase update of the camera

First increase the update interval scan_interval in your configuration.yaml to ensure that it does not update that often.

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    scan_interval: 14400 # 4 hours, automations make the real update.

Start/Stop Automation

Add following automation. Basically it start and stop the second automation which do the update in a interval.

alias: Start/Stop Xiaomi Fast Scan Interval
description: ""
trigger:
  - platform: state
    entity_id:
      - vacuum.roborock_s7
condition: []
action:
  - if:
      - condition: state
        entity_id: vacuum.roborock_s7
        state: docked
    then:
      - service: automation.turn_off
        data: {}
        target:
          entity_id: automation.update_xiaomi_map_extractor
      - service: homeassistant.update_entity # updatet the card after be in docked state make sure that the last camera image is the one where the roborock is at home
        data: {}
        target:
          entity_id: camera.xiaomi_cloud_map_extractor
    else:
      - service: automation.turn_on
        data: {}
        target:
          entity_id: automation.update_xiaomi_map_extractor
mode: single

Update Automation

Add the following automation which update the camera every 15th second of a mintute (every 60 seconds).

alias: Update Xiaomi Map Extractor
description: ""
trigger:
  - platform: time_pattern
    seconds: "15"
condition: []
action:
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id: camera.xiaomi_cloud_map_extractor
initial_state: "off"
mode: restart

Thanks for the help @Mats789

8 Likes

Great explanation, great workaround! The Xiaomi Map Extractor worked for me until 11am every day, but after that also got the “Failed to retrieve…”. After adding the automation, I can now enjoy the maps again throughout the day. Thanks again!

What an actual hero! Thanks so much mate, not often you can literally just copy and paste and it just works and fixes it. Big ups. Cheers

1 Like

The only thing I changed was to add this extra state to the turn off fast updates condition:

  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: etc...

The vacuum can be stuck in this error state for long periods of time while I am away from home.

1 Like

sorry but how do you guys get the roborock onto Xiaomi servers? I use Roborock app and just tried to download the Mi Home app in which it could see the vacuum but couldnt see that it was turned on. Is there another pathway?

1 Like

another change:

alias: Start/Stop Xiaomi Fast Scan Interval
description: ""
trigger:
  - platform: state
    entity_id:
      - vacuum.roborock_s7
    to:

The null “to:” ensures the automation only triggers on state changes, not attribute changes.

3 Likes

Awesome work @tonka3000 and @tom_l - had been pulling my hair out over this one!

Hmm even with this running my card is now not reloading again, any ideas?

Give it some time. Will take 12h-24h after being already rate limited.

48 hours later and still no good :frowning:

Maybe deactivate the whole integration for a day or so.
Did you increase the scan_interval ?