DoorBird Binding?

binding
Tags: #<Tag:0x00007f1829a59888>

(Kris K) #70

Thanks bern77! hopefully this helps Pavel :smiley:


(Pavel) #71

Thanks for output, I think it will be very useful for future users. We resolved our problem with missed notifications by DoorBird reset. May be it was some strange internal state or some bad combination of settings.

But now I stuck on impossibility of configuration SIP via HTTP API. I receiving “401 Unauthorized”, when I trying to enter. Settings looks right. Waiting meaningful response from Doorbird support.


(Kris K) #72

And the response we got for others, you must create a new SIP user in the Doorbird Admin utillity. It must be called ‘SIP’ with Video always on and API permissions. This resolved the problem Pavel and I had :slight_smile:


(Pavel) #73

Anybody tried SIP on DoorBird? I meet weird issue. First of all, I set up back calls (DoorBird calls you after HTTP request) and it worked fine for a days. But now it not working any more and answers on direct and back calls “503 Service unavailable”. I don’t changed anything and even try sip.cgi?action=reset without success. Another problem is pure debug capabilities of DoorBird: I can only get last error code and text message - it’s not always informative.


(Pavel) #74

I successfully made web softphone with SIP.js. It works well in the Firefox. Chrome based browsers don’t allow unsecured http/ws connection and self-signed certificate is a problem. I embed it into sitemap via WebView and it works in Firefox, but when I tried it in Openhab app nothing happens and it’s hard to get debug info from app. Anybody tried something like this?


(Patrick Boch) #75

Hi all
I’d like to revive this topic: I’ve recently received my Doorbird (2101V), and apparently the notification.cgi has been discontinued and has been replaced by schedule.cgi.

Therefore I am struggling a bit with how to format the notifications/triggers from the wiki.

Here’s my output from notification.cgi (nothing programmed yet, hence it’s pretty empty:

[{"input":"doorbell","param":"1","output":[{"event":"notify","param":"","schedule":{"weekdays":[{"to":"79199","from":"79200"}]}}]},{"input":"motion","param":"","output":[{"event":"notify","param":"","schedule":{"weekdays":[{"to":"79199","from":"79200"}]}}]},{"input":"rfid","param":"xxxxx","output":[{"event":"relay","param":"1","schedule":{"weekdays":[{"to":"79199","from":"79200"}]}}]}]

My idea was to change the formatting of notification.cgi like so:

[ON:GET:http://<user>:<password>@<doorbird-ip>/bha-api/schedule.cgi?url=http%%3A//<OH-IP>%%3A<port>/classicui/CMD%%3FDoorBird_MotionSensor%%3DON&event=motion&schedule=weekdays]

But that’s apparently not enough. Anyone here already worked with schedule.cgi (or has enough experiences with those kind of APIs to make an educated guess as to how this should be formatted)?

Thanks!
Patrick


(Kris K) #76

Hi Patrick, I am using the same Doorbird.

We use OpenHab Cloud (Local instance) for notificiations.


(Patrick Boch) #77

Hi Kris

that’s one of the use cases I intend to do, yes.
How did you configure OH to receive a notification via the OH cloud when, for example, the doorbell is pushed?
Or, more generally, how do you configure OH to react to a trigger from DoorBird (doorbell, motion)?


(Patrick Boch) #78

Hi all
solved the problem. Here’s a short run down of how I solved it.

Not that I know the “old” notification.cgi, but the new schedule.cgi of DoorBird essentially is doing all the work - in other words, there is one possibility I used - http trigger - where essentially an http request is called whenever an event is happening (i.e. doorbell, motion, etc.).

What I did therefore is to add that scheduled event (in my case, an http request) using JSON - I used postman to set up this JSON call just that once.
In a second step (it was actually the first step, since you have to define the http request in the favorites of the DoorBell App (or API)), I then simply used a http-request for OH, in the form of:

http://<openhab-ip>:<openhab-port>/classicui/CMD?<itemname>=ON

This triggers a switch, and since the switch needs to reset to OFF after the Doorbell rang, I used a rule to reset it, like this:

rule "Tür öffnen"
when
Item DoorBird_DoorBell changed 
then
if(DoorBird_DoorBell.state==ON) {
	timer = createTimer(now.plusSeconds(2)) [
	sendCommand(DoorBird_DoorBell, OFF)
		]
} else {
if(timer!==null) {
	timer.cancel
	timer = null
	}
}
end

Not sure if there’s a more elegant way - but it definitely works. Now all I have to think is what to actually do when the doorbell rings :slight_smile:


(Philipp) #79

hey guys, just a simple question i think, but i dont get it to work

i want the last 3 history images in my BasicUI - i dont like it to have an image-url item in my sitemap, because i cant adjust the size of the image and cant put the last 3 images in one line side by side, so i created a html-file and put it in my sitemap with “Webview”

looks like this now:

SITEMAP

Frame label="Doorbird History"
            {
                Webview url="/static/doorbird_history.html" height=8
            }

doorbird_history.html

<center>
<img height="85%" src="http://192.168.1.XXX/bha-api/history.cgi?index=1" />  
<img height="85%" src="http://192.168.1.XXX/bha-api/history.cgi?index=2" /> 
<img height="85%" src="http://USER:PASS@192.168.1.XXX/bha-api/history.cgi?index=1" /> 
</center>

i can see the first two images, when i am logged in to doorbird in my browser - but on my phone i am not logged in, so i cant see the images at all - so i tried the 3rd line, but its not working at all - how do i need to adjust the html code to get it working without loggin in at all ?

Thanks!

EDIT:
i am in chrome browser - i think its chrome related - in Safari it works well - the Chrome Log gives me this:

[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. `https://user:pass@host/`) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.

is there another way for images in html ?


(Matt) #80

If im not mistaken this is indeed a “problem” with chrome.
As I can remember chrom is not supporting to call pages with the “USER:PASSWORD@” any longer.


(Philipp) #81

you get me right - that sucks :frowning: - any workaround for my idea in chrome ?


(Patrick Boch) #82

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…


(Bernhard Bauer) #83

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!


(Philipp) #84

Thank you for the hint - Patrick !

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


(Dominik Terhardt) #85

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


(Michael Sutter) #86

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


(Dominik Terhardt) #87

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


(Patrick Boch) #88

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:


(Dominik Terhardt) #89

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…