Doorbell Press Event

Have a Smart Feature idea/Request Post them here.
Post Reply
jduda
Posts: 2
Joined: Sun Jan 17, 2021 4:00 pm

Doorbell Press Event

Post by jduda »

I have one of these AD110 doorbells installed. I purchased this particular device because it supports rtsp streaming.

I have my own home automation software which takes advantage of the rtsp streaming for recording the video.

I would like to get a notification that the doorbell button has been pressed so that my home automation software can provide an audio even to the humans in the house that someone is at the door.

I have downloaded the http API documentation but I don't see anything obvious that I can use as some doorbell button pressed event.

I would like to "query" or "snoop" for a broadcast event to indicate that a doorbell button has been pressed. It would be perfectly acceptable to use the html API to query the event status to indicate the doorbell button has been pressed in the last 1 or 2 seconds (or more).
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: Doorbell Press Event

Post by GaryOkie »

Hi @jduda

You can use the API to set up an event listener app by attaching either the SmartHome-specific code _DoTalkAction_ or the more general CallNoAnswered. Either of these will signal immediately when the doorbell button is pressed.

There is code in this forum from @pcabral who set up a motion detection listener for his Synology that runs in a shell. It could be adapted for button presses and triggering events on other systems.

There is also an extensive discussion on GitHub python-amcrest for doorbell press support. This library is used by Home Assistant and others. See https://github.com/tchellomello/python- ... issues/137 for some working python code examples.

As to formal Amcrest SmartHome API documentation, it doesn't exist or will not be published.
jduda
Posts: 2
Joined: Sun Jan 17, 2021 4:00 pm

Re: Doorbell Press Event

Post by jduda »

That sample code from the amcrest python library was exactly what I was hoping for. Thank you very much for posting that.

Regards,

Jim
ExTechjunkie
Posts: 38
Joined: Mon Oct 05, 2020 9:50 pm

Re: Doorbell Press Event

Post by ExTechjunkie »

When using the HTTP API to talk to the cameras (or in my application, the NVR), how is authentication managed? I'm trying to write a script to automate a change of settings and I need to overcome the userID and password prompt. I've tried basic authentication with HTTP headers but that doesn't work. What authentication method are we dealing with exactly? Thanks.
User avatar
longedge
Site Admin
Posts: 584
Joined: Fri Mar 31, 2017 9:34 am

Re: Doorbell Press Event

Post by longedge »

ExTechjunkie wrote: Mon Mar 15, 2021 3:22 pmI need to overcome the userID and password prompt.
This is something that I've struggled with (and failed). I was looking at starting a timer and using the event to keep checking for the dialogue box and then calling an AUTOIT script to automatically click the OK button if found, but it was just too clunky. Although Windows will 'remember' the user credentials after the first occasion the OS security still always 'asks' for confirmation.

If you do find an answer, I for one would appreciate it if you posted back here with your solution :)
My AMCREST Cameras:-
2 x IP3M-941B firmware V2.620.00AC00.3.R, Build Date: 2019-12-18
1 x IP2M-841B firmware V2.420.AC00.18.R, Build Date: 2019-08-03
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: Doorbell Press Event

Post by GaryOkie »

Hi @ExTechjunkie

You simply preface the IP address with http://userid:password@ipaddress

All Amcrest/Dahua devices use Digest Authentication for several years now. Really old devices may still be using Basic.

@longedge it's not clear to me that you are using the http CGI API, so this reply may not be relevant for what you are trying to do.
User avatar
longedge
Site Admin
Posts: 584
Joined: Fri Mar 31, 2017 9:34 am

Re: Doorbell Press Event

Post by longedge »

@GaryOkie
I'll explain my own post a little further and I was guessing that it was a similar situation/question that was being raised.

I take regular snapshots with my cameras, change the file names to a static name and then upload them to my web space. The web pages load the new images when anybody visits my site because they have static names i.e. always the same.

I've created my own app which almost does all this automatically without any intervention from me but the stumbling block is the Windows Security challenge. This screenshot shows what I'm talking about, here I've already clicked OK once and now have to click OK again to grab the second and same again for the third.
screenshot.jpg
screenshot.jpg (120.05 KiB) Viewed 15608 times
The call that gets the snapshot is - http://xxxx:[email protected]/cgi-bin/snapshot.cgi (where xxxx is username:password) and the result is saved to a folder where each is renamed and then ftp'd to my webspace. As I said all without any input from me except for clicking OK 3 times.

The ultimate aim was to leave my app running 24/7. A timer would run the process perhaps at half hourly intervals.
My AMCREST Cameras:-
2 x IP3M-941B firmware V2.620.00AC00.3.R, Build Date: 2019-12-18
1 x IP2M-841B firmware V2.420.AC00.18.R, Build Date: 2019-08-03
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: Doorbell Press Event

Post by GaryOkie »

I was answering the OP on how to pass credentials to the camera via http CGI API, which you are already doing. I should have added that if using cURL in an app, digest authentication is specified this way:
curl -g --digest -u <user>:<password> "http://<camera-ip>/cgi-bin/.../.../"

In your case, I guess the Windows authentication prompt is from the connection to a Windows server to save the files?
ExTechjunkie
Posts: 38
Joined: Mon Oct 05, 2020 9:50 pm

Re: Doorbell Press Event

Post by ExTechjunkie »

GaryOkie wrote: Tue Mar 16, 2021 8:06 am Hi @ExTechjunkie

You simply preface the IP address with http://userid:password@ipaddress

All Amcrest/Dahua devices use Digest Authentication for several years now. Really old devices may still be using Basic.
Thanks. I'd tried that already with no success. Apparently, none of my browsers support that authentication method any longer.

I was able to write a powershell script though and pass the creds that way (had to remember to use https instead of http or it wouldn't pass the credential).
Post Reply