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