Can't load HikVision Binary Sensor

Did you restart home assistant after you added the binary_sensor?

Yup, I’m trying to fix this for two weeks with a lot of retries and restarts of HA.

This is how I have my Hikvision setup in the binary_sensor.yaml file:

#Front Door Camera
platform: hikvision
host: 192.168.1.63
name: front_door_cam_sensors
username: admin
password: xxxxx

After saving the file I SSH’d into HassIO and run “hassio homeassistant restart” command, without quotes.

Hmmm strange. I’ve tried to copy that to my config. No error message but also no new sensors.

Maybe I found the problem. At the top of this topic it is described that the Hikvision CGI options and authentication must be turned on. My NVR does not have all that menu items.

I found the option “System-> Security-> Authentication” and put it on “digest / basic”.

I can not find the other option. Under “Network-> Advanced Settings-> Integration protocoll” and then the checkbox “Enable HikVision-CGIU” and the CGI authentication dropdown is not there, so I can not put it on digest / basic. The whole menu items ’ Integration protocoll’ is not there, the last option is ‘Other’.

Are you trying to set these options on the NVR or on the camera itself?
As far as I know you need to provide the camera details, not the NVR…

Nope I tried to connect to the NVR. As I read in the documentation this is possible:
When used with a NVR device the sensors will be appended with the channel number they represent. For example, if you configure an NVR with the name “Home” that supports 2 cameras with motion detection and line crossing events enabled to notify the surveillance center the following binary sensors will be added to Home Assistant:

  1. binary_sensor.home_motion_1
    
  2. binary_sensor.home_motion_2
    
  3. binary_sensor.home_line_crossing_1
    
  4. binary_sensor.home_line_crossing_2
    

See: https://www.home-assistant.io/components/binary_sensor.hikvision/

Directly connect to the camera’s isn’t possible, because the IPTV cams that are connected to the NVR are in a different subnet that the my home automation and the NVR itself. My HA server got 192.168.4.100 ipadres, the NVR got 192.168.4.60. The camera’s behind the NVR got 192.168.254.x range.

Found the problem.

You must check Notify Surveillance Center at the linkage methode. After checking that and restarting HA, the sensors are added. Damm it could be quite simple when you know the solution.

1 Like

Nice find. Might be worth a PR to update the doc?

I’ve got DS-7216HGHI. I turned on the Notify Surveillance Center everywhere, but I don’t have “digest / basic” option in the configuration.
HA sees the motion sensors, but the entities don’t change.
I have analog cameras. Could it be the problem?

After firmware upgrade it works.

I have done all this and the logs say authentication failed.
No NVR just two cams.

- platform: hikvision
  name: Voortuin
  host: 10.0.1.6
  port: 80
  ssl: false
  username: *****
  password: *****

I had same issue. Turns out I was using the wrong password.

I had same issue.

Thanks for all hints and tips.

I also had the issue that the sensors were made, but weren’t triggered. For me the solution was to enable the ‘Op afstand: Waarschuw surv.centr./Trigg…’ privilege *) for the user in the camera user management settings. If you use an Admin user you won’t need this solution, because admins have all privileges, but I used a user of the Operator type in trying to be more secure.

*) In English this privilege is probably known as something like ‘Remote: Warn surveillance centre / trigger…’

B.t.w. the ‘HikVision-CGI’ setting could stay disabled for me. But I only use the line crossing detection sensor and the motion sensor. I don’t know if HikVision-CGI is needed to make other sensors happy.

I have had the binary_sensors working well for a long time. With the recent introduction of Alexa camera streaming needing https, I have run into an issue. When I change the port to 433 and add ssl: true, my binary_sensors show unavailable. Has anyone gotten the binary_sensors to work with https?

Hi all,
Apologies if this should be a new topic but wondering if I could get some pointers
Trying to get a new hikvision camera working with Home Assistant but not seeing the binary sensors show up.

Initially started testing with a basic model (IPC-B220) and home assistant is picking up the motion and “tamper detection” sensors with no issues.

The problem is with a new camera I have picked up. The new sensors are just not appearing in HA
It is a DS-2CD2386G2-IU running the following
image

That is the latest firmware I could find (not sure if I should be downgrading instead)

I have followed the steps at the start of this topic and set the auth to digest/basic which works for the streaming and snapshots with no issues. The notifications are also enable for basic and smart events.

The integration does appear to be connecting to the camera as I have used a specific user and it is showing up as connected on the camera under the “online users” section.

image

Have tried with both the admin user and specific operator with the "notify Surveillance Center " permissions
image

Don’t seem to be able to see any errors in the logs related to the hikvision integration.

Is it possible to enable debug logging for this HikVision integration by any chance?
Any advice on how to troubleshoot this is very much appreciated.

Closing the loop on the above post.
Looks like this has already been reported and worked on here

`“When i restart Home Assistant i can see on the cameras webinterface, that the hassio_mgmt-Useraccount is properly connected (see attached screenshots, the IP of homeassistant is the 192.168.150.10), but there are no binary sensors getting created.``”

1 Like

I can confirm this works with firmware V5.5.160 build 210416 for the camera Hikvision DS-2CD2386G2-ISU/SL. If you have any issues, ensure that the time is correct on your IP camera.

Anyone experiencing issues with not all sensors showing up in HA, my solution was upgrading the firmware to V5.5.800 build 211009

I had 1 newer camera with newer firmware which immediately showed up in HA with all sensors.
My 3 older camera’s (1 year older) did have the functions for line crossing etc, but would only show the movements.

After upgrading my camera’s and then restarting HA, all functions showed up for all 4 camera’s.
The restart of HA after upgrade is very important to do!