dahua icon indicating copy to clipboard operation
dahua copied to clipboard

Support for Amcrest ASH21-B

Open alexpattyn opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Add support for the ASH21-B, currently there appears to be an error in connecting to the camera.

image

Logger: custom_components.dahua
Source: custom_components/dahua/digest.py:46
Integration: Dahua ([documentation](https://github.com/rroller/dahua), [issues](https://github.com/rroller/dahua/issues))
First occurred: 5:26:42 PM (1 occurrences)
Last logged: 5:26:42 PM
Could not connect to Dahua device. For iMou devices see https://github.com/rroller/dahua/issues/6

Traceback (most recent call last):
  File "/config/custom_components/dahua/config_flow.py", line 177, in _test_credentials
    data = await client.get_machine_name()
  File "/config/custom_components/dahua/client.py", line 121, in get_machine_name
    return await self.get("/cgi-bin/magicBox.cgi?action=getMachineName")
  File "/config/custom_components/dahua/client.py", line 755, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 737, 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 559, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 898, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

I can confirm I was able to connect to the camera via ONVIF.

Describe the solution you'd like A clear and concise description of what you want to happen. Support for the ASH21-B added to the Dahua integration.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

ONVIF, but this lacks the more advance features of this integration.

Additional context Add any other context or screenshots about the feature request here.

alexpattyn avatar Jul 09 '22 21:07 alexpattyn

Looking at some of the amazon reviews it does appear to be a rebranded Dahua. So I am not sure why I am having issues.

I can confirm that accessing the camera via VLC works using rtsp://[username]:password@IPaddress:554/cam/realmonitor?channel=1&subtype=0

alexpattyn avatar Jul 09 '22 22:07 alexpattyn

Yes, most Amcrest cameras are from Dahua but maybe different APIs are used? For example, see the discussion here: https://github.com/rroller/dahua/issues/6 Imou are also "OEM" (Iomu is a subsidiary of Dahua).

You can try Amcrest integration: https://www.home-assistant.io/integrations/amcrest/

BTW: It also seems that rroller have no more time for further development? :-(

JimGermany avatar Jul 11 '22 11:07 JimGermany