I have a Dahua camera, it lets me add it to the integration, but it is only recognised as a generic RTSP camera.
It cannot load the streams or any of the controls for motion detection or infrared control etc.
Here are the detials of the camera (yes, it's an old one)
Is it possible to fix please?
Device Type
IPC-HDW4300C
Software Version
2.420.0009.0.R, build : 2015-11-06
WEB Version
3.2.1.305503
ONVIF Version
2.4.1
These are the error logs i get in home assistant - I'm not 100% sure if they are both relevant/linked
This error originated from a custom integration.
Logger: custom_components.dahua
Source: custom_components/dahua/config_flow.py:233
Integration: Dahua (documentation, issues)
First occurred: 15:59:52 (1 occurrence)
Last logged: 15:59:52
Could not connect to Dahua device. For iMou devices see #6
Traceback (most recent call last):
File "/config/custom_components/dahua/client.py", line 834, 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.14/site-packages/aiohttp/client.py", line 788, in _request
resp = await handler(req)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client.py", line 766, in _connect_and_send_request
await resp.start(conn)
File "/usr/local/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 539, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/streams.py", line 707, in read
await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/dahua/config_flow.py", line 233, in _test_credentials
data = await client.get_machine_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 123, in get_machine_name
return await self.get("/cgi-bin/magicBox.cgi?action=getMachineName")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 846, in get
raise exception
File "/config/custom_components/dahua/client.py", line 830, in get
async with async_timeout.timeout(TIMEOUT_SECONDS):
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/async_timeout/init.py", line 141, in aexit
self._do_exit(exc_type)
~~~~~~~~~~~~~^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/async_timeout/init.py", line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:281
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15:48:47 (2 occurrences)
Last logged: 16:17:08
[545344279776] Unexpected exception
[544243825888] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 281, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/core.py", line 2827, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2870, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 949, in entity_service_call
response_data = await _async_handle_entity_calls(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 828, in _async_handle_entity_calls
single_result = await entity.async_request_call(_with_context(entity, coro))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1702, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 823, in _with_context
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 907, in _handle_single_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 517, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/dahua/light.py", line 99, in async_turn_on
await self._coordinator.client.async_set_lighting_v1(channel, True, dahua_brightness)
File "/config/custom_components/dahua/client.py", line 351, in async_set_lighting_v1
return await self.async_set_lighting_v1_mode(channel, mode, brightness)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 368, in async_set_lighting_v1_mode
return await self.get(url)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 852, in get
raise exception
File "/config/custom_components/dahua/client.py", line 835, in get
response.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 636, in raise_for_status
raise ClientResponseError(
...<5 lines>...
)
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url='http://192.168.1.54/cgi-bin/configManager.cgi?action=setConfig&Lighting%5B0%5D%5B0%5D.Mode=Manual&Lighting%5B0%5D%5B0%5D.MiddleLight%5B0%5D.Light=39'
I have a Dahua camera, it lets me add it to the integration, but it is only recognised as a generic RTSP camera.
It cannot load the streams or any of the controls for motion detection or infrared control etc.
Here are the detials of the camera (yes, it's an old one)
Is it possible to fix please?
Device Type
IPC-HDW4300C
Software Version
2.420.0009.0.R, build : 2015-11-06
WEB Version
3.2.1.305503
ONVIF Version
2.4.1
These are the error logs i get in home assistant - I'm not 100% sure if they are both relevant/linked
This error originated from a custom integration.
Logger: custom_components.dahua
Source: custom_components/dahua/config_flow.py:233
Integration: Dahua (documentation, issues)
First occurred: 15:59:52 (1 occurrence)
Last logged: 15:59:52
Could not connect to Dahua device. For iMou devices see #6
Traceback (most recent call last):
File "/config/custom_components/dahua/client.py", line 834, 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.14/site-packages/aiohttp/client.py", line 788, in _request
resp = await handler(req)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client.py", line 766, in _connect_and_send_request
await resp.start(conn)
File "/usr/local/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 539, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/streams.py", line 707, in read
await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/dahua/config_flow.py", line 233, in _test_credentials
data = await client.get_machine_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 123, in get_machine_name
return await self.get("/cgi-bin/magicBox.cgi?action=getMachineName")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 846, in get
raise exception
File "/config/custom_components/dahua/client.py", line 830, in get
async with async_timeout.timeout(TIMEOUT_SECONDS):
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/async_timeout/init.py", line 141, in aexit
self._do_exit(exc_type)
~~~~~~~~~~~~~^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/async_timeout/init.py", line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:281
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15:48:47 (2 occurrences)
Last logged: 16:17:08
[545344279776] Unexpected exception
[544243825888] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 281, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/core.py", line 2827, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2870, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 949, in entity_service_call
response_data = await _async_handle_entity_calls(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 828, in _async_handle_entity_calls
single_result = await entity.async_request_call(_with_context(entity, coro))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1702, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 823, in _with_context
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 907, in _handle_single_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 517, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/dahua/light.py", line 99, in async_turn_on
await self._coordinator.client.async_set_lighting_v1(channel, True, dahua_brightness)
File "/config/custom_components/dahua/client.py", line 351, in async_set_lighting_v1
return await self.async_set_lighting_v1_mode(channel, mode, brightness)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 368, in async_set_lighting_v1_mode
return await self.get(url)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 852, in get
raise exception
File "/config/custom_components/dahua/client.py", line 835, in get
response.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 636, in raise_for_status
raise ClientResponseError(
...<5 lines>...
)
aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url='http://192.168.1.54/cgi-bin/configManager.cgi?action=setConfig&Lighting%5B0%5D%5B0%5D.Mode=Manual&Lighting%5B0%5D%5B0%5D.MiddleLight%5B0%5D.Light=39'