dahua: Failed to sync device state - 0.9.63
Good morning,
I’ve experienced an issue with two out of ten cameras since upgrading from 0.9.62 to version 0.9.63. The cameras worked fine on version 0.9.62. Reverting back to 0.9.62 allowed the cameras to connect properly again. It appears something changed between the two versions?
HA - Version: 2024.10.4 - HASS
Dahua Integration Version: 0.9.63
Dahua Camera Version: IPC-HDW4830EM-AS
Dahua Camera FW version: DH_IPC-HX5X3X-Rhea_MultiLang_NP_Stream3_V2.800.0000029.0.R.221220
Any ideas or suggestions would be appreciated. Thanks
INFO (MainThread) [custom_components.dahua] Using max streams 3
INFO (MainThread) [custom_components.dahua] Using channel number 1
INFO (MainThread) [custom_components.dahua] Device supports Coaxial Control=True
INFO (MainThread) [custom_components.dahua] Device supports disarming linkage=False
INFO (MainThread) [custom_components.dahua] Device supports smart motion detection=False
INFO (MainThread) [custom_components.dahua] Device is a doorbell=False
INFO (MainThread) [custom_components.dahua] Device is a floodlight=False
INFO (MainThread) [custom_components.dahua] Device supports infrared lighting=True
INFO (Thread-49) [custom_components.dahua] Starting DahuaEventThread
INFO (MainThread) [custom_components.dahua] Device supports profile mode=False
WARNING (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.4.23. See README to enable debug logs to get full exception
Debug
2024-11-02 08:22:53.854 WARNING (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.4.23. See README to enable debug logs to get full exception
2024-11-02 08:22:53.854 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.4.23
Traceback (most recent call last):
File "/config/custom_components/dahua/__init__.py", line 339, in _async_update_data
light_v2 = await self.client.async_get_lighting_v2()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 178, in async_get_lighting_v2
return await self.get(url)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 789, in get
raise exception
File "/config/custom_components/dahua/client.py", line 772, in get
response.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='http://192.168.4.23/cgi-bin/configManager.cgi?action=getConfig&name=Lighting_V2'
2024-11-02 08:22:53.856 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 6.906 seconds (success: False)
2024-11-02 08:22:53.963 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.232 seconds (success: True)
2024-11-02 08:22:54.081 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.163 seconds (success: True)
2024-11-02 08:22:54.107 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.361 seconds (success: True)
2024-11-02 08:22:54.135 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.197 seconds (success: True)
2024-11-02 08:22:54.159 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.169 seconds (success: True)
2024-11-02 08:22:54.397 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 0.267 seconds (success: True)
2024-11-02 08:22:59.672 INFO (MainThread) [custom_components.dahua] Using max streams 3
2024-11-02 08:23:01.869 INFO (MainThread) [custom_components.dahua] Using channel number 1
2024-11-02 08:23:02.048 INFO (MainThread) [custom_components.dahua] Device supports Coaxial Control=True
2024-11-02 08:23:02.221 DEBUG (MainThread) [custom_components.dahua] ClientError fetching information from http://192.168.4.23:80/cgi-bin/configManager.cgi?action=getConfig&name=DisableLinkage
2024-11-02 08:23:02.221 INFO (MainThread) [custom_components.dahua] Device supports disarming linkage=False
2024-11-02 08:23:02.848 DEBUG (MainThread) [custom_components.dahua] ClientError fetching information from http://192.168.4.23:80/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDetect
2024-11-02 08:23:02.848 INFO (MainThread) [custom_components.dahua] Device supports smart motion detection=False
2024-11-02 08:23:02.848 INFO (MainThread) [custom_components.dahua] Device is a doorbell=False
2024-11-02 08:23:02.849 INFO (MainThread) [custom_components.dahua] Device is a floodlight=False
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (7 by maintainers)
The identical has happened here with multiple cameras since 0.9.63. 0.9.62 is the last version where they all worked.
Since 0.9.63 version and up, had one or more Amcrest cameras keep failing sync. In 0.9.66, it has finally reduced to only 1 camera which fails; An Amcrest IP8M-DT3949EW-3AI with Firmware: 2.840.00AC001.0.R, build:2022-10-19.
Restoring to 0.9.62 fixes it and restores all functionality.
Issue is identical, so I didn’t want to file a new issue.
I have the same problem with cameras from my XVR, even with version 0.9.66. It all works fine with version 0.9.62. I have two IP cameras one is IPC-HDW4231EM-ASE, the other is IPC-HFW1320S-W and they work fine with all versions, but the 3 cameras from my XVR don’t. The model of the XVR is XVR5108C-X
The following change is causing the problem:
52adba8
The two cameras experiencing issues are Amcrest models IP8M-T2499E, flashed with Dahua firmware version DH_IPC-HX5X3X-Rhea_MultiLang_NP_Stream3_V2.800.0000029.0.R.221220 for camera model IPC-HDW4830EM-AS. This may be why the cameras aren’t connecting properly. When I remove
or self.model.startswith("IP8M"), everything works fine on version .64.Works on .62 but not .63