Dahua IP camera component

Dahua makes very good bank for the buck IP cameras. The Dahua Starlight 5231 IP cam is one of the best value POE IP cameras on the market. See extensive review and discussion here: https://ipcamtalk.com/threads/dahua-starlight-varifocal-turret-ipc-hdw5231r-z.14683/10

The Dahua API is available here: https://ipcamtalk.com/attachments/dahua_http_api_for_ipc-sd-v1-37-pdf.16069/

Camera-based motion detection is pretty inaccurate and ends in lots of false positives. New cameras from Hikvision and Dahua and other manufacturers include smarter motion detection with virtual tripwires, zone intrusion, etc. that is significantly more accurate.

User cor35vet on ipcamtalk wrote a small python script to monitor Dahua IVS events. See here: https://ipcamtalk.com/threads/trigger-blue-iris-with-ivs.17303/#post-1631964. I modified it to send MQTT messages so I could incorporate my cameras into HomeAssistant. See here: https://github.com/johnnyletrois/dahua-watch/blob/master/watch.py3.

It would be awesome if someone smarter than me would make a native component for HomeAssistant. I don’t mind running the python script to monitor in a separate Docker container, but it would be great to have a tighter integration. I’m very interested in helping, but I don’t have the ability to lead this effort.

Thanks!

Would be very nice to have a component for the following:

PTZ presets
Motion detection
Live view but without the snapshots filling up the hdd

This one got my vote! Could be very nice with some better motion and PTZ detection. FFMPEG Motion platform is close to useless

Support for 34 cameras and still Dahua is not listed :disappointed_relieved:

I think someone tried making a custom component. I never checked it out tho.

I had a perfect setup, live view and PTZ all working in HASS.
But a couple of updates back the curl commands started failing (error 1).
The commands still work fine from a ms-dos prompt.
It has already taken so much time that I stopped researching :frowning:

I still use curl commands to toggle my cameras between color and BW modes. No problems for me and I’m on 0.69.0

Can you please share that command, maybe it will help to solve my problem :slight_smile:

 platform: command_line
  switches:
    garage_cam_mode:
      command_on: 'curl --digest -u "USER:PASS" -g "http://IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0"'
      command_off: 'curl --digest -u "USER:PASS" -g "http://IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1"'
1 Like

I had already had the same button in my configuration but did add it anyway.
This is part of the error I get when turning the switch:

‘curl’ is not recognized as an internal or external command,
operable program or batch file.
2018-06-06 21:01:09 ERROR (SyncWorker_28) [homeassistant.components.switch.command_line] Command failed: curl --digest -u…

Looks like the environment you’re running HomeAssistant in doesn’t support the curl command.

It seems that for some models you don’t need the separate component. I have used Amcrest component after I have discovered they have same API calls. I have now camera and motion sensor working

What model cameras do you have?

I’ve got IPC-HDW1020S

Here’s the API v1.67 for Dahua. It’s still old, but newer than in the first post https://www.telecamera.ru/bitrix/components/bitrix/forum.interface/show_file.php?fid=1022477&action=download

Here’s Amcrest v2.12 https://s3.amazonaws.com/amcrest-files/Amcrest+HTTP+API+3.2017.pdf

Dahua Starlights are working just fine for me via the ffmpeg platform, but I am now trying to integrate their advanced motion/IVS sensing into HA. I’ve read how others have gone about attempting this, but it could sure be simplified by a direct integration. You absolutely have my vote!

Have you had any luck with implementing advanced sensing?

Like what? IVS motion events work great for me.

I’m using the Amcrest component now instead of ffMpeg and it’s working really well for my Dahua Starlights, especially with real-time streaming and PTZ with presets capability. It is being actively supported and new PR’s to better support motion sensing are coming soon. From what I can tell by comparing the Dahua and Amcrest documentation - the API’s are identical.

Anyone else trying this, it might be helpful to post your results here.

EDIT: The Amcrest component currently does not support NVR’s - only direct IPC camera connections, but this was an accepted feature request that could possibly be implemented.

1 Like