Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Always warning on update over x seconds #236

Open
sasukebinbin opened this issue Feb 3, 2022 · 9 comments
Open

Always warning on update over x seconds #236

sasukebinbin opened this issue Feb 3, 2022 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@sasukebinbin
Copy link

sasukebinbin commented Feb 3, 2022

Always receive 2 msg below

Updating xiaomi_cloud_map_extractor camera took longer than the scheduled update interval 0:00:05
Update of camera.xiaomi_cloud_map_extractor is taking over 10 seconds

@Mick51
Copy link

Mick51 commented Feb 8, 2022

Screenshot_20220208-234837_Home Assistant
`Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:719
Integration: Caméra (documentation, issues)
First occurred: 21:54:41 (36 occurrences)
Last logged: 23:43:29

Updating xiaomi_cloud_map_extractor camera took longer than the scheduled update interval 0:00:05`

@elad-bar
Copy link

any update on that issue?
map is being sampled every 10 seconds, when device is not connected having the error appear in logs will not assist anything,
I think that the code that samples the cloud or device should continue sample it the same but without relation to the camera component, meaning it should be isolated to some kind of coordinator which will do the fetch data, while camera component is just taking the last state from the coordinator,
can you please fix it?

thanks

@PiotrMachowski
Copy link
Owner

@elad-bar won't the coordinator cause similar entries in logs?

@PiotrMachowski PiotrMachowski self-assigned this May 24, 2022
@PiotrMachowski PiotrMachowski added the enhancement New feature or request label May 24, 2022
@elad-bar
Copy link

@PiotrMachowski the warning messages are part of the base component, meaning if there is no response in {scan_interval}, it will throw message - every time it tries to update,
with the coordinator, you control which message to throw, so essentially, you can write it once to log when the status is being changed from avialable to not avialble.
In addition, the coordinator is holding the state, meaning the camera component will not need to wait for response, it will return the latest stored in the coordinator.

@PiotrMachowski
Copy link
Owner

Yeah, but coordinator also is refreshed automatically using some interval, so it might log something automatically as well. I have used this approach in other integrations, but they didn't have such problems

@elad-bar
Copy link

right, but you can catch the exception and only log it if previous state was different

@elad-bar
Copy link

Please review the PR (#289)

Separation between the camera component and data provider

  • Add vacuum manager to handle all the logic
  • Camera component will use the latest state of the vacuum manager
  • Map status to log messages - every time status is being changed, it will be logged accordingly, no need to call logger
  • Map device to handlers instead of IF statement

@tomlut
Copy link

tomlut commented Jul 1, 2022

For some reason this has become much more of an isuue after updating to the core-2022.7.0b0 beta version.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:712
First occurred: 12:37:06 (2 occurrences)
Last logged: 12:40:12

Update of camera.upstairs_vacuum is taking over 10 seconds
Update of camera.downstairs_vacuum is taking over 10 seconds
------
This error originated from a custom integration.

Logger: custom_components.xiaomi_cloud_map_extractor.camera
Source: custom_components/xiaomi_cloud_map_extractor/camera.py:356
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 12:05:02 (10 occurrences)
Last logged: 13:58:02

Unable to retrieve map data

There does not seem to be an issue with the cameras though:

Screenshot 2022-07-01 at 14-04-15 Administration – Home Assistant

cameras.yaml

- platform: xiaomi_cloud_map_extractor
  name: Upstairs Vacuum
  host: 10.1.1.13
  token: !secret vacuum_token_2
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 60
  colors:
    color_map_outside: [0, 0, 0, 0]
  map_transformation:
    rotate: 270
  attributes:
    - calibration_points

- platform: xiaomi_cloud_map_extractor
  name: Downstairs Vacuum
  host: 10.1.1.12
  token: !secret vacuum_token_1
  username: !secret vacuum_user
  password: !secret vacuum_passwd
  draw: ['all']
  auto_update: true
  scan_interval:
    seconds: 60
  colors:
    color_map_outside: [0, 0, 0, 0]
  attributes:
    - calibration_points

@snel6424
Copy link

snel6424 commented Aug 24, 2022

I am also having this issue, has anyone found a fix for it? It doesnt actually seem to be negatively affecting anything though.

`Logger: homeassistant.helpers.entity
Source: helpers/entity.py:514
First occurred: 3:55:41 AM (44 occurrences)
Last logged: 7:30:25 AM

Update of camera.xiaomi_cloud_map_extractor is taking over 10 seconds`

cameras.yaml

  • platform: xiaomi_cloud_map_extractor
    host: !secret janet_host
    token: !secret janet_token
    username: !secret roborock_username
    password: !secret roborock_password
    draw: ["all"]
    attributes:
    - calibration_points
    map_transformation:
    rotate: 180

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants