But get this Error message
16-02-19 17:22:54 homeassistant.components.switch.hikvisioncam: Unable to connect: Connection to hikvision failed. Original exception: ConnectionError, "('Connection aborted.', BadStatusLine("''",))"
thanks for the quick reply.
This is the error messages I get now. It’s still shows port 80.
16-02-19 19:34:48 homeassistant.components.switch.hikvisioncam: Unable to connect: Connection to hikvision failed. Original exception: ConnectionError, "HTTPConnectionPool(host='192.168.0.x', port=80): Max retries exceeded with url: /System/deviceInfo (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x73b7e3f0>: Failed to establish a new connection: [Errno 111] Connection refused',))"
What do you exactly mean by leave the https port default? Where in the camera settings can I check this?
Attached you see my settings.
I checked the source and found the problem. Even though the warning states that it works on 443 only the code says otherwise
host = config.get(CONF_HOST, None)
port = config.get('port', "80")
name = config.get('name', "Hikvision Camera Motion Detection")
username = config.get(CONF_USERNAME, "admin")
password = config.get(CONF_PASSWORD, "12345")
Try setting your camera to 80 and defaults password/username and see if it works.
If it does revert back to your own secure settings and lodge a RFC on Github.
Mine works using the picture function of the camera. HA refreshes the picture every 10 seconds if you havent highlighted the camera or every 1 second if you have it maximized.
@Coolie1101 HASS can absolutely display a realtime video stream, but there are some caveats. You can only do it in the pop-up window (main page display is limited to a 10 second refresh) and you need to configure it as a “mjpeg” camera type, not generic.
For a hikvision camera I use a URL syntax like below:
camera:
platform: mjpeg
mjpeg_url: http://X.X.X.X/Streaming/Channels/2/preview
username: user
password: pass
You then need to make sure you have the substream set to “MJPEG” in your camera settings like the in the snapshot below.