Xiaomi_miio integration losts connection with vacuum

Hi, I have a strange problem with my HA (core version) and xiaomi_miio integration. I use this integration with my mirobot vacuum. After some amount of time, I cannot use any service of vacuum but I can still see proper vacuum status and I have full acces to vacuum by mi home application (so I suppose that’s not AP problem). When problem occurs in configuration>integration panel I see that the vacuum integration frame changes its colour to yellow. Deleting vacuum integration from integration panel and HA restart helps for some time, but the problem keeps coming back eventually.

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

vacuum:
  - platform: xiaomi_miio
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    name: MiRobot
    max_check_attempts: 3
    retry_interval: 1m

shell_command:
  restart_rpi: /myScripts/rebootRPI.sh 

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
    draw: ['all']
    scan_interval: 60
    attributes:
      - calibration_points    
      - vacuum_position

Ramka

same problem here

Hi
i found a solution and now it seems working

Hi,
I tested it shortly, but it seems to work. Thanks!