Doorbird video doorbell binding

That explains why the rawbutton-on-off-switch profile doesn’t work (and why the Doorbell_Pressed item is not getting commands). That profile was added to openhab-core right before the last 2.5 milestone release (2.5 M4).

Ah, so the only way is using

when
    Channel "doorbird:d101:doorbell:doorbell" triggered PRESSED
then

in the rules?

Correct, unless you upgrade to the latest 2.5 milestone (or 2.5 when it’s released in December). :wink:

2.5 M4 includes a new system profile (rawbutton-on-off-switch) that will let you use a Switch item.

2.5 shudder… not baked enough, not even close.

Works great!
Thank you!

1 Like

@oeiber FYI I also added getCallTimeLimit() and getLastErrorText(), but it’s not in the version you’re running.

I Mark (and all )
Headerline: I think I have problems with my VLANs…

so I upgraded my “productive” System Today to 2.5m4-1 and added the newest Jar file. But at this Setup here, I have troubles receiving the “door pressed event”
I do get the current and last pressed Image (black& white ?) and some “last pressed datestamp”, so something must be right…

But the event does not go through. I wonder why and hope you can add an Idea where to look.

I would liked to offer a log, but the logfile is empty, my setup looks like the others (not empty ones):


#doorbird
log4j2.logger.doorbird.name = org.openhab.binding.doorbird
log4j2.logger.doorbird.level = TRACE
log4j2.logger.doorbird.additivity = false
log4j2.logger.doorbird.appenderRefs = doorbird

# Doorbird
log4j2.appender.doorbird.name = DOORBIRD
log4j2.appender.doorbird.type = RollingRandomAccessFile
log4j2.appender.doorbird.fileName = ${openhab.logdir}/doorbird.log
log4j2.appender.doorbird.filePattern = ${openhab.logdir}/doorbird.log.%i
log4j2.appender.doorbird.immediateFlush = true
log4j2.appender.doorbird.append = true
log4j2.appender.doorbird.layout.type = PatternLayout
log4j2.appender.doorbird.layout.pattern = %d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] [%-50.50c] - %m%n
log4j2.appender.doorbird.policies.type = Policies
log4j2.appender.doorbird.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.doorbird.policies.size.size = 1000KB
log4j2.appender.doorbird.strategy.type = DefaultRolloverStrategy
log4j2.appender.doorbird.strategy.max = 10

My thing is done in PaperUI and I have your rule from the README:

rule "Doorbell Button Pressed"
when
    Channel "doorbird:d210x:392b1875:doorbell" triggered PRESSED
then
    logInfo("test", "pressed")
end

I have an Item as well:


Switch                      
Doorbell_Pressed                
"Doorbell Pressed [%s]"                                                     
<switch> 
(G_Doorbird)    
["Switch"]      
{ channel="doorbird:d210x:392b1875:doorbell" [profile="rawbutton-on-off-switch"] }

So I was wondering, maybe it is my network, because I use VLANs. But I see traffic coming to openhab when I press the button, especially those 2: The top is is addressed explicitly to 10.0.1.2, that must be the forward of the firewall… But the content is strange, something with “failover doorbird net” ?


the scond screen here is maybe the original? Although looks different - I have no Idea.

I use Opnsense as a firewall - I assume I am not alone doing this. Anybody out there that can share his setup details and help me figure this out?
Greetings
PhiL

The Wireshark capture looks fine. Port 6524 is the port on which the doorbird broadcasts its UDP events. The data is encrypted, so you can’t tell what is in the packet. However, the size of the encrypted packet is always 70 bytes, which is what you’re seeing the in Wireshark capture.

If the doorbell pressed image is updating, then that means the binding is receiving and successfully decrypting the UDP packet. The rule looks correct, so I don’t know why it’s not firing.

I also don’t know why the debug logging is not working.

Have you tried deleting and re-adding the Doorbird thing? If you were on an older version of the binding, you may need to do this to pickup the changed channel definitions.

Here’s what my logger definition looks like. Yours is missing the log4j2.logger.Doorbird.appenderRef.Doorbird.ref line.

### Doorbird ###
# Doorbird Logger
log4j2.logger.Doorbird.name = org.openhab.binding.doorbird
log4j2.logger.Doorbird.level = DEBUG
log4j2.logger.Doorbird.additivity = false
log4j2.logger.Doorbird.appenderRefs = Doorbird
log4j2.logger.Doorbird.appenderRef.Doorbird.ref = DOORBIRD
# Doorbird Appender
log4j2.appender.Doorbird.type = RollingRandomAccessFile
log4j2.appender.Doorbird.name = DOORBIRD
log4j2.appender.Doorbird.fileName = ${openhab.logdir}/doorbird.log
log4j2.appender.Doorbird.filePattern = ${openhab.logdir}/doorbird.log.%i
log4j2.appender.Doorbird.immediateFlush = true
log4j2.appender.Doorbird.append = true
log4j2.appender.Doorbird.layout.type = PatternLayout
log4j2.appender.Doorbird.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-50.50c] - %m%n
log4j2.appender.Doorbird.policies.type = Policies
log4j2.appender.Doorbird.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.Doorbird.policies.size.size = 10MB
log4j2.appender.Doorbird.strategy.type = DefaultRolloverStrategy
log4j2.appender.Doorbird.strategy.max = 3

Well, First I copied over the missing line, no difference… then I copied all your log lines and it works. :smiley:
I have also deleted the thing and readded it again… for the fun, I added both, the D101 and the D210x for my D205 :smiley: But now everybody is sleeping and I cannot “test” that. will do asap. Thanks for the help!

The latest version of the binding (have not posted the jar yet), lists the D205 along with the D101 and D201. From what I was able to determine the D205 is functionally equivalent to the D101.

https://github.com/mhilbush/openhab2-addons/tree/doorbird-a1081/bundles/org.openhab.binding.doorbird#supported-things

Hi Mark

Still having issues with dependencies. Reinstalled the system (2.4.0) and i get the following:

08:29:59.122 [WARN ] [org.apache.felix.fileinstall         ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.doorbird-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.doorbird [253]
  Unresolved requirement: Import-Package: org.openhab.core.automation.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: com.google.gson.annotations; version="[2.8.0,3.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

openhab> list -s | grep doorbird
> list -s | grep lazysodium
> list -s | grep jna
200 x Active    x  80 x 1.0.0                  x doorbird-deps
253 x Installed x  80 x 2.5.0.201911042200     x org.openhab.binding.doorbird
247 x Active    x  80 x 4.0.1                  x com.goterl.lazycode.lazysodium-java
248 x Active    x  80 x 5.4.0                  x com.sun.jna
openhab> list -s | grep doorbird
> list -s | grep lazysodium
> list -s | grep gson
200 x Active    x  80 x 1.0.0                  x doorbird-deps
253 x Installed x  80 x 2.5.0.201911042200     x org.openhab.binding.doorbird
247 x Active    x  80 x 4.0.1                  x com.goterl.lazycode.lazysodium-java
 21 x Active    x  80 x 2.7.0.v20170129-0911   x com.google.gson
250 x Active    x  80 x 2.8.5                  x com.google.gson
openhab>

Should I have two versions of gson? :frowning: thanks!

Hmm. I’ve not seen these errors before…

The current version of the binding uses com.google.gson.annotations, but I thought that would come along with the gson library when it gets loaded.

The actions (restart, sipHangup, etc.) use org.openhab.core.automation.annotation, but I would expected that to be there already. Perhaps try installing a binding that has actions, such as mail (v1 or v2), telegram, etc.

I don’t think this is an issue.

If you kept an older version of the binding, you may need to revert to that until you’re ready to move to 2.5.

Hi Mark

Installed telegram and it looks like its happy with gson

one more to go. I have the latest binding running on my other 2.4.0 machine

openhab> bundle:restart 253
Error executing command: Error restarting bundles:
        Unable to start bundle 253: Could not resolve module: org.openhab.binding.doorbird [253]
  Unresolved requirement: Import-Package: org.openhab.core.automation.annotation; resolution:="optional"
  Bundle was not resolved because of a uses contraint violation.
  org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.openhab.binding.doorbird [osgi.identity; osgi.identity="org.openhab.binding.doorbird"; type="osgi.bundle"; version:Version="2.5.0.201911042200"] because it is exposed to package 'com.sun.jna' from resources com.sun.jna [osgi.identity; osgi.identity="com.sun.jna"; type="osgi.bundle"; version:Version="5.4.0"] and doorbird-deps [osgi.identity; type="osgi.bundle"; version:Version="1.0.0"; osgi.identity="doorbird-deps"] via two dependency chains.

Chain 1:
  org.openhab.binding.doorbird [osgi.identity; osgi.identity="org.openhab.binding.doorbird"; type="osgi.bundle"; version:Version="2.5.0.201911042200"]
    import: (&(osgi.wiring.package=com.sun.jna)(&(version>=5.4.0)(!(version>=6.0.0))))
     |
    export: osgi.wiring.package: com.sun.jna
  com.sun.jna [osgi.identity; osgi.identity="com.sun.jna"; type="osgi.bundle"; version:Version="5.4.0"]

Chain 2:
  org.openhab.binding.doorbird [osgi.identity; osgi.identity="org.openhab.binding.doorbird"; type="osgi.bundle"; version:Version="2.5.0.201911042200"]
    import: (&(osgi.wiring.package=com.goterl.lazycode.lazysodium)(&(version>=4.0.0)(!(version>=5.0.0))))
     |
    export: osgi.wiring.package=com.goterl.lazycode.lazysodium; uses:=com.sun.jna
  com.goterl.lazycode.lazysodium-java [osgi.identity; osgi.identity="com.goterl.lazycode.lazysodium-java"; type="osgi.bundle"; version:Version="4.0.1"]
    import: (osgi.wiring.package=com.sun.jna)
     |
    export: osgi.wiring.package: com.sun.jna
  doorbird-deps [osgi.identity; type="osgi.bundle"; version:Version="1.0.0"; osgi.identity="doorbird-deps"]

Hi Mark

where can i find an older version of the binding?

Cheers
Kris

I don’t have one. Do you maybe have a backup that you can pull it from?

Unfortunately not. I tried installing all the bindings my prod system has but the same issue.

Hi @mhilbush ,
I am still struggling with using the binding in my LAN, as my Doorbird is in a seperate VLAN. I am not sure if this is a problem of the binding or of some kind of network layering of openhab.
If I connect my openhab instance with the VLAN, I receive logs good like:

2019-11-20 19:34:03.230 [DEBUG] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Listener got UDP socket on port 6524 with timeout 3000
2019-11-20 19:34:07.333 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:34:07.334 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 3535:ghcqij:1574274847
2019-11-20 19:34:07.334 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:34:07.334 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2019-11-20 19:34:14.334 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:34:14.335 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 3536:ghcqij:1574274854
2019-11-20 19:34:14.335 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:34:14.335 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2019-11-20 19:34:21.335 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:34:21.336 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 3537:ghcqij:1574274861
as well as: 
2019-11-20 19:08:32.027 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 70 from 172.16.3.11
2019-11-20 19:08:32.028 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Calling cryptoPwHash with passwordFirstFive='xxxxx', opslimit=4, memlimit=8192, salt='XX XX XX XX XX'
2019-11-20 19:08:32.030 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Call cryptoAeadChaCha20Poly1305Decrypt with ciphertext='XX XX XX', nonce='XX XX XX', key='XX XX XX'
2019-11-20 19:08:32.030 [DEBUG] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Received and successfully decrypted a Doorbird event!!
2019-11-20 19:08:32.030 [DEBUG] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Event is eventId='1', intercomId='ghcqij', timestamp=1574273311
2019-11-20 19:08:32.031 [DEBUG] [.binding.doorbird.internal.handler.DoorbellHandler] - Handler: Update DOORBELL channels for thing doorbird:d101:422a9f37
2019-11-20 19:08:32.031 [DEBUG] [.binding.doorbird.internal.handler.DoorbellHandler] - Downloading image using url=http://172.16.3.11/bha-api/image.cgi
2019-11-20 19:08:32.088 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 70 from 172.16.3.11
2019-11-20 19:08:32.088 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2019-11-20 19:08:33.792 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11
2019-11-20 19:08:33.792 [TRACE] [b.binding.doorbird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 3316:ghcqij:1574273313
2019-11-20 19:08:33.792 [TRACE] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Got datagram of length 22 from 172.16.3.11

so that IS working. But if I connect my Instance to the VLAN, I receive nothing more than:

2019-11-20 19:44:21.004 [DEBUG] [.binding.doorbird.internal.handler.DoorbellHandler] - Scheduled listener job to start in 5 seconds
2019-11-20 19:44:26.005 [DEBUG] [ing.doorbird.internal.listener.DoorbirdUdpListener] - Listener got UDP socket on port 6524 with timeout 3000

But when I do a TCPDUMP on the network card, I can see those packages, so they do arrive at the openhab instance, the Listener just does not care:

I have the two PCAP files, but cannot attach them directly due to forum restrictions. So I zipped them and renamed that zip to PDF :smiley:

doorbird.zip.pdf (867 Bytes)

Can you have a look and see if your listener ignores those packets or if this is more a general problem of cross-vlan-multicasting of openhab?

Thanks a bunch!
PhiL

The binding doesn’t filter anything. As you can see in the code here, when the binding creates the datagram socket, it binds only to the UDP port.

I’m not really sure what’s going on at the Java and/or OS level to understand why the UDP packet is not being passed up to the binding.

Hello, is it possible to get the information of pressed “open door” button in the app ?