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

Increased CPU usage on Home Assistant OS after adding yaml config #442

Closed nightshadow931 closed 1 year ago

nightshadow931 commented 1 year ago

Checklist

The problem

So, after I add the config to my configuration.yaml and restart my home assistant, CPU usage jumps from about 7-9% to around 16-20%. The config works, I can see the map, there are no errors in the log. When I comment out my config and restart home assistant again, everything goes back to normal image You can see what I'm talking about from the picture.

What version of an integration has described problem?

v2.2.0

What was the last working version of an integration?

/

What vacuum model do you have problems with?

Xiaomi Mi Mop 2 Pro+(think it's dreame.vacuum.p2041o)

What version of Home Assistant do you use?

Home Assistant 2023.6.0

What type of installation are you running?

Home Assistant OS

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: 192.168.1.9
    token: longtoken
    username: myemail
    password: mypassword
    draw: ['all']
    name: "Boza"
    attributes:
      - calibration_points

Errors shown in the HA logs (if applicable)

No response

Additional information

No response

PiotrMachowski commented 1 year ago

This is an expected situation. This integration has to download, decompress, process and render the map pixel by pixel every 5s, so it's natural that it consumes resources to do it

nightshadow931 commented 1 year ago

That makes sense if the robot is running, but why would it do it every 5s in idle state?

PiotrMachowski commented 1 year ago

The integration doesn't retrieve information about vacuums state, if you want to update the map only when the vacuum is running you can use this blueprint