Hikvision Doorbell / Videointercom integration

Right, I’m not trying to open the door, I am trying to control the relay itself.
I am able to do it using a basic POST command and ISAPI, but the issue is that the sessionId expires every 24h, so I can’t just have an http switch setup in homebridge. So you mentioned that I need to have the SDK running, hence we are here.

for open door, its best to send the command to outdoor station… not all indoor stations support open door, i have this one, my indoor supports isapi
com1/com2 are not for doors, its a seperate relay on the indoor, mayb you can wire the door to it…

image

I understand, that’s not how I am using COM1.
It’s used to “sync” two latches upon request.
Door itself is actually controlled through a secure module.
So what would be the proper way to trigger COM1 from indoor station using mqtt?

For a switch you need to send the command “ON” to the right topic… If you want I can test it with mqtt explorer later
In your screenshot you are sending the “ON” command, but you need to drop the “hmd” in the topic

Hi all,

I was wondering if there is a way access the snapshots stored on the Hikvision Indoor station and display them in Homeassistant? So it’s the snapshots which are taken automatically when some rings using the doorbell. These snapshots are stored on the SD card on the indoor station as per my understanding

Thanks

That’s correct, I was think about an mqtt camera entity… But it’s an overkill, it’s better to use the camera/rtsp integration, and just call the snapshot service on incoming call, so you can store them just on HA too…

thanks fabio. When you say camera/rtsp integration - is this a generic integration in HA for any camera brand? Or the Hikvision specific integration? There also seems to be an endpoint in the newer firmwares for outdoor stations to take a snapshot, i.e.

/ISAPI/Streaming/channels/1/picture?snapShotImageType=JPEG

but I don’t think I can upgrade my model to that firmware.

You can probably use generic or rtsp , onvif is not supported… I however use my Synology, I use the surveillance station, and import camera’s using that integration…

Correct, there is a new snapshot feature, but I don’t use that, I use the snapshot feature from HA itself

Hello dear, I hope you can help me.

I have the KH6320 (Indoor) and the KV6113 (Outdoor) connected via POE, but the integration only works with the KH6320, not with the KV6113. It shows up in MQTT Explorer but does not integrate with Home Assistant.

I’ve tried everything: reinstalling Docker addons, restarting the supervisor, installing via Portainer, and none of the methods have worked to integrate the KV6113 (B). Updating the camera firmware hasn’t worked either… I hope you can help me.

Frende de calle = Outdoor
Display principal = Indoor.




Hmm, not sure, everything looks ok, it should be added as mqtt device

I have tried removing ‘hmd’ from the topic:

Turning port ON works:
switch/IndoorScreen/Com-1-relay/command=ON

But turning OFF does not:

switch/IndoorScreen/Com-1-relay/command=OFF

ON command appears in the log, OFF does not.

Any thoughts?

thats not implemented like that now, i believe the indoor device itself is turning the relay to OFF after xx seconds, i have configured the mqtt switch, that when you send ON, the switch is OFF again after 2 sec… thats why you cant send the OFF since its always OFF anyway :slight_smile:

on my indoor, the default setting is 1 sec, so the relay is always OFF

image

Could you please add the OFF command?

the problem, is that the state of the relay is not an event, so i dont know if the relay is on/off :frowning:
But i have implemented an text entity “ISAPI-request”, you can set the text, that input text can be used to send whatever ISAPI command you want

as text, try these, make sure there is only 1 space between the 3 attributes, like example below
First 2 are for open/close, the third one you can use to poll the state…

PUT /ISAPI/SecurityCP/control/outputs/0?format=json {"OutputsCtrl":{"switch":"open"}}
PUT /ISAPI/SecurityCP/control/outputs/0?format=json {"OutputsCtrl":{"switch":"close"}}
POST /ISAPI/SecurityCP/status/outputStatus?format=json {"OutputCond":{"maxResults":2,"outputModuleNo":0,"searchID":"1","searchResultPosition":0}}

0 is the first output, 1 is the second one

I was able to pull status using:

"statusUrl": {
        "url": "https://apiius.hik-connect.com/v3/userdevices/v1/isapi",
        "method": "POST",
        "headers": {
            "Content-Type": "application/x-www-form-urlencoded",
            "featureCode": "XXX",
            "appId": "NewHikConnect",
            "sessionId": "XXX"
        },
        "body": "apiData=POST%20/ISAPI/SecurityCP/status/outputStatus?format%3Djson%0D%0A%7B%0A%20%20%22OutputCond%22%20%3A%20%7B%0A%20%20%20%20%22maxResults%22%20%3A%202%2C%0A%20%20%20%20%22outputModuleNo%22%20%3A%200%2C%0A%20%20%20%20%22searchID%22%20%3A%20%22a141UtBqIUUAVow4u4l5ay1GeqZZnJLr%22%2C%0A%20%20%20%20%22searchResultPosition%22%20%3A%200%0A%20%20%7D%0A%7D&apiKey=XXXXXX&channelNo=0&deviceSerial=XXXXX&method=1"
    },
    "statusPattern": "SynchLock.+?status.+?\"on"

Where the “satusPattern” is the RegEx expression to determine the ON status

yes, thats the command i use too, see me previous post :slight_smile:

But i dont want to have polling in the addon when its not needed, i dont want to hammer the devices, the addon is based on events, not poll :slight_smile:
everything is possible, but i want to limit as much as possible

What would be the correct way to send this?
Would I use the following topic:

hmd/text/IndoorScreen/ISAPI-request

or?:

text/IndoorScreen/ISAPI-request

Does the ISAPI command need to formatted in a particular way?
I tried PUT /ISAPI/SecurityCP/control/outputs/0?format=json {"OutputsCtrl":{"switch":"open"}} using both topics, but no response

i tried in mqtt like below, and it succeeds… without hmd


Got the OPEN/CLOSE working! Thank you.
However, now I’m not sure how I would be able to pull status. Where does the reply to the status request appear?

the response json should be filled in the “attibutes” , example here: