koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.27k stars 251 forks source link

Hikvision Doorbells doesn't change the Button state or onCall State #533

Closed VCTGomes closed 8 months ago

VCTGomes commented 1 year ago

I've installed a Hikvision KV6113 recently to expose it to HomeKit, but the button state or onCall aren't working.

So, to bypass the button limitation I'm using a Python script that's always checking the URL http://192.168.0.XX/ISAPI/VideoIntercom/callStatus?format=json for changes on status from idle to ring. When it happens, the script "press" the Scrypted script link from a device group, as said on DYI your doorbell.

image

I think it could be integrated directly on Scrypted to increase the usability and deliver a plug 'n' play experience.

However, I still can't change its state from ring to onCall when Live View is active. It's necessary because when someone press the button and the Doorbell starts ringing it continue ringing even during a call on HomeKit, so Scrypted must send a command to KV6113 asking it to change the status to onCall to stop ringing and turn mic.

If you guys know some workaround for the onCall status, I'd like to know.

I hope this both things would be integrated on further update.

VCTGomes commented 1 year ago

To stop ringing and I be able to make calls I did a request.put on Python to hang up the call 1 sec later. It's a workaround to prevent the doorbell continue ringing while I'm trying to answer the door.

...
admin = "admin"
password = "XXXX"
answer_url ='http://192.168.2.XX/ISAPI/VideoIntercom/callSignal?format=json'
custom_json = {"CallSignal":{"cmdType":"hangUp"}}
...
        requests.put(answer_url, auth=HTTPDigestAuth (admin, password), json = custom_json)
...

So I think is completely possible Scrypted just send the same PUT command to indicate when it's onCall and stop ringing.

davidavibeatz commented 1 year ago

To stop ringing and I be able to make calls I did a request.put on Python to hang up the call 1 sec later. It's a workaround to prevent the doorbell continue ringing while I'm trying to answer the door.

...
admin = "admin"
password = "XXXX"
answer_url ='http://192.168.2.XX/ISAPI/VideoIntercom/callSignal?format=json'
custom_json = {"CallSignal":{"cmdType":"hangUp"}}
...
        requests.put(answer_url, auth=HTTPDigestAuth (admin, password), json = custom_json)
...

So I think is completely possible Scrypted just send the same PUT command to indicate when it's onCall and stop ringing.

I've installed a Hikvision KV6113 recently to expose it to HomeKit, but the button state or onCall aren't working.

So, to bypass the button limitation I'm using a Python script that's always checking the URL http://192.168.0.XX/ISAPI/VideoIntercom/callStatus?format=json for changes on status from idle to ring. When it happens, the script "press" the Scrypted script link from a device group, as said on DYI your doorbell.

image

I think it could be integrated directly on Scrypted to increase the usability and deliver a plug 'n' play experience.

However, I still can't change its state from ring to onCall when Live View is active. It's necessary because when someone press the button and the Doorbell starts ringing it continue ringing even during a call on HomeKit, so Scrypted must send a command to KV6113 asking it to change the status to onCall to stop ringing and turn mic.

If you guys know some workaround for the onCall status, I'd like to know.

I hope this both things would be integrated on further update.

Hi, i recently bougth the same doorbell. Very happy with it except for the unability to have the homepod ringing when someone is at the door. How can i install this script on scrypted? Can you explain in a easy way how to achieve this?

VCTGomes commented 1 year ago

Hi. You need to create an Webhook and device grouping on Scrypted. You can read how create this link in this link below

https://discord.com/channels/882329362295316500/887080925018607707/1061247109870919770

Then, finally you'll be able to use the Python script. You can read more here https://discord.com/channels/882329362295316500/887080925018607707/1070819504390668409

The koush promise to add a proper support some day

VCTGomes commented 1 year ago

Pergola Fabio and more developed a plugin to Home Assistant that works incredible well.

It's based on official Hikvision SDK and can get ringing status locally and even close/open door, beyond reject or answer a call just pressing a button. On logs is possible to see a lot of motion detection sent from doorbell (still not used).

image

I'm using this plugin to trigger an web hooks from Scrypted, but I think Koush could take advantage of this add-on or SDK from Hikvision and implement directly on Scrypted, to use Hikvisions doorbells plug-in play and highly reliable.

It'd be nice, for exemple, to detect when microphone is on to push an Answer reply to doorbell, after all, as it's today, the doorbell keeps ringing even when you "answer a call" on HomeKit, what makes two-way audio not work!

Even that, the SDK is incredible because allow ring the doorbell in every connected device when someone press the button, something doesn't happen today.

Please, Koush, add these possibilites 🙏🏻

VCTGomes commented 1 year ago

Update1: the new Add-on update now allow me use motion sensor from doorbell to trigger automations too. I build a new automation on HASS based on doorbell motion sensor to trigger a webhook from Scrypted (just like button). It saves a lot of CPU usage!!!

It’s also possible to collect door status and even the installed alarm when someone break doorbell from wall.

Now the add-on is really completely and no missing feature. I think now it’s possible to get all infos and give all possible commands, making Hikvision doorbells one of the better one.

I hope Koush could fix this and add it too 🙏🏻🙏🏻

The currently method with webhooks works to receive motions and doorbells events, but it can’t fix the problem about ringing status, since that two way audio doesn’t work while it’s ringing, then I need to give and Reject or Answer call command to makes 2way audio works again.

koush commented 1 year ago

Are you not able to use ONVIF for the doorbell?

VCTGomes commented 1 year ago

Are you not able to use ONVIF for the doorbell?

Hi, Koush.

No. I think the KV6113 and some others doorbells from Hikvision isn't capable with Onvif. I even tried to add it as a Onvif doorbell, but it doesn't show any image.

I'm using Hikvision add-on with the doorbell toggle turned on. To use two-way audio I set the Hikvision protocol (onvif protocol doesn't work as well). It works pretty well, since the call stats isn't as "ringing", then, to be able to use it I push a reject call button from HASS plugin.

I wonder if it's possible to send the answer call command to doorbell before two-way audio starts. I can already collect button status using webhook+HASS plugin.

stibbzy commented 1 year ago

I’ve got the same doorbell. No Onvif support. I’ve also noticed the Home Assistant plug-in, but I’m not skilled enough to get the triggers working properly.

VCTGomes commented 1 year ago

I’ve got the same doorbell. No Onvif support. I’ve also noticed the Home Assistant plug-in, but I’m not skilled enough to get the triggers working properly.

Well, to trigger the doorbell I'm using an automation based on Hik-Connect add-on from HACS because it's being faster than Hikvision add-on (that's on Beta, so understandable), even working Cloud (rather Local/ISAPi as Hikvision add-on does).

Opening door is definitely much more faster using Hikvision Beta add-on than Hik-Connect, so I recommend you use it.

The method I'm using can trigger the notification on HomeKit, Alexa and more, but I wasn't able to "stop" ringing status to use two-way audio, so you see the image, but the doorbell will continue ringing and its speaker won't work till it stops.

I hope koush fix that soon.

But, if you want to use it even that, that's a quickly tutorial about what I did:

To set it up you need create a virtual device on Scrypted, so, on Scrypted, go to Scripts > Add new > Type any name and, on Template, select webhook-motion-sensor.ts. After doing that, it'll opens a page with some code, so you past it to change from motion sensor to binary sensor

class WebhookExample implements HttpRequestHandler {
    timeout: any;

    async onRequest(request: HttpRequest, response: HttpResponse) {
        response.send('OK');
        device.binaryState = true;
        // reset the motion sensor after 10 seconds.
        clearTimeout(this.timeout);
        this.timeout = setTimeout(() => device.binaryState = false, 10000);
    }
}

device.handleTypes(ScryptedInterface.BinarySensor);

endpointManager.getInsecurePublicLocalEndpoint(device.nativeId)
    .then(endpoint => console.log('motion webhook:', endpoint));

export default WebhookExample;

Further down, switch to Sensor and save.

image

Every time you open the following URL the binarySensor (doorbell button) will be triggered.

image

Now we need to create an entity on HA to trigger this URL. It's simple, you just open configuration.yaml using File Editor (download it on Add-on store) and past the following code

rest_command:
  doorbellbutton:
    url: "http://192.168.2.99:11080/endpoint/48/public/"
    payload: '?Doorbell'

If you did everything right you can create a new automation using RESTful command triggered by your doorbell event. You can you Hik-Connect HACS or Hikvision Beta Add-on.

image
stibbzy commented 1 year ago

Wow, thanks so much for the detailed reply. I will try this out and see how I go.

Pity we can’t stop the doorbell ringing :(

VCTGomes commented 1 year ago

You're welcome! I hope you get it.

I also forgot to tell you to create a grouped device. Just go to Device Groups and Add new, type a name and select the following devices.

image

You gonna use this device since now because it has our recently created binarySensor instead the broken Hikvision button.

That's also temporary because koush said on Discord he'll fix the integration and now with the entire SDK available with lots of documentations and plug-ins, I think he can adapt into Scrypted easily.

stibbzy commented 1 year ago

@VCTGomes I've been playing around with this for a bit and not having any luck. I don't think the script is working. Every time I run the url, I get an 'OK' status in the browser, but the status doesn't change and the console for the device doesn't change. In the script text, 'getInsecurePublicLocalEndpoint' is underlined and the popup says it is deprecated. The script icon is also an exclamation point. Is that why it wouldn't be working?

EDIT: Nevemind, it does seem to be working now, even though the endpoint is still listed as deprecated.

VCTGomes commented 1 year ago

@VCTGomes I've been playing around with this for a bit and not having any luck. I don't think the script is working. Every time I run the url, I get an 'OK' status in the browser, but the status doesn't change and the console for the device doesn't change. In the script text, 'getInsecurePublicLocalEndpoint' is underlined and the popup says it is deprecated. The script icon is also an exclamation point. Is that why it wouldn't be working?

EDIT: Nevemind, it does seem to be working now, even though the endpoint is still listed as deprecated.

Good to hear it’s working now haha.

stibbzy commented 1 year ago

@VCTGomes Unfortunately, I can't get the group to work as one doorbell device in Homekit. The script is being triggered correctly by home assistant, and every time I press the button the status of the binary sensor changes to true, then resets to false after 10 sec. But I don't receive any notification in Homekit. Do you add the binary sensor to Homekit via the Scripted bridge? If I do that, I get a seperate contact sensor that opens and closes when I press the doorbell button, but still no notifications from the doorbell accessory. It seems that the device group isn't working properly, even though I've added all the device interfaces you have shown, including the new binary sensor. I've also set the group type to 'sensor'. I'm a bit lost.

VCTGomes commented 1 year ago

Unfortunately, I can't get the group to work as one doorbell device in Homekit. The script is being triggered correctly by home assistant, and every time I press the button the status of the binary sensor changes to true, then resets to false after 10 sec. But I don't receive any notification in Homekit. Do you add the binary sensor to Homekit via the Scripted bridge? If I do that, I get a seperate contact sensor that opens and closes when I press the doorbell button, but still no notifications from the doorbell accessory. It seems that the device group isn't working properly, even though I've added all the device interfaces you have shown, including the new binary sensor. I've also set the group type to 'sensor'. I'm a bit lost.

Yeah. The new Binary Sensor must be grouped with doorbell camera.

Maybe you're pairing the old doorbell camera instead of the new grouped camera on homekit. Try to go to HomeKit section on the device from grouped devices. You must see two QR codes and one of than is the old camera and other is the new grouped camera + button

stibbzy commented 1 year ago

@VCTGomes Cheers. I confirmed I was doing all those steps correctly. Turns out, simply reloading the HomeKit plug-in wasn’t enough. I had to restart the Scrypted server. Working now!

VCTGomes commented 1 year ago

Oh! Glad to see everything is working now! 😄😄

I’m using it and impressed. Even face recognizing is working and notifies me on HomePod.

Now we just need to wait Koush implement a way to stop ringing status (or change it to answered) when a two-way audio connection is initialized to be able to use it.

When Koush fix these problems I’m pretty sure this doorbell has big chances to be one of the best doorbells you can use with Scrypted. It’s 100% local, it has motion sensor over ISAPi and even two-way audio via Hikvision protocol, it also uses PoE/WiFi and including a relay to open doors.

Excellent option.

VCTGomes commented 1 year ago

Hi Koush, here’s the console as you requested.

Console

listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. listen loop connection failed, restarting listener. Request failed with status code 401 unhandledRejection Error: Request failed with status code 401 at createError (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/core/createError.js:16:15) at settle (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/core/settle.js:17:12) at y. (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/adapters/http.js:238:9) at y.emit (node:events:513:28) at y.emit (node:domain:489:12) at y._processResponse (/node_modules/follow-redirects/index.js:351:10) at ClientRequest._onNativeResponse (/node_modules/follow-redirects/index.js:57:10) at Object.onceWrapper (node:events:628:26) at ClientRequest.emit (node:events:513:28) at ClientRequest.emit (node:domain:489:12) { config: { url: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', method: 'get', headers: { Accept: 'application/json, text/plain, */*', authorization: 'Digest username="admin", realm="DS-E0C4467D", nonce="MzRiMjkzZDhiOTY3OTJjZTU0Y2E4NjMxYTI5YjU5Yjk=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="c1446d4a3b49974da3c459169e91067d", nc="[00002564](tel:00002564)", cnonce="3a4ec475ca411665d76e183dbeb7dadfce9469769971d6a3"', 'User-Agent': 'axios/0.21.4' }, transformRequest: [ [Function (anonymous)] ], transformResponse: [ [Function (anonymous)] ], timeout: 0, adapter: [Function (anonymous)], responseType: 'stream', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype] {}, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 0, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(kCapture)]: false }, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, data: undefined }, request: ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: null, _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 124324, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: true, [Symbol(kSetKeepAlive)]: false, [Symbol(kSetKeepAliveInitialDelay)]: 0, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, _header: 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'authorization: Digest username="admin", realm="DS-E0C4467D", nonce="MzRiMjkzZDhiOTY3OTJjZTU0Y2E4NjMxYTI5YjU5Yjk=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="c1446d4a3b49974da3c459169e91067d", nc="[00002564](tel:00002564)", cnonce="3a4ec475ca411665d76e183dbeb7dadfce9469769971d6a3"\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: 192.168.2.100\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/ISAPI/Event/notification/alertStream', _ended: false, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 401, statusMessage: 'Unauthorized', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 16, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.2.100', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], authorization: [Array], 'user-agent': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 401, statusText: 'Unauthorized', headers: { date: 'Mon, 24 Apr 2023 17:32:07 GMT', server: 'webs', 'content-length': '393', connection: 'close', 'x-frame-options': 'SAMEORIGIN', 'cache-control': 'no-store', pragma: 'no-cache', 'content-type': 'application/xml' }, config: { url: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', method: 'get', headers: [Object], transformRequest: [Array], transformResponse: [Array], timeout: 0, adapter: [Function (anonymous)], responseType: 'stream', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: [Agent], validateStatus: [Function: validateStatus], transitional: [Object], data: undefined }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'authorization: Digest username="admin", realm="DS-E0C4467D", nonce="MzRiMjkzZDhiOTY3OTJjZTU0Y2E4NjMxYTI5YjU5Yjk=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="c1446d4a3b49974da3c459169e91067d", nc="[00002564](tel:00002564)", cnonce="3a4ec475ca411665d76e183dbeb7dadfce9469769971d6a3"\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: 192.168.2.100\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/ISAPI/Event/notification/alertStream', _ended: false, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.2.100', protocol: 'http:', _redirectable: [Writable], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(kUniqueHeaders)]: null }, data: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 401, statusMessage: 'Unauthorized', client: [Socket], _consuming: false, _dumped: false, req: [ClientRequest], responseUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 16, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 } }, isAxiosError: true, toJSON: [Function (anonymous)] } debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. ######################## 4/24/2023, 5:35:02 PM ######################## debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. ######################## 4/24/2023, 5:40:06 PM ######################## debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. ######################## 4/24/2023, 5:45:10 PM ######################## debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. debug event: listen loop closed, restarting listener. listen loop connection failed, restarting listener. Request failed with status code 401 unhandledRejection Error: Request failed with status code 401 at createError (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/core/createError.js:16:15) at settle (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/core/settle.js:17:12) at y. (/node_modules/@koush/axios-digest-auth/node_modules/axios/lib/adapters/http.js:238:9) at y.emit (node:events:513:28) at y.emit (node:domain:489:12) at y._processResponse (/node_modules/follow-redirects/index.js:351:10) at ClientRequest._onNativeResponse (/node_modules/follow-redirects/index.js:57:10) at Object.onceWrapper (node:events:628:26) at ClientRequest.emit (node:events:513:28) at ClientRequest.emit (node:domain:489:12) { config: { url: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', method: 'get', headers: { Accept: 'application/json, text/plain, */*', authorization: 'Digest username="admin", realm="DS-E0C4467D", nonce="Yjg2NjFkYjFiNzAzZDljYTAxNmRlNzNlMGE1ZGEwMzM=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="47d9f140d6023a54e1239d73fc7901ea", nc="[00002644](tel:00002644)", cnonce="183771d9208be71be55c745084419d164332aa8a18dde531"', 'User-Agent': 'axios/0.21.4' }, transformRequest: [ [Function (anonymous)] ], transformResponse: [ [Function (anonymous)] ], timeout: 0, adapter: [Function (anonymous)], responseType: 'stream', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype] {}, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 0, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(kCapture)]: false }, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, data: undefined }, request: ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: Socket { connecting: false, _hadError: false, _parent: null, _host: null, _closeAfterHandlingError: false, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, parser: null, _httpMessage: [Circular *1], [Symbol(async_id_symbol)]: 128228, [Symbol(kHandle)]: [TCP], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: true, [Symbol(kSetKeepAlive)]: false, [Symbol(kSetKeepAliveInitialDelay)]: 0, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, _header: 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'authorization: Digest username="admin", realm="DS-E0C4467D", nonce="Yjg2NjFkYjFiNzAzZDljYTAxNmRlNzNlMGE1ZGEwMzM=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="47d9f140d6023a54e1239d73fc7901ea", nc="[00002644](tel:00002644)", cnonce="183771d9208be71be55c745084419d164332aa8a18dde531"\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: 192.168.2.100\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/ISAPI/Event/notification/alertStream', _ended: false, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 401, statusMessage: 'Unauthorized', client: [Socket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 16, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 }, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.2.100', protocol: 'http:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', [Symbol(kCapture)]: false }, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], authorization: [Array], 'user-agent': [Array], host: [Array] }, [Symbol(kUniqueHeaders)]: null }, response: { status: 401, statusText: 'Unauthorized', headers: { date: 'Mon, 24 Apr 2023 17:45:38 GMT', server: 'webs', 'content-length': '393', connection: 'close', 'x-frame-options': 'SAMEORIGIN', 'cache-control': 'no-store', pragma: 'no-cache', 'content-type': 'application/xml' }, config: { url: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', method: 'get', headers: [Object], transformRequest: [Array], transformResponse: [Array], timeout: 0, adapter: [Function (anonymous)], responseType: 'stream', xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, httpsAgent: [Agent], validateStatus: [Function: validateStatus], transitional: [Object], data: undefined }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'GET /ISAPI/Event/notification/alertStream HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'authorization: Digest username="admin", realm="DS-E0C4467D", nonce="Yjg2NjFkYjFiNzAzZDljYTAxNmRlNzNlMGE1ZGEwMzM=", uri="/ISAPI/Event/notification/alertStream", qop="auth", algorithm="MD5", response="47d9f140d6023a54e1239d73fc7901ea", nc="[00002644](tel:00002644)", cnonce="183771d9208be71be55c745084419d164332aa8a18dde531"\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: 192.168.2.100\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/ISAPI/Event/notification/alertStream', _ended: false, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.2.100', protocol: 'http:', _redirectable: [Writable], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kEndCalled)]: true, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(kUniqueHeaders)]: null }, data: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 1, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 401, statusMessage: 'Unauthorized', client: [Socket], _consuming: false, _dumped: false, req: [ClientRequest], responseUrl: 'http://192.168.2.100:80/ISAPI/Event/notification/alertStream', redirects: [], [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 16, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 } }, isAxiosError: true, toJSON: [Function (anonymous)] } debug event: listen loop closed, restarting listener. debug event:

VCTGomes commented 1 year ago

Talking with Pergola Fabio I discovered the problem is happening because the most part of Hikvision doorbells doesn’t support ISAPi completely.

It looks like only Hik cameras are able to send events using ISAPi. Doorbells can use the SDK

IMG_0044

It explain the reason my log above shows the try and fail to connecting to doorbells.

My biggest problem is only when someone press the ring button and I’m not able to use Two way audio until it stops ringing. Please, Koush, add the reject command immediately when someone open the two way audio connection.

Doorbells and motion events I can use using the webhooks and scrip.

z9carbriogt commented 1 year ago

Thank You for this thread. Now I have a working doorbell!

For my setup, I use only KV6113 outdoor unit. I use Asterisk custom add-on for home assistant to play custom doorbell sound when button is press and then hang up immediately to allow two-way audio. Everything works nicely.

I also use Pergola Fabio's Hikvision add-on, and try to do the Asterisk add-on from there. But I don't have indoor unit, so I have to figure a way myself.

[1000] type = aor max_contacts = 1

[auth1000] type=auth auth_type=userpass password=1000 ; Set your password here username=1000

- Edit the extensions.conf to configure what to do when button is press.

; Note: this file has been modified from the Asterisk defaults for the add-on

exten => 1111,1,NoOp same => n,Playback(doorbell-short) same => n,Wait(1) same => n,Hangup() ; [parkedcallstimeout] exten => s,1,Hangup()


- Configure the add-on to use the "en" language folder. 
![image](https://github.com/koush/scrypted/assets/72846986/db3c3c60-3924-42cb-a19b-000362141f82)
- Restart add-on.
- Download or select a sound file, I search on Pixabay and then convert to mono PCM 8k 16bit .wav file, and named it doorbell-short.wav and put it in media/asterisk/sound/en folder
- Restart add-on again.
- Login to outdoor unit configuration page and connect the outdoor unit directly to Asterisk from Network>Basic Settings>SIP page. Put in username, password from pjsip_custom.conf and server IP of HAOS. If you do everything correctly, the "Register Status" will be "Registered"
![image](https://github.com/koush/scrypted/assets/72846986/5396e7a2-83c0-404b-8025-4b915ce33294)
- Go to Intercom>Press Button to Call and note the number in "Button Settings"
- Go to Intercom>Number Settings and click +Add - Room No. to number in "Button Settings" and SIP1 to extension number that used in extensions.conf
![image](https://github.com/koush/scrypted/assets/72846986/0b2b87cd-bc4f-44b2-b1c9-921963ecb8e7)

- Now test your doorbell! you should hear your custom doorbell sound and nothing else.
VCTGomes commented 1 year ago

Excellent news! I have the indoor unit. Do you know if the indoor continue working even doing these steps? I'll try to do that using SIP after all. Is it possible export asterisk to HomeKit as Scrypted does?

z9carbriogt commented 1 year ago

I do not have the indoor unit. But I think that in that case, you should follow Pergola Fabio instructions to use SIP trunk. here

Also, I think that Asterisk work as a separate service and install as add-on to home assistant, so no need to export to HomeKit.

VCTGomes commented 1 year ago

I do not have the indoor unit. But I think that in that case, you should follow Pergola Fabio instructions to use SIP trunk. here

Also, I think that Asterisk work as a separate service and install as add-on to home assistant, so no need to export to HomeKit.

Thanks! I tried to set up the SIP, but instead of using Asterisk, I tried to use SIP Add-on from Scrypted. Unfortunately the image is black on Scrypted and I dunno if it's the expected behavior and the image could show up if someone press the button.

image

Tomorrow morning I'll do the test and check if the script from Fábio is working too.

z9carbriogt commented 1 year ago

As far as I know, the KB6113 do not have snapshot function (as many CCTV camera do). I use snapshot plugin and use prebuffer as snapshot.

image

I don't use SIP on scrypted so I don't know what to do.

VCTGomes commented 1 year ago

As far as I know, the KB6113 do not have snapshot function (as many CCTV camera do). I use snapshot plugin and use prebuffer as snapshot.

image

I don't use SIP on scrypted so I don't know what to do.

Tks. It looks like the doorbell create its own SIP to communicate to indoor panel, so I could use this SIP to looks like an second indoor panel, unfortunately the SIP with Scrypted isn't working as I expected... I tried to following the tutorial, but replacing Asterisk to Scrypted, however the image continues black 😢😞 I'll try to use Asterisk, but first I need to understand how it works haha

Anyway, I really hope Koush fix the Hikvision integration 🙏🏻

cerahmed commented 1 year ago

Hi @VCTGomes,

Great discussion. I'm currently trying to setup the same Hikvision Doorbell with Homekit through Scrypted. This discussion seems to be a few months old; any updates on how the doorbell is configured without the need to use HA?

VCTGomes commented 1 year ago
  1. On Scrypted, open Scripts option (left bar) and than "Add new", to create a new script and webhook link.
  2. On name, white something easy, like "Hikvision button" and select "webhook-motion-sensor.ts" as template.
  3. It must open a new scree, than you just replace the following code on script page
class WebhookExample implements HttpRequestHandler {
    timeout: any;

    async onRequest(request: HttpRequest, response: HttpResponse) {
        response.send('OK');
        device.binaryState = true;
        // reset the motion sensor after 10 seconds.
        clearTimeout(this.timeout);
        this.timeout = setTimeout(() => device.binaryState = false, 10000);
    }
}

device.handleTypes(ScryptedInterface.BinarySensor);

endpointManager.getInsecurePublicLocalEndpoint(device.nativeId)
    .then(endpoint => console.log('motion webhook:', endpoint));

export default WebhookExample;
  1. Scroll page and, on type, select "Sensor" and save.

  2. Update the page and copy the motion webhook link. You can try open this link and see if the circle changes to Binary State True/False. If it's showing "No motion detected" something is wrong and you can try to update until scrypted update it.

    Captura de Tela 2023-09-14 às 20 19 32
  3. Now, back to Scrypted home and install the Dummy Switch Plugin. It'll allow us to export button to any camera/doorbell.

  4. Open the settings page from Hikvision or any camera you want this button, press Extensions and enable Custom Doorbell Button and than just select the button we just created. Oh, don't forgot to define this camera as doorbell in Edit page form same settings page.

Now everything must be set up on Scrypted, so we need to integrate with Home Assistant and Hikvision Doorbell plugin.

To do that, you need to install some File Editor add-on to allow us create a rest command, which will trigger the webhook we created on Scrypted.

  1. Open the File Editor and configuration.yaml
  2. On configuration.yaml, past the following the code above, replacing the webhook
    
    rest_command:
    doorbellbutton:
    url: "WEB HOOKS YOU CREATED ON SCRYPTED"
    payload: '?hikvision-button'

3. Restart the HomeAssistant and create new automation.
4. Select the Hikvision doorbell exported from Hikvision Doorbell in the Entities to trigger the REST command we've created. On action, select "Start service" and find the RESTful Command.

Done! 
VCTGomes commented 1 year ago

Hi @VCTGomes,

Great discussion. I'm currently trying to setup the same Hikvision Doorbell with Homekit through Scrypted. This discussion seems to be a few months old; any updates on how the doorbell is configured without the need to use HA?

Unfortunately I don't know it. It something only Koush could fix and I don't have any news until now.

There's some workaround like try to use SIP, but it's much complicated, so I gave up haha.

cerahmed commented 1 year ago

Hi @VCTGomes, Great discussion. I'm currently trying to setup the same Hikvision Doorbell with Homekit through Scrypted. This discussion seems to be a few months old; any updates on how the doorbell is configured without the need to use HA?

Unfortunately I don't know it. It something only Koush could fix and I don't have any news until now.

There's some workaround like try to use SIP, but it's much complicated, so I gave up haha.

Thanks for the reply and great guides. I have been trying to find some online resources on how to use SIP, have you got any? I might as well try it out and provide you with my findings.

Davensen commented 1 year ago

Thank You for this thread. Now I have a working doorbell!

For my setup, I use only KV6113 outdoor unit. I use Asterisk custom add-on for home assistant to play custom doorbell sound when button is press and then hang up immediately to allow two-way audio. Everything works nicely.

I also use Pergola Fabio's Hikvision add-on, and try to do the Asterisk add-on from there. But I don't have indoor unit, so I have to figure a way myself.

* Copy the pjsip_custom.conf and extensions.conf form config>asterisk>default to custom folder.

* Edit the pjsip_custom.conf to add extension of the doorbell.
; Place your custom extensions here
[1000]
type = endpoint
context = default
disallow = all
allow = alaw,ulaw          ; Audio codecs
allow=h264                 ; Video codecs
direct_media_method=invite
dtmf_mode=info
callerid="Doorbell" <1000>
force_rport=no
aors= 1000
auth = auth1000

[1000]
type = aor
max_contacts = 1

[auth1000]
type=auth
auth_type=userpass
password=1000        ; Set your password here
username=1000
* Edit the extensions.conf to configure what to do when button is press.
; Note: this file has been modified from the Asterisk defaults for the add-on

exten => 1111,1,NoOp
  same => n,Playback(doorbell-short)
  same => n,Wait(1)
  same => n,Hangup()
;
[parkedcallstimeout]
exten => s,1,Hangup()
* Configure the add-on to use the "en" language folder.
  ![image](https://user-images.githubusercontent.com/72846986/244626303-db3c3c60-3924-42cb-a19b-000362141f82.png)

* Restart add-on.

* Download or select a sound file, I search on Pixabay and then convert to mono PCM 8k 16bit .wav file, and named it doorbell-short.wav and put it in media/asterisk/sound/en folder

* Restart add-on again.

* Login to outdoor unit configuration page and connect the outdoor unit directly to Asterisk from Network>Basic Settings>SIP page. Put in username, password from pjsip_custom.conf and server IP of HAOS. If you do everything correctly, the "Register Status" will be "Registered"
  ![image](https://user-images.githubusercontent.com/72846986/244627964-5396e7a2-83c0-404b-8025-4b915ce33294.png)

* Go to Intercom>Press Button to Call and note the number in "Button Settings"

* Go to Intercom>Number Settings and click +Add - Room No. to number in "Button Settings" and SIP1 to extension number that used in extensions.conf
  ![image](https://user-images.githubusercontent.com/72846986/244629569-0b2b87cd-bc4f-44b2-b1c9-921963ecb8e7.png)

* Now test your doorbell! you should hear your custom doorbell sound and nothing else.

Astersisk won´t load your config - can u help please ?

asafalfa commented 11 months ago

Can someone please fix it? that will really help

koush commented 8 months ago

There's a new hikvision doorbell plugin, can someone test and let me know how it works?

VCTGomes commented 8 months ago

Working fine here with 6113 B. I’m receiving doorbell events and calls ends when I open two way audio channel.

Volume from two way audio is a little bit low, but I don’t know if it’s a plugin problem.

VCTGomes commented 8 months ago

vityevato has released an incredible plugin called Hikvision Doorbell Plugin, that fix all problems with Hikvision Doorbells, or at least the DS-KV6113-WPE1(B) model (I have here).

This plugin receive motion events, ringing events, supports two-way audio and can even dismiss the call when I open two-way audio, making possible to receive calls over Scrypted, Apple Home and more.

No extra setup is required, making it super easy to use.

The plugin can be found on Scrypted page.

Congrats, vityevato. You're awesome and now we have one of the bests doorbells to Scrypted.

MBarti commented 8 months ago

@VCTGomes I have a very similar doorbell (DS-KV8113-WME1 with the indoor module, connected to hikvision cloud) and have also tried the new doorbell plugin and I can get the doorbell added to Homekit. The camera works fine, but no calls are received. Can you please share how you set up your settings?

Thank you for your help

OwlBawl commented 3 months ago

Maybe someone can help? Using Scrypted with Hikvision Doorbell Plugin with Fake SiP Set to work Homekit, Motion detection, Doorbell Ring event, Can talk to Doorbell from HK when in still mode.

But Can't Talk back when incoming ring event - Pressing "Talk" button doesn't drop ring and audio not working so far. Are there any setting I should check? Would appreciate any help.

cerahmed commented 3 months ago

But Can't Talk back when incoming ring event - Pressing "Talk" button doesn't drop ring and audio not working so far.

I'm facing the same issue. @VCTGomes mind helping with your settings?

Edit: Hey @Stillness-2, sorry for tagging but just came to know you're the developer behind the awesome hikvision-doorbell plugin. Many thanks for the awesome work! Appreciate if you could provide some insight on how to get the two-way audio to stop the doorbell from ringing and actually enter a two-way call. Much appreciated.

vityevato commented 3 months ago

@OwlBawl Does your setup include an indoor station?

cerahmed commented 3 months ago

@Stillness-2 my setup does. Is the configuration different when the doorbell is connected to an indoor station?

vityevato commented 3 months ago

@cerahmed in this situation you cannot use Fake SIP. Experiments have shown that if the doorbell is connected to an indoor station, then the only way for it to work is to select the Don't Use SIP mode in the plugin settings, and hik-connect must be configured on the doorbell. Unfortunately it doesn’t work any other way, doorbell firmware features

vityevato commented 3 months ago

It is important to configure the doorbell to connect to hik-connect in case when doorbell connected to indoor station

OwlBawl commented 3 months ago

@OwlBawl Does your setup include an indoor station?

Yes

vityevato commented 3 months ago

@OwlBawl I have already written an action plan above :)

cerahmed commented 3 months ago

@cerahmed in this situation you cannot use Fake SIP.

Thanks for the insight! I'll check it as soon as I get back home. As an alternative option, can I use the doorbell (version B) as a stand alone without hik-connect or indoor station and the two-way audio will successfully hang up the incoming call?

vityevato commented 3 months ago

@cerahmed My installation does not have an indoor station, and there is no separate SIP server, and the plugin was tested under such conditions. :) In this case, you need to use the Fake SIP mode of the plugin, and you do not need to connect to hik-connect.

cerahmed commented 3 months ago

@Stillness-2 Perfect! Sounds like I can get rid of my indoor station. I was confused as I cannot identify my actual device version (B or C, it's not mentioned in the System Information section) but most likely it's a B model as I bought it together with the indoor station, and I thought I had to have the indoor station for it to function.

I'll give it a try and will let you know how it goes. Many thanks again! :D

vityevato commented 3 months ago

@cerahmed I tested on DS-KV6113PE1[C], but I think that version B is just another revision, which is the same in functionality. But you need to check :)

cerahmed commented 3 months ago

I finally got something to work! Many thanks @Stillness-2 for the heads up!

My Setup:

a) Device: DS-KV6113-PE1 (no indication for version - but seemingly the B version as it doesn't seem to work without the indoor station) b) Firmware version: V2.2.53 build 220901 (Latest) c) POE.

I tried the following:

1) Reset the device., reconfigured with Static IP, and tried enabling the Emulated SIP in the plugin with Automatic Configuration. I made sure that the SIP with the fake server is configured correctly in the DS-6113 page. Clicking the call button only plays "Calling Failed".

2) Configured the DS-6113 with my indoor station, tried with No SIP/Emulated SIP, works but two-way audio doesn't stop the ringing.

3) Kept the indoor station configured with the doorbell, disabled SIP in both the doorbell + the plugin configuration, and enabled Hik-connect in the doorbell page. Everything works like a charm!

I've loved for option#1 to work to completely not depend on Hik-connect, but I'll give it another shot.

asafalfa commented 3 months ago

I wish someone could give a step by step guide or even a youtube explanation ... The hikvision intercom works sucks in all case senarios when it comes to work with home assistant .

On Mon, Jul 29, 2024 at 6:28 PM cerahmed @.***> wrote:

I finally got something to work! Many thanks @Stillness-2 https://github.com/Stillness-2 for the heads up!

My Setup:

a) Device: DS-KV6113-PE1 (no indication for version - but seemingly the B version as it doesn't seem to work without the indoor station) b) Firmware version: V2.2.53 build 220901 (Latest) c) POE.

I tried the following:

1.

Reset the device., reconfigured with Static IP, and tried enabling the Emulated SIP in the plugin with Automatic Configuration. I made sure that the SIP with the fake server is configured correctly in the DS-6113 page. Clicking the call button only plays "Calling Failed". 2.

Configured the DS-6113 with my indoor station, tried with No SIP/Emulated SIP, works but two-way audio doesn't stop the ringing. 3.

Kept the indoor station configured with the doorbell, and (correctly) connected to Hik-connect. Everything works like a charm!

I've loved for option#1 to work to completely not depend on Hik-connect, but I'll give it another shot.

— Reply to this email directly, view it on GitHub https://github.com/koush/scrypted/issues/533#issuecomment-2256243073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMVVWXEO7QG5YOJ2TKOPS6TZOZNTNAVCNFSM6AAAAAAUH3UXJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGI2DGMBXGM . You are receiving this because you commented.Message ID: @.***>

cerahmed commented 3 months ago

@asafalfa What device do you have? I can help if it is similar to mine.