Hikvision Onvif Setup

Having loads of problems getting my Hikvision 2CD2142 cam working with HA. The camera is onvif compatible, but I’m getting this error on startup…

2017-07-23 15:50:03 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform onvif
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/suds/transport/http.py", line 78, in send
fp = self.u2open(u2request)
  File "/home/homeassistant/.homeassistant/deps/suds/transport/http.py", line 119, in u2open
return url.open(u2request, timeout=tm)
  File "/usr/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
  File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

I’ve got this config

  - platform: onvif
    name: FrontCamera
    port: 80
    username: admin
    password: xxx

Tried other ports, same error. Is Onvif the best component for this cam? I’ve found an RTSP feed URL, which works in VLC, but not sure what HA component can use it.

Thanks for any suggestions.

Have you tried the Generic IP Camera?

See here a previous discussion on working options.

Yeah, I don’t think the Generic IP Camera component can accept an RTSP URL:

ERROR (MainThread) [homeassistant.components.camera.generic] Error getting new camera image: [Errno 104] Connection reset by peer

 - platform: generic
    name: FrontCamera
    still_image_url: rtsp://
    username: admin
    password: xxx

This is how I have mine confiured.

Replace the 8’s with your password as well as the ip address…

See here a previous discussion on working options.

Have you tried this ONVIF(400 Bad Request with Onvif)


Gave up with onvif, got it working as a basic generic camera. Fortunately, I can still use my Synology box to do the more advanced stuff.


Works a dream here.

Dopier you’re enable ONVIF in the camera? It’s not on by default.