Home Assistant Dahua Integration questions

use rtsp addon (not from hacs ) which really speed up and also no delay and no or very less latency

1 Like

Got a link?

Does it support smart sensors?

you still use dahua integration but using rtsp to web it changing the playback speed and improves latency… if you use glance card in front end to view camera live feeds you would see a faster loading speeds and very minimal latency.
add this in addon store> Manage add-on repositories > https://github.com/allenporter/stream-addons
image
once addon is installed. go to integrations and add rtsptoweb and configure it. thats all you are done… now try to go back to the camera glance card and refresh and you should see the difference.
https://github.com/deepch/RTSPtoWeb

1 Like

No such integration exists in the core. Did you mean HACS?

did yu add addon first? not from hacs

I did. And I started it.

try to restart and check in integration

Never mind it would help if I could spell. I was searching for “rstp”.

What’s the difference between the two addons?

1 Like

Ok that is about 4x quicker to load. 4 seconds instead of 16 seconds.

Is there any way to only have it streaming to home assistant when someone is actually watching a stream?

Edit: Found the setting in the web dashboard:

How do I get this to work with nabu casa?

It works fine on my local network but not outside.

EDIT: Ah. it is not supported, there is a work in progress: https://github.com/allenporter/stream-addons/issues/62

That makes it useless to me at the moment.

I use cloudflare tunnel and it works for me…i could view live stream from dashboard .

I can put up with the slower load times until they get the stun server code working. I’ll revisit webrtc then.

1 Like

Hi guys, not sure if anyone is experiencing the same thing as me, but for some reason i stopped receiving motion detection events or cross region or cross line events as well.
also for some reason, the log shows that suddenly all cameras become unavailable, then somehow few minutes later they show up again.
i can see the main & sub stream and the log shows that motion detection was turned on eventhough i did not click or change anything, and also other entities are showing being turned on and off and safe and cleared, but not sure why this even shows up in the log.
but the main problem is is that i no longer see any events for motion detection which i used for some automations.
i have 14 cameras and none of them show any events for motion or cross line/region events eventhough they occur on the NVR side.
any ideas what the problem can be?
it worked a few days ago and then suddenly stopped.
i have removed all cameras, reincluded them again one by one in the dahua integration, but it puzzles me why the cameras become unavailable from time to time and also no motion detection is showing up in log events :frowning:
any ideas???

image

solved it with this:

a bug in the code keeps reading the NVR as a Doorbell.
Dang. go figure :slight_smile:

Dear All,

For a while I try to get events in HA with Dahua Integration but without success.

I wonder if this is due to my configuration. I have 3 POE cameras directly connected to an DHI-NVR4208-8P-4KS2-L. Therefore cameras are not on the same network than my HA but only the NVR.

The service “Disarming” is the only thing which is really working (plus streams). It would be nice to get at least events triggered by motion detection in order to add new automations.

So far I added 3 Dahua integrations:

  • channel 0 for the NVR and giving as main stream the camera connected to the port 1 (DH-IPC-HDW3849H-AS-PV-S3)
  • channel 1 giving as main stream the camera connected to the port 2 (DH-IPC-HDW3849H-AS-PV-S3)
  • channel 2 giving as main stream the camera connected to the port 3 (IPC-HDBW3441F-AS-M)

Maybe this is the wrong way to proceed or I missed somethings…

Any ideas?

Thanks for your help :slight_smile:

After further researches, I found the reason (and fix) of the problem. Here is the answer:

NVRs with the name starting with “DHI-” are considered as doorbells.

hi guys.
after fixing the issue withe connection to VTO failed, i have now fully functional cameras and events.
however, something strange has been happening and the cameras become unavaialble all at once at random times.
i tried to figure out what might be causing this but have no clue.
can anyone help please? what could be causing this?
here is the log.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 205, in _async_refresh
self.data = await self._async_update_data()
File “/config/custom_components/dahua/init.py”, line 285, in _async_update_data
raise PlatformNotReady(“Dahua device at " + self._address + " isn’t fully initialized yet”)
homeassistant.exceptions.PlatformNotReady: Dahua device at 10.20.30.200 isn’t fully initialized yet
2022-09-29 14:36:07.076 WARNING (MainThread) [homeassistant.config_entries] Config entry ‘CAM 4’ for dahua integration not ready yet: Dahua device at 10.20.30.200 isn’t fully initialized yet; Retrying in background
2022-09-29 14:36:07.571 WARNING (MainThread) [custom_components.dahua] TimeoutError fetching information from https://10.20.30.200:443/cgi-bin/coaxialControlIO.cgi?action=getStatus&channel=1
2022-09-29 14:36:07.574 ERROR (MainThread) [custom_components.dahua] Failed to initialize device at 10.20.30.200
Traceback (most recent call last):
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 50, in request
return await self._handle_401(response)
File “/config/custom_components/dahua/digest.py”, line 151, in _handle_401
return await self.request(
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
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/config/custom_components/dahua/init.py”, line 227, in _async_update_data
await self.client.async_get_coaxial_control_io_status()
File “/config/custom_components/dahua/client.py”, line 160, in async_get_coaxial_control_io_status
return await self.get(url)
File “/config/custom_components/dahua/client.py”, line 749, in get
raise exception
File “/config/custom_components/dahua/client.py”, line 733, in get
async with async_timeout.timeout(TIMEOUT_SECONDS):
File “/usr/local/lib/python3.10/site-packages/async_timeout/init.py”, line 129, in aexit
self._do_exit(exc_type)
File “/usr/local/lib/python3.10/site-packages/async_timeout/init.py”, line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
2022-09-29 14:36:07.582 ERROR (MainThread) [custom_components.dahua] Unexpected error fetching dahua data: Dahua device at 10.20.30.200 isn’t fully initialized yet
Traceback (most recent call last):
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 50, in request
return await self._handle_401(response)
File “/config/custom_components/dahua/digest.py”, line 151, in _handle_401
return await self.request(
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
asyncio.exceptions.CancelledError

thanks for any help .

1 Like

Hi I have Dahua camera system, and currently I am using DMSS app to access those camera using serial number provided.

Does anyone have step by step guide on how to connect them to Home Assistant? I can’t find any IP address or link because I tried using generic camera interface.

Thank you in advance.
Btw I am very new at this so I will need lot of support.

2 Likes

This could be very good solution for dahua users but seems this integration is not maintain anymore

I have several camera channels connected. The integration provides sensors and various video streams. Unfortunately, each of them (Main, SubMain, etc.) is of very poor quality. Is it possible from the integration level to increase it, e.g. by setting the subtype parameter ?