DoorBird Binding?

Hi Philipp

Unfortunately I am not a big coder myself, but have you tried php?
A quick search revealed (for example) this:

As I said, I can’t code myself, but I use the application Postman on Mac - this even gives you example coding, which worked at least two times with different REST APIs, so you might give it a try…

1 Like

Hi RiotMode,

the DoorBird API actually supports passing user and password as URL parameters (cf. API spec p7f.), so your example should work the followin way:
<img height="85%" src="http://192.168.1.XXX/bha-api/history.cgi?http-user=USER&http-password=PASS&index=1" />

Hope that helps!

1 Like

Thank you for the hint - Patrick !

much love :black_heart: this works perfectly - thank you!!!

Hi all,

I am a new openhab2 User (and in the Community) and very happy with the few little things I‘ve been done yet.
(Using Raspberry PI3 / Openhabian Image / Openhab 2.3)

But now I have problems to get the notification of my doorbird running.
BTW: The goal is: When I push the Button on my Doorbird, all Sonos-Speaker have to play a Notification Sound.
Playing the sound on Sonos already works with a „test-switch”

What is the best way to found out what is wrong?
If I press the Button on my Doorbird, should there a LogInfo in the console? (log:tail)
Like: Receive Command over http. Or something like that?
At the moment, with my items, there isn’t any LogInfo for this case.

I have read this topic and the wiki but I don’t know how to go forward and receive a command to make a
rule for my Sons System:

That’s what I did so far:
Installed http-Binding
Installed Classic UI (with PaperUI)

Schliessystem.items :

Group DoorBird

Switch DoorBird_DoorBell_Register “DoorBird - Register Door Bell” (DoorBird) { http=">[ON:GET:http://DB_USER0001:DB_PASSWORD@DB_Local_IP/bha-api/notification.cgi?url=http%%3A//openhabian_local_IP%%3A8080/classicui/CMD%%3FDoorBird_DoorBell%%3DON&user=openhabian&password=openhabian_Password&event=doorbell&subscribe=1] >[OFF:GET:http://DB_USER0001:DB_PASSWORD@DB_Local_IP/bha-api/notification.cgi?url=http%%3A//openhabian_local_IP%%3A8080/classicui/CMD%%3FDoorBird_DoorBell%%3DON&user=openhabian&password=openhabian_Password&event=doorbell&subscribe=0]" }

Switch DoorBird_DoorBell “DoorBird Door Bell Triggered” (DoorBird)

Sitemap:

Text label=“Doorbird Test”
{
Video url=“http://DB_USER0001:PDB_PASSWORD@192.168.XXX./bha- api/video.cgi” encoding=“mjpeg” //funktioniert
Default item=DoorBird_DoorBell
Default item=DoorBird_DoorBell_Register
Group item=DoorBird label=“Doorbird Gruppe Test”
}

Rule:
rule “DoorBird_DoorBell_Register”
when
Item DoorBird_DoorBell_Register received command
then
logInfo(“logInfoDoorBird_Doorbell_Register”,“DoorBird Register on”)
sendCommand(DoorBird_DoorBell,ON)
end

Could you help me?

Thank you very much!!!

Dominik

Hello Dominik

I needed to do the register manually.
Check the registration at this url: http://DB_USER0001:DB_PASSWORD@DB_Local_IP/bha-api/notification.cgi?
What happens when you use the HTTP URL manual in your browser? The bell should ring…

Regards
Michael

Hello Michael,

thank you very much for your reply!

When I use the HTTP URL the browser (Firefox) “says” the following:

{“BHA”: { “RETURNCODE”: “1”, “NOTIFICATIONS”: [{“event”: “doorbell101”,“subscribe”: “0”,“url”: “http://openhabian_local_IP:8080/classicui/CMD?DoorBird_DoorBell=ON”,“user”: “openhabian”,“password”: “openhabian_Password”,“relaxation”: “10”}]}}

Should my Fritzfon and my IOS App ring too when I use the HTTP URL in my Browser?
I have to say that I haven’t connect a “normal” bell in my house.
Just my Fritzfon and the Mobile App. They work fine if I press the physical Button on my Doorbird.
But nothing happened when I use the URL in my Firefox.

Should the Item “DoorBird_DoorBell” turn to “ON”?

Regards,
Dominik

Hi,

Just saw this. The feedback from your browser suggests that you have not subscribed to the event ‚doorbell rings‘ yet.

Also, the old notification.cgi is depreciated in the Doorbird api. Here’s what I did to achieve something very similar:

As Michael pointed out, you need to register first, I.e. you need to tell Doorbird that it should react on a certain event (the bell rings) and perform a certain action on this (call the http from OpenHAB which then triggers the switch) - this you do in the schedule.cgi of Doorbird.

What is a little tricky there: you don’t enter the http address in the schedule.cgi directly, rather you refer to an http favorite which you define in the app of Doorbird (this is the actual http address of OpenHAB, incl. url parameters)

Once you’ve done that, the item should indeed switch to on, and you can perform any OpenHAB action like having sonos play a sound.

One additional remark: you might want to write a small rule which resets the switch to off after a few seconds, otherwise sonos will only play a song once :slight_smile:

1 Like

Yipiiieh… that was the key! :grinning:

The two things: Learn how to register in the app and using schedule.cgi instead of notification.cgi.

I am happy it works. Awesome.

Thank you very much !!!

And thank you for the additional remark. A very good Idea…

Hi.
Could you explain how to set up de favourite and the schedule please?? I am very lost jejeje

Hi patrick

can you explain more about your 4th paragraph. How do you do this with schedule.cgi?

Hi,
glad to explain.

First, you need to go into the app and define an “http-favourite”: Settings --> Administration --> Favorites --> HTTP Calls
Add an http call there with the address:

http://XX.XX.XX.XX:8080/classicui/CMD?DoorBird_DoorBell=ON (where xx.xx.xx.xx is your ip and “DoorBird_DoorBell” is an item I defined for the DoorBell)

Secondly, follow the instructions in the DoorBird API to register this http call and when it should be called. In the schedule.cgi I entered the following:

{
"input": "doorbell",
"param": "1", 
"output": [{
"event": "http",
"param": "0",
"enabled": "1",
"schedule": {
"weekdays": [{
"to": "82799"
"from": "82800"
}]
}
}]
}

Which basically says: When Doorbell rings (input), call up http (event) favorite No. 0 (param, the first http fav in the app is counted as 0).

To send these lines to the Doorbird I used Postman - there are also some extensions to common browsers which also do the job fine.

You basically send these lines to this address: http://doorbird-IP/bha-api/schedule.cgi

Let me know whether this helps

1 Like

yes!!! it works!! thank you!!:grinning:

but i post all plus my new schedule because if you dont send the default schedules it overwrite all

[{"input":"doorbell","param":"1","output":[{"enabled":"1","event":"notify","param":"","schedule":{"weekdays":[{"from":"82800","to":"82799"}]}},{"event":"http","param":"0","schedule":{"weekdays":[{"from":"82800","to":"82799"}]}}]},{"input":"motion","param":"","output":[{"enabled":"1","event":"notify","param":"","schedule":{"weekdays":[{"from":"79200","to":"79199"}]}}]}]

1 Like

One implementation for that is than when someone touch doorbird you can do ringing to normal cheap doorbell in your home with one Sonoff with Tasmota Firmware an one rule like this:
https://github.com/arendst/Sonoff-Tasmota

rule "Suena Doorbell"
    when
        Item DoorBird_DoorBell received command ON
    then
        sendCommand(DoorBird_DoorBell, OFF)
      if (SilencioTimbreSalon.state != ON)
      {
        sendCommand(TimbreSalon, ON)
        Thread::sleep(300)
        sendCommand(TimbreSalon, OFF)
        Thread::sleep(2000)
        sendCommand(TimbreSalon, ON)
        Thread::sleep(300)
        sendCommand(TimbreSalon, OFF)
        Thread::sleep(2000)
        sendCommand(TimbreSalon, ON)
        Thread::sleep(300)
        sendCommand(TimbreSalon, OFF)
      }
end

i defined on home.item a switch SilencioTimbreSalon because i have a baby and sometimes i dont want the doorbell ringing
Switch SilencioTimbreSalon "Silenciar Timbre" <alarm> (DoorBird) [ "Switchable" ]
And the switch for doing que doorbell ringing with tasmota firmware and mqtt:
Switch TimbreSalon "Timbre" <alarm> {mqtt=">[localBroker:cmnd/Sonoff_Timbre/POWER:command:ON:1],>[localBroker:cmnd/Sonoff_Timbre/POWER:command:OFF:0],<[localBroker:stat/Sonoff_Timbre/POWER:state:default]"}

Thank you, how do you ‘send’ that data to the doorbird using schedule.cgi? Sorry for the silly question.

not a silly question at all - actually, this took me some time to figure out how to do best, as well.

I use Postman for this: https://www.getpostman.com/

you simply enter the url (…/bha-api/schedule.cgi) and as the body you sent all the parameters (.i.e. this block:)

{
"input": "doorbell",
"param": "1", 
"output": [{
"event": "http",
"param": "0",
"enabled": "1",
"schedule": {
"weekdays": [{
"to": "82799"
"from": "82800"
}]
}
}]
}

Hope that helps

1 Like

Thank you so much Patrick. I had a freelancer set this up previously for me, but the hardware died and when i replaced it I couldnt work out how to actually ENABLE this on the Doorbird. My rules and schedule were all set correctly but this was the missing link that turned it on!

I love my Doorbird. It makes SIP calls to my 4G phone when I’m away (ive setup Asterisk on a UNIX VM) and it even plays a voice mail out of my Doorbird if I’m not home! then sends me the email. Alexa alerts me to visitors at the front gate when I’m home also and ive integrated it all into HabPanel so I can make two way calls to/from the Doorbird, along with Visitor captures and on. Works well! i love making random calls to the Doorbird when people walk by and scare them HAHAH!

Thank you!

Hi Patrick do you know if its possible to simulate the press of the Doorbell button using the API?

Thanks
Kris

Hi Kris
It depends what you want to achieve. I’ve just had a look at the API - getting the actual DoorBird hardware to ring does not seem possible - but you could probably get a notification - for example - without having to physically pushing the button.

What do you want to achieve?

1 Like

Sorry Patrick, i only just saw this. Yes I can trigger the notification easily using the smarthome:send ON and the rule triggers.

I wanted to be able to remotely assist/troubleshoot issues with the unit without having to actually physically press the button to set off the chain of events.

So you can talk to persons in front of the doorbird using only habpanel? Could you explain how you did that? SIP?