Reolink doorbell finally supports webhooks

Hi folks,

I had installed last year a Reolink video doorbell (D340P). Recently Reolink has added webhook support, which I find quite exiting news...

The doorbell in a nutshell

They have a wifi version, but I bought a POE version.

It has been working fine and contains most of the stuff that I want:

  • It offers Onvif, so you can use it in Node-RED using my Onvif node.
  • You don't need to pay monthly subscription to store your video recordings in the cloud. Not going to pay for my own video recordings that I made with my own camera. Dough :thinking:
  • Optionally you could even put an SD card into it, to store your recordings locally.
  • You can push your recordings automatically via ftp on your NAS.
  • It is rather affordable, so fortunately I didn't need to sell my kidneys to buy one.
  • It contains AI people and vehicle detection. Sometimes a false positive people detected, but I find it quite good.
  • And so on...

However I had overlooked one thing: it doesn't contain a relay to activate my existing ding-dong doorbells (like my old classic doorbell button did). So they include the white chime in the box, but I wanted to reuse my existing ding-dong doorbells.

Onvif workaround

Since the doorbell doesn't have a relay inside, I had to use this workaround:

[{"id":"e15689d5095f1f04","type":"switch","z":"bfe334aca9927858","name":"Event?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"RuleEngine/MyRuleDetector/Visitor","vt":"str"},{"t":"eq","v":"VideoSource/MotionAlarm","vt":"str"},{"t":"eq","v":"RuleEngine/CellMotionDetector/Motion","vt":"str"},{"t":"eq","v":"RuleEngine/MyRuleDetector/FaceDetect","vt":"str"},{"t":"eq","v":"RuleEngine/MyRuleDetector/PeopleDetect","vt":"str"},{"t":"eq","v":"RuleEngine/MyRuleDetector/VehicleDetect","vt":"str"},{"t":"eq","v":"RuleEngine/MyRuleDetector/DogCatDetect","vt":"str"},{"t":"eq","v":"RuleEngine/MyRuleDetector/Package","vt":"str"}],"checkall":"true","repair":false,"outputs":8,"x":480,"y":120,"wires":[["c64d713bf880d48b"],[],[],[],[],[],[],[]],"outputLabels":["Bezoeker (knop gedrukt)","Video beweging","Cel beweging","Gezicht herkend","Persoon herkend","Voertuig herkend","Hond of kant herkend","Pakket herkend"]},{"id":"a8f7752e.2998f8","type":"onvif-events","z":"bfe334aca9927858","name":"","deviceConfig":"c6b46a46.8067f8","action":"","x":310,"y":120,"wires":[["e15689d5095f1f04"]]},{"id":"748f5110.c57f7","type":"inject","z":"bfe334aca9927858","name":"Start","props":[{"p":"action","v":"start","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"10","topic":"","x":150,"y":120,"wires":[["a8f7752e.2998f8"]]},{"id":"c64d713bf880d48b","type":"function","z":"bfe334aca9927858","name":"Button pressed?","func":"if (msg.property === 'Changed' && msg.data.value === true) {\n   node.send(msg)\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":80,"wires":[["7fa9e92b642d6049"]]},{"id":"e249237b10d4b3c1","type":"inject","z":"bfe334aca9927858","name":"Simulate button press","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"id\":123,\"src\":\"testtopic\",\"method\":\"Switch.Set\",\"params\":{\"id\":0,\"on\":true}}","payloadType":"json","x":700,"y":140,"wires":[["7fa9e92b642d6049"]],"info":"Simuleren dat er op de Reolink deurbel knop geklikt is geworden, om de Shelly Switch onafhankelijk te kunnen testen."},{"id":"7fa9e92b642d6049","type":"mqtt out","z":"bfe334aca9927858","name":"Set switch state (via MQTT)","topic":"shellyplus1-d48afc449238/rpc","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e1a601ccc051bb83","x":960,"y":80,"wires":[]},{"id":"c6b46a46.8067f8","type":"onvif-config","xaddress":"192.168.1.21","port":"80","timeout":"10","checkConnectionInterval":"5","name":"Reolink deurbel"},{"id":"e1a601ccc051bb83","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

Which has been working fine all time like this:

  1. Every hour I injected a message to make sure my Onvif node kept listening to Onvif events.
  2. When an Onvif event arrived, I used a large Switch node to split all different topics, because the doorbell will send messages for all kind of events.
  3. After some extra checking to only filter the doorbell press events, a message is send via MQTT to a Shelly Switch 1 Plus relay (WIFI).
  4. The relais closes, so the ding-dong doorbell is activated.

But in my house everything should keep working even when Node-RED is offline, I case I won't be around on this planet anymore... Node-RED is only used to provide some nice extra features, like e.g. voice control. However using this workaround Node-RED needs to be alive, otherwise our doorbell won't work anymore...

Solution via webhooks

Note: a webhook is an HTTP request, triggered by an event in a source system and sent to a destination system, often with a payload of data (which means a POST request).

There were already lots of users asking Reolink to provide a webhook feature, and I joined them with my own feature request. And finally Reolink has added the webhook feature to their doorbell devices firmware :champagne:

I am explaining it here, because currently it is not documented yet:

  1. In the doorbell web interface navigate to the new feature:

  2. I added 2 webhooks:

  3. There is also a "Test" button, so you don't always need to get up from your lazy chair to press the physical button over and over again while experimenting:

When a user presses the doorbell button, the webhook url will be called:

  • For the first webhook the url is http://<ip_address_shelly_1_switch/rpc and the custom content is { "id": 1, "method": "Switch.Set", "params": { "id": 0, "on": true } }, which is used to close the Shelly Switch 1 Plus relay. That way the ding-dong doorbell is activated without Node-RED in between:

    CAUTION: you really need an rpc command request for this, because the standard Shelly api command to close the relay (http://<ip_address_shelly_1_switch>/relay/0?turn=on) won't work for POST requests. It will on the other hand when you enter it in your browser, because then you will send a GET request... Thanks to @geoffreydemaagd for this tip!

  • For the (optional) second webhook the url is http://<ip_address_node_red>:1880/doorbell to send the same command to Node-RED, in case you would like to do extra stuff when the doorbell button is clicked (or the AI detects a person or vehicle):

    [{"id":"59ff2a1.fa600d4","type":"http in","z":"bfe334aca9927858","name":"","url":"/doorbell","method":"post","upload":false,"swaggerDoc":"","x":920,"y":400,"wires":[["54c1e70d.ab3e18","c3e8aa6527c9a0ab"]]},{"id":"54c1e70d.ab3e18","type":"template","z":"bfe334aca9927858","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n    <head></head>\n    <body>\n        <h1>Hello Doorbell</h1>\n    </body>\n</html>","x":1090,"y":400,"wires":[["266c286f.d993d8"]]},{"id":"266c286f.d993d8","type":"http response","z":"bfe334aca9927858","name":"","x":1230,"y":400,"wires":[]},{"id":"c3e8aa6527c9a0ab","type":"debug","z":"bfe334aca9927858","name":"debug 2532","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1110,"y":460,"wires":[]}]
    

    When the doorbell button is pushed, the doorbell will send a POST request to the Http-In node. So we send a dummy response (via the Template and Http_out nodes), to make sure the doorbell gets a success message. The debug node shows the following message arriving:

    {
        "payload": {
            "alarm": {
                "alarmTime": "2024-12-10T21:01:46.000+0000",
                "channel": 0,
                "channelName": "Reolink Video Doorbell PoE",
                "device": "Reolink Video Doorbell PoE",
                "deviceModel": "Reolink Video Doorbell PoE",
                "message": "Visitor Detected from Reolink Video Doorbell PoE",
                "name":"Visitor Alert",
                "title":"Visitor message",
                "type":"VISITOR"
            }
        }
    }
    

    The alarm type will contain information about the event that occurred in the doorbell:
    + "TEST": somebody clicked the "Test" button of the webhook in the web interface.
    + "VISITOR": somebody pressed the physical button of the doorbell.
    + "AI_PEOPLE": The AI has recognized a human on the video footage.
    + "AI_VEHICLE": The AI has recognize a vehicle on the video footage.

Now you can also do other fun stuff with those messages in Node-RED...

Have fun with it!!!
Bart

6 Likes

BTW there are currently two firmware versions available here, from the same date. Because there was introduced a breaking change when the new firmware was uploaded by Reolink, as you can see in this Reddit discussion. For example for the POE doorbell version:

Make sure to use the latest version (i.e. highest number) if you want webhook support! The breaking change has been solved by Reolink meanwhile...

1 Like

A note for users that secured their setup with Tailcale like me: obviously you need to enter the physical ip address of the device (where Node-RED is running) in the webhook input field, and not the virtual hostname of that device. Because the doorbell cannot resolve that hostname to an io address, since the doorbell is not part of your tailnet. Because you cannot install a Tailscale agent on it.

Which is a pitty because I wanted to close down all traffic to my port 1880 directly (via iptables). And that is now not possible anymore...

As a Reolink user, this is GREAT news... do you know if the NVR supports Webhooks or if it is planned in the future?

No sorry I don't use an NVR. I "try" to do it all in Node-RED...

Hi Bart,

Thanks again for your cool post and very well documented example.
For me the above didn't work, i had to use http://<ip_address_node_red>:1880/doorbell

Just my 2 cents

2 Likes

Hi @edje11,
I had to check my settings in the Reolink doorbell again, and you are right. Typo... I have edit my original post above and added port number 1880 to the url, to make sure others don't get confused.

Thanks for the feedback! And nice to hear that somebody found it useful.

3 Likes

Hi
I've just received a brand new Reolink (D340P) and can't find access to webhooks anywhere. Removed in new firmware perhaps?

Hi @muggins,
I have installed one at my parents house yesterday. The wifi version, not a POE version like mine.

And indeed it didn't have the webhook feature too. I checked the latest firmware, and the screen showed it had the latest version installed, but that was not correct. Because - as explained above - when you search in their download center (for the POE or WIFI version):

You will see that there are 2 versions available:

You will have the second one on your doorbell installed automatically, but you need the first one (which has a higher version number). As explained above there were some troubles at Reolink when the have released that new version: so they made quickly the old version back available, created a fix for the new one, but forgot (I think) to remove the old one...

Very confusing.

Anyway you can download that file manually, and install it on your doorbell. See procedure.

That version contains the webhook feature.
Good luck with it!!

Thank you I'll check it out. I have been using a Ring doorbell with a relay in series with the power circuit to detect button press. I have a Hikvision NVR so now I won't have to pay for cloud storage. Ring never made Onvif available.
On another issue...I tried installing your node-red-contrib-onvif on nodered running in Docker, but with no success... any thoughts


2024-12-24T15:35:22.207Z Install : node-red-contrib-onvif 1.0.3

2024-12-24T15:35:20.594Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-onvif@1.0.3

2024-12-24T15:35:21.034Z [err] npm

2024-12-24T15:35:21.034Z [err]

2024-12-24T15:35:21.034Z [err] WARN config production Use `--omit=dev` instead.

2024-12-24T15:35:24.831Z [err] npm ERR! code EBADENGINE

2024-12-24T15:35:24.831Z [err] npm ERR! engine Unsupported engine

2024-12-24T15:35:24.831Z [err] npm ERR! engine Not compatible with your version of node/npm: fast-unique-numbers@9.0.11

2024-12-24T15:35:24.831Z [err] npm ERR! notsup Not compatible with your version of node/npm: fast-unique-numbers@9.0.11

2024-12-24T15:35:24.831Z [err] npm ERR! notsup Required: {"node":">=18.2.0"}

2024-12-24T15:35:24.831Z [err] npm ERR! notsup Actual: {"npm":"8.19.4","node":"v16.20.2"}

2024-12-24T15:35:24.831Z [err]

2024-12-24T15:35:24.831Z [err] npm ERR! A complete log of this run can be found in:

2024-12-24T15:35:24.831Z [err] npm ERR! /data/.npm/_logs/2024-12-24T15_35_21_002Z-debug-0.log

2024-12-24T15:35:24.834Z rc=1
type or paste code here

No idea to be honest. I don't use Docker, because it adds some extra complexity and extra troubles (like yours now).

You can search for "docker" in my Github repository, and you will see that there are other users sharing their ideas. Like e.g. here.

Now I will go offline for some familly stuff at Christmas eve...

Merry Christmas to everybody still online :christmas_tree: :gift: :champagne: :clinking_glasses:

2 Likes

Merry Christmas to you too

1 Like

I have the PoE Doorbell and it has webhooks but as @BartButenaers states, you have to download a different firmware.

2 Likes

Bart,

Hope you had a good Christmas!

This looks like a nice option to replace my ring doorbell.

I was thinking of getting the POE version, as I find the ring is very slow to popup on my Alexa screen. But getting the cable to my door will not be easy, so wanted some reassurance its worth the effort :wink:

My Hikvision NVR supports Onvif so hopefully I can get 24/7 local recordings ?

Is it possible to capture a still image or to stream the video to an NR desktop ?

What is your experience with it generally, e.g. is the picture quality good at night, how reliable is the human detection etc.

I see there are 2 versions with 3:4 or 3:4 aspect ratio. The vertical view has package detection, which could be useful to me. It will look OK on a phone, but I'm not sure about having the images the "wrong" way up for playback on a standard PC screen :wink:

Sean

Hi @smcgann99,

Merry Christmas for you too!!

My Hikvision NVR supports Onvif so hopefully I can get 24/7 local recordings ?

I haven't used that, but it supports Onvif so I "assume" that should work...

Is it possible to capture a still image or to stream the video to an NR desktop ?

I also didn't have much time to play with that yet :frowning_face:
But did a quick test for you and I can (e.g. using my node-red-rtsp-to-mjpeg node) an RTSP stream in Node-RED:

By far a performant solution, but just to give an idea that you can capture RTSP streams in Node-RED.

For example I use my node-red-contrib-ftp-server-ext to spawn automaticlly a lightweight FTP server with Node-RED, and my Reolink doorbell will store mp4 and jpg files (when a person is detected) to my NAS via Node-RED. Very simple flow and it works fine.

I have recordings for everybody that arrives near the door. Not sure if the doorlight cam can really be used by the police to recognize people. Should have some more time to play with it... The person recognition works fine for me. Only every few nights a false alert by a moth. Not sure if that is correct English: a butterfly that flies during the night :yum:

2 Likes

I use Frigate running on a separate vm to handle all my video streams, recognition and recording, which then provides mqtt feeds into Node-RED for alerting etc.

1 Like

Hi Dave,
Merry Christmas!!
If you ever find time, I would love to hear a bit more from your experience with that in a dedicated discusseion! After Google dropped tfjs, all my hope got lost to do it all inside Node-RED. So my brain is ready to look to the other side now..

Hi. Yes. Replied in your other thread. Happy to share my yaml to help get started if necessary. Indeed would be great if was all in Node-RED. But at some point have to recognise limits and even if we have the best hammer, not every problem is a nail.
Sometimes I describe Node-RED to people as digital gaffer tape. Very useful for 95% of jobs. But sometimes you just need to use the specific tool for the job. (Especially as in this case someone else is dedicated to that project and is focussed on its success)

1 Like

Bart,

I have a reolink on my desk now :wink:

Couple of points to note -

I got the "black" version (wide view) the latest firmware for this model doesn't seem to have the web hook option. Can you provide a link to where you discussed with reolink, so I can ask about this :wink:

I installed your onvif nodes, I can see them in node_modules but not in the pallet ?