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

State attributes exceed maximum size #427

Closed luzik closed 1 year ago

luzik commented 1 year ago

Checklist

The problem

My logs are full of

WARNING (Recorder) [homeassistant.components.recorder.db_schema] State attributes for camera.xiaomi_cloud_map_extractor exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

But integration seams to work ok

What version of an integration has described problem?

latests

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

roidmi eve

What version of Home Assistant do you use?

lastest

What type of installation are you running?

Home Assistant Container

Camera's configuration

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
      force_api: roidmi
      draw: ['all']
      attributes:
        - calibration_points
        - charger
        - goto
        - goto_path
        - goto_predicted_path
        - image
        - map_name
        - obstacles
        - path
        - room_numbers
        - rooms
        - vacuum_position
        - vacuum_room
        - walls
        - zones

Errors shown in the HA logs (if applicable)

No response

Additional information

No response

PiotrMachowski commented 1 year ago

Use following config instead:

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
      force_api: roidmi
      draw: ['all']
      attributes:
        - calibration_points
dmiales commented 1 year ago

same, please fix

PiotrMachowski commented 1 year ago

The problem is with your config, not the code of the integration. It will be gone after changing to the config I have provided above

dmiales commented 1 year ago

Well, the configuration above removes important functions? ex attributes: image, rooms and more

PiotrMachowski commented 1 year ago

Do you use these attributes? You can leave them if you do, just remove path attribute - this is the one that usually causes problems

dmiales commented 1 year ago

oh, path is an imposter! Thanks!

PiotrMachowski commented 1 year ago

Path can consists of thousands of points, so it can be problematic. Generally speaking you should remove all attributes you don't use