Closed bdraco closed 1 week ago
Hey there @flacjacket, mind taking a look at this pull request as it has been labeled with an integration (amcrest
) you are listed as a code owner for? Thanks!
It turns out I had one in storage in the ONVIF box
These are really noisy when they go offline
2024-05-05 15:40:13.472 ERROR (MainThread) [homeassistant.components.amcrest.binary_sensor] Could not update Amcrest Camera Audio Detected binary sensor due to error: CommError
2024-05-05 15:40:14.270 DEBUG (MainThread) [homeassistant.components.amcrest.camera] Updating Amcrest Camera camera
2024-05-05 15:40:15.291 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:15.703 WARNING (MainThread) [homeassistant.helpers.update_coordinator] First refresh for openweathermap failed, retrying: success=False last_exception=Invalid API Key provided
2024-05-05 15:40:16.370 DEBUG (MainThread) [homeassistant.components.amcrest.binary_sensor] Updating Amcrest Camera Audio Detected binary sensor
2024-05-05 15:40:19.238 DEBUG (MainThread) [homeassistant.components.amcrest.camera] Take snapshot from Amcrest Camera
2024-05-05 15:40:19.238 DEBUG (MainThread) [homeassistant.components.amcrest.camera] Waiting for previous snapshot from Amcrest Camera
2024-05-05 15:40:20.327 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:20.328 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:20.328 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:20.328 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:20.329 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:20.329 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:21.343 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 5
2024-05-05 15:40:21.343 ERROR (MainThread) [homeassistant.components.amcrest.camera] Could not get image from Amcrest Camera camera due to error: CommError
2024-05-05 15:40:21.344 ERROR (MainThread) [homeassistant.core] async_create_task with <coroutine object AmcrestCam._async_get_image at 0x36e4f7880> (None)
2024-05-05 15:40:21.371 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating amcrest binary_sensor took longer than the scheduled update interval 0:00:05
2024-05-05 15:40:22.422 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:24.270 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.amcrest_camera is taking over 10 seconds
2024-05-05 15:40:26.370 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.amcrest_camera_audio_detected is taking over 10 seconds
2024-05-05 15:40:26.371 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating amcrest binary_sensor took longer than the scheduled update interval 0:00:05
2024-05-05 15:40:26.383 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 6
2024-05-05 15:40:26.383 ERROR (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera offline: Too many errors
2024-05-05 15:40:26.390 DEBUG (MainThread) [homeassistant.components.amcrest.binary_sensor] Updating Amcrest Camera Online binary sensor
2024-05-05 15:40:26.394 ERROR (MainThread) [homeassistant.core] async_create_task with <coroutine object Entity.async_update_ha_state at 0x3712a3880> (Entity schedule update ha state camera.amcrest_camera)
2024-05-05 15:40:26.396 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 7
2024-05-05 15:40:26.396 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 8
2024-05-05 15:40:26.396 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 9
2024-05-05 15:40:26.396 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 10
2024-05-05 15:40:26.396 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 11
2024-05-05 15:40:26.397 ERROR (MainThread) [homeassistant.components.amcrest.camera] Could not get Amcrest Camera camera attributes due to error: CommError
2024-05-05 15:40:27.397 WARNING (MainThread) [amcrest.http] <AMC058E4_22D5C1:AMC058E46C1C22D5C1> Trying again due to error: ConnectTimeout('')
2024-05-05 15:40:28.475 DEBUG (MainThread) [homeassistant.components.amcrest] Amcrest Camera camera errs: 12
2024-05-05 15:40:28.475 ERROR (MainThread) [homeassistant.components.amcrest.binary_sensor] Could not update Amcrest Camera Audio Detected binary sensor due to error: CommError
2024-05-05 15:40:29.239 DEBUG (MainThread) [homeassistant.components.amcrest.camera] Take snapshot from Amcrest Camera
2024-05-05 15:40:29.239 WARNING (MainThread) [homeassistant.components.amcrest.camera] Attempt to take snapshot when Amcrest Camera camera is offline
online works
offline works
comes back online ok as well
No more thread safety issue with asyncio debug turned on and Home Assistant debug turned on
Thanks a lot for the quick fix @bdraco, I can confirm it fixes the issue mentioned in #116850.
Proposed change
I do not have a way to test this. Please carefully double check this fix.
amcrest
calledasync_dispatcher_send
from a threadfixes #116850
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: