Looking for feedback and testing of my Dahua Home Assistant integration (via HACS)

runraid

Getting the hang of it
May 22, 2020
158
86
Seattle
This is the initial release, you’ll have to manually add the repo to your HACS integration until it’s officially added (that’s pending a PR review)

It doesn’t support PTZ yet becaise I don’t have a cam to test with.

Seeking feedback on anything that’s broke and missing features/services you’d like to have built in. Thanks!!!

 
Unable to setup for:
Device Type IPC-D2B20-ZS
System Version 2.680.0000000.2.R, Build Date: 2019-03-01
WEB Version 3.2.1.20272
ONVIF Version 18.6(V2.0.0.18395)
Security Baseline Version V1.4
 

Attachments

  • Screenshot_2021-05-26_07-21-14.png
    Screenshot_2021-05-26_07-21-14.png
    37.4 KB · Views: 55
@MyDaHua thank you. Did it happen to have any details in the logs? I don’t have a mini dome to test with but maybe the logs will give a clue
 
Nothing in HA log for Dahua.
This camera need RPC protocol wrapper:
Code:
https://gist.github.com/gxfxyz/48072a72be3a169bc43549e676713201
more info:
 
  • Like
Reactions: runraid
Testing on:
Device Type IPC-HFW1435S-W-S2
System Version V2.680.0000000.24.R, Build Date: 2021-03-09
WEB Version V3.2.1.1029791
ONVIF Version 19.12(V2.7.1.917204)
Security Baseline Version V2.1
Screenshot_2021-05-26_13-03-18.pngScreenshot_2021-05-26_13-15-46.png
Motion Alarm - ok
Video stream 2 - not ok I can't get live stream ( I have static image from camera )
IR not tested because it is day now.

Code:
Logger: homeassistant.components.stream.worker
Source: components/stream/worker.py:131
Integration: Stream (documentation, issues)
First occurred: 1:03:16 PM (17 occurrences)
Last logged: 1:26:58 PM
Error opening stream rtsp:/****:****@192.168.xx.xxx:544/cam/realmonitor?channel=1&subtype=1

Logger: libav.tcp
Source: components/stream/worker.py:129
First occurred: 1:03:16 PM (17 occurrences)
Last logged: 1:26:58 PM
Connection to tcp:/192.168.xx.xxx:544?timeout=5000000 failed: Connection refused

Nice work.
Thank you.
 
Last edited:
@MyDaHua if you toggle ir it removes it from auto mode. You’ll need to put it back to auto if you want it to switch on st night. Either in the cam ui or with the service call in HA. I put the steps in the read me
 
@MyDaHua I figured out why the live streaming wasn't working. I had defaulted to the wrong port in the config flow. Remove the camera and change the RTSP port to 554. I'll push out a fix for this but you'll need to readd the camera. Thanks!
 
  • Like
Reactions: MyDaHua
I'll have to jump in for this as I have Home Assistant & all Dahua cameras (ptz, double boobie cam, 5442's, 5231's, 4231's, etc).
I do not have HACS setup yet. Still using deprecated zwave, actually :) Just haven't touched it since the start of my tire slashing issue as didn't want any "oops...failure".
 
  • Like
Reactions: runraid
Hi,

I just upgraded to the latest version, where the alarm function for AD-cams are added and tested to add a few cameras. I haven't used this HA integration so much yet so I don't know if below errors are caused by the new version.

Cameras that are tested and works (at least to connect):
SD59432XA-NR
7442H-Z4
5541
4433

Cameras I cannot connect to:
4239R-ASE
5442RP-ASE-NI

dahua-HA-error.JPG
 
Hi,

I just upgraded to the latest version, where the alarm function for AD-cams are added and tested to add a few cameras. I haven't used this HA integration so much yet so I don't know if below errors are caused by the new version.

Cameras that are tested and works (at least to connect):
SD59432XA-NR
7442H-Z4
5541
4433

Cameras I cannot connect to:
4239R-ASE
5442RP-ASE-NI

View attachment 92342

Thanks for testing. The dome cams are slightly more complicated and I don't have one to test with so I've been unable to work on this fix - Add support for Mini-Dome cameras · Issue #4 · rroller/dahua

I'll try to buy one soon so I can get them working.
 
hmm.. Both the 5541 and the 4433 are domes, if it matter.

Let me know if you want me to test something specific, Il'd be more than happy to do so!
 
@genelit does this work for you against one of the non-working cams? (replace the IP address with the IP address of the cam)

http://ip_address/cgi-bin/configManager.cgi?action=getConfig&name=General
 
Hi @runraid Are you able to supply a snippet from a Home Assistant automation that shows what the "event_type" and "event_data" sections would look like (?
I am trying to get an automation running that uses CrossLineDetection (IVS) to trigger external lights, but don't know what the event looks like.

trigger:
- platform: event
event_type: xxxxxxx
event_data: yyyyyyy
entity_id: zzzzz
 
thanks to OP this is fantastic, IPC-HDW3449H-AS-PV works fien as in i can control the following:

LED light - on off and brightness
Sec. light - on off
Siren - on off
and it detects IVS motion.

It would be good if you can add an option to change profiles
Otherwise great work
 
Curious. Could this integration with Dahua cameras do something similar to BP's Dahua sunrise/sunset utility where it can change Dahua camera profiles, Zoom In/Out profiles, etc? I use BP's utility everyday. However, it is based on a set time. Wouldn't mind using Home Assistant to tell the Dahua cameras to change profiles based on my weather station LUX reading instead.
 
All these goodies will cause me to move this up my to do list LOL.

It would be great to do it based on LUX reading so that when you get that dark thunderstorm in the middle of the day that looks like night, or dark clouds at dawn/dusk, it can keep better camera settings.

Would love to be able to also set a BI profile based on if it is raining at my house! I have a profile set up that has less sensitive motion, turns PTZs down, etc. for heavy rain events that want to trigger cams all night or day, and it would be nice to automate that part too!
 
  • Like
Reactions: genelit and Holbs
All these goodies will cause me to move this up my to do list LOL.

It would be great to do it based on LUX reading so that when you get that dark thunderstorm in the middle of the day that looks like night, or dark clouds at dawn/dusk, it can keep better camera settings.

Would love to be able to also set a BI profile based on if it is raining at my house! I have a profile set up that has less sensitive motion, turns PTZs down, etc. for heavy rain events that want to trigger cams all night or day, and it would be nice to automate that part too!
oooo...good point about changing camera profiles based on rain/snow. Didn't think of that one!