Doorbird video doorbell binding

Not sure what you’re asking. Do you want to know if executing “open door” in openHAB will be shown in the Doorbird smartphone app? If so, I don’t believe so.

in the App i dont think so, as Mark already said.
But you can get a “pushover” notification via openhab. i think this should be possible

Happy new year to everyone!

Apologies if this has been asked before… I finally got some time to install the D101 on my door over the Christmas break, I think it’s a great bit of kit but there’s one thing that strikes me as a bit odd. In the mobile app you can turn the IR light on (there’s also a channel in the binding to perform the same function) but the light only stays on for three minutes at a time. I thought it would make more sense to have the IR light on permanently at night to help with motion detection. After all, how can the camera detect motion correctly if it can’t see anything?

Is the three minute IR light limit changeable? I can’t see anything in the app. At the moment I’m considering writing a rule that sets the light switch to ON every two minutes between sunset and sunrise. Is there any reason why this would be a bad idea?

Incidentally, I have a Hikvision camera above the door that turns on it’s IR light when the light level is low but it doesn’t seem to provide enough IR light for the D101.

Not to the best of my knowledge.

I don’t see any downside. Unless, in the off chance that calling the Doorbird API repeatedly over a long period time might have some negative effect on the performance of the device. I have no reason to believe this would be the case, but you never know…

@mhilbush When I understand this correctly the DoorOpen1 is just to trigger the relay on the DoorBird, correct? Would it be possible to add a channel to get an event if the door button in the DoorBird app was pressed? I can only open the door from an OH rule and should have this event to open the door from the DoorBird app.

I don’t imagine turning the IR light on every two minutes will cause a problem either but I thought I’d ask. It seems odd to me that the IR light doesn’t come on permanently for the duration of a low light situation, i.e. at night. Just like my Hikvision cameras do.

I’ve set up a rule and the light is staying on so I’ll see what happens and report back.

1 Like

Yes, that’s correct. Sending an ON command to an item linked to the openDoor1 channel activates the relay. The OFF command does nothing.

Unfortunately, no. The Doorbird API currently supports only button press and motion events. I’ve asked them if/when it might support other events, such as this. But they’ve been noncommittal.

Before the DoorBird binding existed I’ve built my own simple solution with http items. I found an api where you can register callback url’s on the DoorBird. With those callbacks I simply set another switch item to ON when the door button in the DoorBird app is pressed. Here it the item I’ve built to register the callback:

Switch SW_Entrance_DoorBird_DoorOpen_Register "DoorBird - register door open" { http=">[ON:GET:http://user:password@172.17.4.16/bha-api/notification.cgi?url=http%%3A%%2F%%2F172.17.2.21%%3A8080%%2Fclassicui%%2FCMD%%3FSW_Entrance_DoorBird_DoorOpen%%3DON&event=dooropen&subscribe=1&relaxation=60] >[OFF:GET:http://user:password@172.17.4.16/bha-api/notification.cgi?url=http%%3A%%2F%%2F172.17.2.21%%3A8080%%2Fclassicui%%2FCMD%%3FSW_Entrance_DoorBird_DoorOpen%%3DON&event=dooropen&subscribe=0&relaxation=60]" }

There are also callback events for motion event and doorbell. Maybe you can use this to implement a channel in the binding.

The notification.cgi API is no longer in the API spec, so I expect it is deprecated. I believe you can do the same thing with the schedule.cgi, but I haven’t looked at that functionality. I was holding out hope that they would add the missing events to the UDP-based event protocol.

Hi David,
I have an Axis A8105E video doorbell. Would your method also work for the Axis?

@mhilbush I just read the latest api documentation and yes the notification api seems to be replaced with the schedule api. But the old api still works at the moment.

I will also write to the Doorbird team if the dooropen event will be added to the new api. Maybe if some users report this they will implement this faster. Also I found a security issue in the Doorbird app. I activated the Fingerprint protection when the app is opened, but you can just rotate the phone and it will unlock the app without a Fingerprint! I guess they will be happy to know this. :slight_smile:

@epicurean The api we are talking about is specific to Doorbird devices. I don’t know if Axis has a similar api function.

That is implemented in the ipCamera binding which I believe it will notify you when the doorbell is pressed.

Uses
sendHttpGET(“/bha-api/monitor.cgi?ring=doorbell,motionsensor”);

And the code for handling the replies is here:

https://github.com/Skinah/IpCamera/blob/master/src/main/java/org/openhab/binding/ipcamera/internal/DoorBirdHandler.java

Axis used to have a great api, then they discontinued it and created a new one that uses SOAP, the amount of work to implement the newer axis api you can implement ONVIF and give support to more cameras. I have been giving the ipcamera binding some ONViF methods so worth checking that binding out.

There are some posts on how to get the old api working in openhab if you search around this forum.

Does that mean I am best served using ONVIF for my axis doorbell going forward?

I created a rule to turn on the IR light every two minutes between sunset and sunrise but it doesn’t work perfectly. The light still turns off at times throughout the night and I’m not entirely sure why. I’ve got the doorbird configured in Zoneminder which I’m using to perform motion detection. When the IR light changes state the picture changes significantly (colour to greyscale or vice versa) which triggers a motion detection event in Zoneminder.

I’ve emailed Doorbird technical support to ask if it’s possible to have the light stay on permanently until it’s turned off rather than use a timer.

@mhilbush I just got an answer from the Doorbird team. They say that is it possible that the old api will be removed in the future. The new way is to register a callback URL in the HTTPS section in the Doorbird api and then register a schedule in the Relais section with the callback url. The old api did exactly that.

I’ve now asked back for an example how this configuration can be set using the api so that you could implement this into the plugin.

1 Like

Hi @mhilbush,
are the Rule Actions getRingTimeLimit(), getCallTimeLimit() and so on also included in the latest version shipping with oh 2.5?

thx!

Unfortunately, no. Those are in a pending PR that didn’t make it into the release.

Hello @mhilbush,

Very nice binding! Thanks!
Anyone on Synology DSM? The libsodium.so does not load.

2020-01-14 05:58:44.782 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NoClassDefFoundError: Could not initialize class org.openhab.binding.doorbird.internal.listener.DoorbirdEvent$LazySodiumJavaHolder

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.getLazySodiumJavaInstance(DoorbirdEvent.java:100) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.decryptV1(DoorbirdEvent.java:181) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.decrypt(DoorbirdEvent.java:159) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.processPacket(DoorbirdUdpListener.java:122) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.receivePackets(DoorbirdUdpListener.java:95) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.run(DoorbirdUdpListener.java:65) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_231]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_231]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_231]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_231]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_231]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_231]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231]

2020-01-14 05:58:44.798 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.ExceptionInInitializerError: null

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.getLazySodiumJavaInstance(DoorbirdEvent.java:100) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.decryptV1(DoorbirdEvent.java:181) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent.decrypt(DoorbirdEvent.java:159) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.processPacket(DoorbirdUdpListener.java:122) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.receivePackets(DoorbirdUdpListener.java:95) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener.run(DoorbirdUdpListener.java:65) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_231]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_231]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_231]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_231]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_231]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_231]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231]

Caused by: com.goterl.lazycode.lazysodium.utils.LibraryLoadingException: Failed to load the bundled library from resources by path (/linux64/libsodium.so)

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.loadBundledLibrary(LibraryLoader.java:161) ~[?:?]

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.loadLibrary(LibraryLoader.java:120) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.register(SodiumJava.java:164) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.<init>(SodiumJava.java:31) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.<init>(SodiumJava.java:20) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent$LazySodiumJavaHolder.loadLazySodiumJava(DoorbirdEvent.java:83) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent$LazySodiumJavaHolder.<clinit>(DoorbirdEvent.java:77) ~[?:?]

... 13 more

Caused by: java.nio.file.FileSystemException: /volume1/@appstore/openHAB/userdata/tmp/lazysodium/libsodium.so: Operation not permitted

at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[?:1.8.0_231]

at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_231]

at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_231]

at sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:238) ~[?:1.8.0_231]

at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:260) ~[?:1.8.0_231]

at java.nio.file.Files.setPosixFilePermissions(Files.java:2045) ~[?:1.8.0_231]

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.setPermissions(LibraryLoader.java:314) ~[?:?]

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.copyFromJarToTemp(LibraryLoader.java:264) ~[?:?]

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.loadBundledLibrary(LibraryLoader.java:155) ~[?:?]

at com.goterl.lazycode.lazysodium.utils.LibraryLoader.loadLibrary(LibraryLoader.java:120) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.register(SodiumJava.java:164) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.<init>(SodiumJava.java:31) ~[?:?]

at com.goterl.lazycode.lazysodium.SodiumJava.<init>(SodiumJava.java:20) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent$LazySodiumJavaHolder.loadLazySodiumJava(DoorbirdEvent.java:83) ~[?:?]

at org.openhab.binding.doorbird.internal.listener.DoorbirdEvent$LazySodiumJavaHolder.<clinit>(DoorbirdEvent.java:77) ~[?:?]

... 13 more

There is a v18 present on the OS but not working as well.

Not sure what’s happening here. It looks like LazySodium successfully copied the libsodium.so library from its jar file to the filesystem. Then when it tried to set the file permissions, it failed.

at sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:238) ~[?:1.8.0_231] 
at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:260) ~[?:1.8.0_231] 
at java.nio.file.Files.setPosixFilePermissions(Files.java:2045) ~[?:1.8.0_231] 
at com.goterl.lazycode.lazysodium.utils.LibraryLoader.setPermissions(LibraryLoader.java:314) ~[?:?] 
at com.goterl.lazycode.lazysodium.utils.LibraryLoader.copyFromJarToTemp(LibraryLoader.java:264) ~[?:?]

Does this file exist? openHAB/userdata/tmp/lazysodium/libsodium.so If so, what are it’s permissions, and what are the permissions of the directory that contains the file?

Not sure why that wouldn’t be loading…