Hikvision & Dahua cameras

Hi
Locally I have access to Hikvision & Dahua cameras and want to use it with Home Assistant.
Before I make the purchase I would like to know if any of the two types Cameras. ( Hikvision & Dahua ) will work with Home Assistant and if any of these two makes will have problem with Home Assistant.

I would appreciate your help so that I can purchase the cameras to add to my POE switch. ( Tenda 8 Port PoE TEF1110P-8-102W)

Thanks

There is no component specific for these cameras but I am sure that both has onvif and as such will work in HA

1 Like

Hi
Thanks for your reply , not sure what onvif is but will look it up and try understand it. Appreciate your help.

Onvif is a protocol that almost all ip cameras can use nowadays. There is a component in HA for it.
Check the manual for the cameras

1 Like

Just checked. Hkvision support it but it is desabled by default

1 Like

Thanks Yuran for the help, much appreciated.

I’ve got a bunch of hikvision cameras they work a treat.

1 Like

Im using Dahua 4MP domes at home using the ffmpeg component and they work flawlessly

1 Like

Got a couple of dahua cameras integrated into HA using the Onvif component. works fine

1 Like

I have several Hikvision cameras and with Home Assistant you can also use the field detection, line crossing and motion detection to trigger events or just view when they were triggered. I only use the default camera component but could use either ONVIF or FFMPEG if you want a live video stream.

1 Like

Thanks guys for the help, appreciate it.

1 Like

Can you maybe share your config for the Onvif component that connects to a Dahua camera? I do not get it working.

Thanks!

  • platform: onvif
    host: 10.0.0.4
    port: 80
    profile: 1
    name: front_door
    user: ‘user’
    password: ‘password’

I have a Hikvision NVR with Hik and Dahua cams (POE).
I personally use this for HA this to get the cam feed, works great:

  - platform: generic
    still_image_url: http://192.168.1.149:65004/ISAPI/Streaming/channels/1/picture  
    name: Ext entrée maison
    username: admin
    password: !secret hikvision
    authentication: digest

Plus with the hikvision binary sensors, HA sees the cam motion and advanced detections (that you can use in HA automations as well:

2 Likes

If your Dahua cams support IVS events you can use a python script to send notifications via MQTT to HomeAssistant. That’s what I do with my Dahua 5231 starlights.

Thanks for the fast response :slight_smile: !

After some debugging it’s slightly working. I found out that when I disable authentication for ONVIF in the settings of the camera it’s working. This is of course not the solution.

Used config:
camera:

  • platform: onvif
    host: 192.168.1.2
    port: 80
    profile: 1
    username: admin
    password: password

But then I get the following error:

2018-12-30 11:34:06 DEBUG (SyncWorker_9) [homeassistant.components.camera.onvif] Connecting with ONVIF Camera: 192.168.1.2 on port 80
2018-12-30 11:34:06 DEBUG (SyncWorker_9) [suds.xsd.query] (‘GetProfiles’, ‘http://www.onvif.org/ver10/media/wsdl’), found as: <Element:0x7f89cf9a43c8 name=“GetProfiles” />
2018-12-30 11:34:06 DEBUG (SyncWorker_9) [suds.xsd.query] (‘GetProfiles’, ‘http://www.onvif.org/ver10/media/wsdl’), found as: <Element:0x7f89cf9a43c8 name=“GetProfiles” />
2018-12-30 11:34:06 DEBUG (SyncWorker_9) [homeassistant.components.camera.onvif] Couldn’t setup camera ‘ONVIF Camera’. Error: Unknown error: (400, ‘Bad Request’)

After turning off the authentication I will see in the log that it will use the following URL to connect:

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif

When this was working, I was hoping that I could use the PTZ functions using a service. But this was not working. So for now, enabled authentication and using the ffmpeg platform with rtsp url.

I use this one:

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0

I have btw a Dahua DH-SD42C212T-HN

Try removing the profiles part, the camera may not support them.

Just tried it, but still a bad request.

2018-12-30 12:58:18 DEBUG (SyncWorker_8) [homeassistant.components.camera.onvif] Connecting with ONVIF Camera: 192.168.79.45 on port 80
2018-12-30 12:58:18 DEBUG (SyncWorker_8) [suds.xsd.query] (‘GetProfiles’, ‘http://www.onvif.org/ver10/media/wsdl’), found as: <Element:0x7f87a56d03c8 name=“GetProfiles” />
2018-12-30 12:58:18 DEBUG (SyncWorker_8) [suds.xsd.query] (‘GetProfiles’, ‘http://www.onvif.org/ver10/media/wsdl’), found as: <Element:0x7f87a56d03c8 name=“GetProfiles” />
2018-12-30 12:58:18 DEBUG (SyncWorker_8) [homeassistant.components.camera.onvif] Couldn’t setup camera ‘ONVIF Camera’. Error: Unknown error: (400, ‘Bad Request’)

Any chance you can share your Dahua config as well please? I only see Hikvision one in your post.
Were you able to send Dahua events to HA as well?
Also, is there a way to turn off the camera from HA, for the indoor cameras for example?

Thanks!

This PR fixes the bad request stuff on several ONVIF cameras:

Let’s hope it gets accepted soon :slight_smile: