SOLUTION: Link Doorbird app relay button to OpenHAB

I have owned a Doorbird video doorbell for a while, and have been very happy with it!

One thing that bothered me, however, was that I could not [figure out how to] use the ‘Unlock’ button in the Doorbird app to unlock my ZWave door lock - I finally got it working, with a lot of help from this thread and thought I would post the solution - it’s actually remarkably simple!

The Doorbird binding uses the UDP packets sent by Doorbird, and since these don’t contain the relay state, the binding cannot trigger an event based on the relay button press in the Doorbird app. In fact, you don’t need to have the Doorbird binding installed to get the ‘Unlock’ button to trigger an action in OpenHAB, but it’s a great binding for other tasks, so you should go ahead and install it anyway!

In order to get OpenHAB to react to the unlock button press in the app, we will set up Doorbird to send an HTTPS GET request when the relay is triggered. The full setup can be done with CURL from a PC in the same network as Doorbird, but Doorbird now offer a web admin page (in Beta, but works fine for this), which is far easier. If your Doorbird does not have access to the internet in general, you can still achieve the same thing using CURL, configuring the requests as per the Doorbird API. Regrettably, the Doorbird cannot do POST requests, only GET, so we have to use a non-official method of manipulating item states, which makes a GET request to a special ‘link’ in the UI.

Pre-requisites:

  • A functional Doorbird installation, with the app set up on at least one phone / device
  • Functional OpenHAB install with either Classic UI or Basic UI installed
  • Basic familiarity with .items and .rules files

Steps:

  1. Add an item that will be updated when the Doorbird relay is triggered. Let’s call it “Doorbird Relay Callback”. You can add it to an existing .items file or create a new one.
Switch Doorbird_Relay_Callback "Doorbird Relay Callback"
  1. Add a rule to do whatever it is that you want when this item is set to a given state. For me, I want to unlock (turn OFF) a ZWave lock, so my rule looks like the below:
rule "Doorbird door relay"
when
	Item Doorbird_Relay_Callback received update
then
	if (Doorbird_Relay_Callback.state == ON) {
		logInfo("Doorbird", "Relay triggered from DoorBird app") //log to show where the call came from
		zwave_lock_door.sendCommand(OFF) //Unlock the zwave lock - change to what you need to do instead
		Doorbird_Relay_Callback.postUpdate(OFF) //sets the callback to OFF again once run
	}
end

NB: You’ll see that you COULD have Doorbird update whichever item you want to manipulate directly. For transparency and troubleshooting purposes (as well as to make it easier to change in the future), I suggest this approach, where Doorbird manipulates a ‘dummy’ item, and a rule updates the real item based on that.

  1. Head to https://webadmin.doorbird.com/login, and log in, using the administrator details that you received in your Doorbird box (or get them from your app).
    Click on ‘Favourites’ > ‘HTTP(S) Calls’. Click on ‘Add’. Name the call whatever you like, I went with ‘OpenHAB Relay’. The URL should be as below, using your values (NB: can be an HTTP call, in which case you’d use port 8080, but I’m assuming you’ll use HTTPS since Doorbird supports it). Click save.
https://[your_openHAB_ip]:8443/basicui/CMD?Doorbird_Relay_Callback=ON

NB: If you are using the Classic UI (only), then swap ‘basicui’ for ‘classicui’ above.

  1. Click on ‘Expert Settings’ > ‘Relays’ > ‘Schedule for follow up actions’. Select the favourite you just made, and then click the box near the top right of the window to make it active at all times (or alternatively, enable it only at certain times, if you prefer). Click save.

  2. Try it out! Open a log viewer (http://[your_openHAB_ip]:9001), and pull up the Doorbird app on your phone. Press the unlock button, and you should see log entries showing your dummy item is updated, and that your rule has fired! Your door (or whatever) should now be unlocked! You could also do something like turn on the porch / vestibule / hallway lights in the rule if you like. If it’s all working, you can logout from the Doorbird webadmin page.

That’s it! I hope this is helpful for someone - I really like the Doorbird, and knowing about the webadmin site and how to manipulate OpenHAB from Doorbird only makes it better!

Update 20-Jul-2020 - minor correction to HTTP GET request.

5 Likes

I do the same but I use the RFID bound to each person so when they use their tag it turns on the lights and unlocks the Zwave front door. It also then plays a greeting using Alexa based on the tag :slight_smile:

1 Like

Thank you very much!
I installed the doorbird today, and before, I thought, I can receive the unlock states with the binding from channel openDoor1 (channel=“doorbird:d210x:doorbell:openDoor1”) - but it didn’t
After quick search in this openhab community board, i found your solution,
you saved me, to by the overprized Doorbird A1081 Controller.

Thanks!

Glad it helped, enjoy the Doorbird!

Hi,
I’m looking to buy this doorbell, but is it possible to fully integrate it into OpenHAB? The functions I’ll need is when somebody rangs, I get a notification on my phone and when I tap on it, I want to be able to see and hear the visitor and speak with him.
However, is there also a motion detector function? So when somebody is 3 metres away from my doorbell at night, I’d like openHAB to automatically turn on the lights at my front door. Is that possible?

Regards,
Jim

Hi Jim,

What you are thinking about should be possible. I use the Doorbird app for the communication when someone rings the bell, and it works fine. It’s not inside openHAB, but you do get a notification and can see / speak / hear.

There is a separate motion detector in the Doorbird, and for the motion detection triggering the lights, you can do this, same method as the original post, but instead of ‘Expert Settings’ > ‘Relays’ > ‘Schedule for follow up actions’, you’ll link your HTTPS call to ‘3D Motion Sensor’ > ‘Schedule for Actions’. In terms of the exact distance… I’m not sure exactly when the sensor triggers, but it seems like it’s around 3m (not sure if this was an exact need or a general distance).

I hope this helps - it’s not totally clear what you mean by ‘fully’ integrate into openHAB, but I think it should meet your needs, based on the requirements you mention.

Hello,
motion detection is fully integrated. The distance adjustment is into the doorbird app.
Regards,
Ralf

Hi,
I have a similiar setup running with openhab2.
Since openhab3 is lacking BasicUI and ClassicUi, is there any way to use the http callout from doorbird to change an Item’s state within openhab3?

Thanks in advance!

Hi @Pascal_S,

You can install Basic UI on OH3, and then I assume it would work the same? I haven’t tried that though - my Doorbird is in my older install of 2.5.x.

Thanks, Andrew! Indeed it was that easy!
I just wasnt aware of BasicUI available in ohab3.

Worked flawlessly, thanks a lot! That was bugging me for sure :slight_smile:

Hello

me again.
I got that setup working but i have another request.
I want to trigger a chromecast when someone rings the bell on my doorbird.
Unfortunately with the original doorbird binding i have delays up to 10 s so i cannot use the binding directly.
I remembered that here might be another solution waiting for me.
Is it possible to use this way to determine the doorbel_pressed item?

Thank you!

Hi @Jonas88,

If you can trigger what you want using the basicui, it should be possible to replicate it quite easily using this method - all we are doing here is getting the Doorbird to make a call to the basicui.

e.g. I made a switch called Doorbird_Relay_Callback as a ‘model’ for the relay, and switched it with the command below:

https://[your_openHAB_ip]:8443/basicui/CMD?Doorbird_Relay_Callback=ON

If you can trigger whatever you want to do on Chromecast with a single command, it should be fine - e.g. you set up a switch that plays a song, Chromecast_Play_Something, then you would trigger it by changing the line in my example at the top of the thread to:

https://[your_openHAB_ip]:8443/basicui/CMD?Chromecast_Play_Something=ON

Do note that the https call is just a command, so you aren’t limited to ON / OFF, you can send anything that the basicui would accept as a command, and it will be parsed.

I hope this helps!

1 Like

Thank you. I ne tried to replicate it but i cannot find an option in the doorbird ui to link the http call to the „button pressed“ event.

Have a look in ‘Expert Settings’ > ‘Schedule for Doorbell’ - at the top left, you should have a drop down, with the default option being ‘Push Notifications’. You’ll find HTTPS calls in there, and you can set the schedule. Note that you will need to set up the HTTPS call first, as per step 3 in the first post.

1 Like

thanks a lot! i did not know there was a dropdown menu.
it works flawlessly :slight_smile:

Very nice Andrew, this is exactly what I needed to control my door strike other than wiring it directly to the outside Doorbird/relay which seems somewhat insecure?

Glad it was helpful!

When I was setting up myself, I did entertain the thought of hard-wiring the relay back to the GPIO of the RPi I run OpenHAB on also, but I agree with you - it feels overcomplicated, given the doors can already be opened by an app.

Hi guys! First of all, this is working fine :slight_smile: But actually there is one thing: this is working only when the device where the Doorbird app is used in this moment is in the local network. This means I need to be at home. I know that there are usecases where this is no problem, but actually I would like to open the garagedoor (just for example) for the postman also when I am not at home. Currently I need to switch from the Doorbird app to the Openhab app in order to open it. It would be great if I could do directly in the Doorbird app also. I tried a HTTPS-Call via myopenhab.org/rest, but it did not work at all (HTTP error).

https:myopenhab.org:443/rest/items/myITEM_XY=ON

Not sure whether just the https-call sytax is wrong or it’s not working via myopenhab at all. Do you guys know if this is possible and if so, how?

Maybe I don’t get it right. But since I own a Doorbird and everything you asked for works with my setup… the Doorbird doorbell itself sends the command to open the door / garagedoor to openHAB. Your app on your mobile connects to the Doorbird. So if the Setup works when you are at home it does not make sense to me if does not work if you are outside your lan.

Can you confirm your setup works when you are at home? Maybe there is issue with fixed / dynamic ip‘s.

As long as the Doorbird and openHAB Server are in the same Network and you do not turn off your router when leaving the house it should work …