rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
382 stars 73 forks source link

Motion detection (also Smart) #281

Open stefanoferrario opened 1 year ago

stefanoferrario commented 1 year ago

After last update Motion detection works correctly only at the first alarm and then no more. I'm not able to find out which is the problem.

stefanoferrario commented 1 year ago

The log is full of this messages

2023-06-03 07:07:26.221 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect 2023-06-03 07:07:26.224 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/configManager.cgi?action=getConfig&name=Lighting[9][0] 2023-06-03 07:07:26.228 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage 2023-06-03 07:07:26.230 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/coaxialControlIO.cgi?action=getStatus&channel=1 2023-06-03 07:07:26.232 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDetect 2023-06-03 07:07:26.234 WARNING (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.188.53. See README to enable debug logs to get full exception 2023-06-03 07:07:26.235 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.188.53 Traceback (most recent call last): File "/config/custom_components/dahua/__init__.py", line 341, in _async_update_data_int results = await asyncio.gather(*coros) File "/config/custom_components/dahua/client.py", line 233, in async_get_config_motion_detection return await self.async_get_config("MotionDetect") File "/config/custom_components/dahua/client.py", line 200, in async_get_config return await self.get(url) File "/config/custom_components/dahua/client.py", line 767, in get raise exception File "/config/custom_components/dahua/client.py", line 746, in get response = await auth.request("GET", url) File "/config/custom_components/dahua/digest.py", line 46, in request response = await self.session.request(method, url, headers=headers, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 400, in _request raise RuntimeError("Session is closed") RuntimeError: Session is closed 2023-06-03 07:07:26.236 DEBUG (MainThread) [custom_components.dahua] Closing Session 2023-06-03 07:07:26.237 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.020 seconds (success: False) 2023-06-03 07:07:26.255 WARNING (MainThread) [custom_components.dahua] Exception fetching information from https://192.168.188.53:443/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode 2023-06-03 07:07:26.257 DEBUG (MainThread) [custom_components.dahua] Could not get profile mode Traceback (most recent call last): File "/config/custom_components/dahua/__init__.py", line 312, in _async_update_data_int mode_data = await self.client.async_get_video_in_mode() File "/config/custom_components/dahua/client.py", line 546, in async_get_video_in_mode return await self.get(url) File "/config/custom_components/dahua/client.py", line 767, in get raise exception File "/config/custom_components/dahua/client.py", line 746, in get response = await auth.request("GET", url) File "/config/custom_components/dahua/digest.py", line 46, in request response = await self.session.request(method, url, headers=headers, **kwargs) File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 400, in _request raise RuntimeError("Session is closed") RuntimeError: Session is closed