DoorBird Binding: Event Monitoring v.2 handling of encryption not yet implemented - Feature request

Since November 2023 there is a new “v.2” handling for encription/decyiption of events" active.
“v.1” is deprecated.
You can find details here: DoorBird LAN-2-LAN API
The DoorbirdEvent.java class has only implemented decryption version 1. Version 2 is not yet implemented.
Every time DoorBird registers some motion in front of the motion sensor, the binding will now create four times an INFO in openhab.log saying “Don’t know how to decrypt version 2 doorbell event”.

Unfortunately, I’m not much of a java programmer and cannot implement the version 2 myself.
Anybody out there capable and kond enough to do it?

1 Like

I built a version that implements v2 decryption, but last time I checked, my Doorbird was still sending v1 packets (that was a couple weeks ago). I’m away from the home where I have the Doorbird installed so I can’t test it again.

If you want to try it, I can give you a jar to try out.

Edit:
I just looked at my log file in the system where i have my Doorbird installed. Oddly, I’m still not seeing the INFO messages about the v2 decryption.

@DeepstarTOR Did you have to enable v2 encryption in the app?

Also note that there’s an issue already open for this.

Here’s a link to the (untested) version of the binding that supports v2 decryption.

Note, this version was built against 4.1, and likely will not work on versions earlier than that.

I use two channels from the Doorbird (doorbell, doorbellimage) and in the Doorbird app it is still set to send v2 and v1.

2023-12-06 16:32:31.760 [INFO ] [bird.internal.listener.DoorbirdEvent] - Don't know how to decrypt version 2 doorbell event

I can receive the event for doorbell, but not the doorbellimage.

When I uninstall the old binding (OH 4.0.4) and insert the new JAR into the Addos folder I get the following error.

2023-12-06 16:10:00.192 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.doorbird-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.doorbird [379]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.10.0,3.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

Ugh. Looks like the GSON version requirement has changed since 4.0.4. I built the binding against a 4.1.0 snapshot, which I suspect requires a newer GSON version than what’s in 4.0.4.

Edit: And I don’t know an easy way to fix that, other than possibly dropping the newer GSON version int the addons directory.

too bad, but then I’ll wait for the oh 4.1 release

1 Like

Any news on this topic? 4.1 also can’t decrypt V2 messages from Doorbird.

1 Like

Me too. Would be happy to get some information about this.Thanks.

Correct. That’s because I haven’t submitted the change to support v2 encryption. And I haven’t submitted the change because I haven’t been able to test it, nor has anyone else be able or willing to test it.

Hello,
I tested the snapshot.jar last days. The can’t decrypt V2 messages gone-
But I Have lot of problems with the doorbird. Only the Doorbird Image and the Doorbird Image timestamp is present. Nothing other in function. I tried the 4.01 then the jar file from github and then 4.1.1.
What shall I do to help you and me.
I am running OH 4.1.1 on debian bookworm.
openhab-log:

2024-01-16 17:50:54.019 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:50:54.019 [TRACE] [nternal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2024-01-16 17:51:01.026 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:01.027 [TRACE] [bird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 41:ghvrsn:1705423860
2024-01-16 17:51:01.028 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:01.028 [TRACE] [nternal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2024-01-16 17:51:08.036 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:08.037 [TRACE] [bird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 42:ghvrsn:1705423867
2024-01-16 17:51:08.037 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:08.037 [TRACE] [nternal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2024-01-16 17:51:15.046 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:15.047 [TRACE] [bird.internal.listener.DoorbirdEvent] - Received event not a doorbell event: 43:ghvrsn:1705423874
2024-01-16 17:51:15.048 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141
2024-01-16 17:51:15.048 [TRACE] [nternal.listener.DoorbirdUdpListener] - Dropping duplicate packet
2024-01-16 17:51:18.022 [DEBUG] [ng.doorbird.internal.api.DoorbirdAPI] - Downloading image from doorbird: http://192.168.1.141/bha-api/image.cgi
2024-01-16 17:51:22.056 [TRACE] [nternal.listener.DoorbirdUdpListener] - Got datagram of length 20 from 192.168.1.141

I don’t see where you’re receiving any notification packets. Are you sure the user you’ve configured in the thing config has API rights in the Doorbird app?

I’m back at the location with my Doorbird, and it looks like I finally got the firmware update that includes v2 encryption.

I just tested the binding I referenced above, and it successfully decrypted the v2 and v1 notification events.

Note: Unless you specify ONLY v2 notification events in the Doorbird app, the binding will process duplicate events, one for v1 and one for v2. So I think it would be advisable to specify v2 events only.

I just pushed a new version that reduces the what the binding logs at DEBUG log level.

FWIW, I’m running snapshot 4.1.0 build 3700.

2 Likes

Also note that I’ll likely convert my dev environment over to 4.2 shortly so that I can submit a PR with the changes to the binding. I’ll leave the 4.1 version of the binding on GitHub in case anyone wants to try it out.

Edit:
PR submitted. The change will be in 4.2

1 Like

I had given the openhab user all rights. The Doorbell Image and the Doorbell Image Timestamp will displayed.

Hi @mhilbush,

thanks for the update let’s see if I (noob) did things the right way:

I’m running the 4.1.0 Release Build of OH on Ubuntu Linux.
I’ve copied the org.openhab.binding.doorbird-4.1.0-SNAPSHOT.jar to the /usr/share/openhab/addons folder on OH and the logfile showed a lot of messages on the addon, so I expect it’s loaded.

Doorbird set to version 2 only, but still I get the message:

[bird.internal.listener.DoorbirdEvent] - Don’t know how to decrypt version 2 doorbell event

Try to clear the cache. I had the same

Works like a charme! Thanks you very much, wife happy again :wink:

1 Like

Thanks for the feedback!!!

FYI, I requested that this change be back ported to the next 4.1.x patch release (assuming there will be a next 4.1.x patch release). I’ll update this post if it’s accepted.

2 Likes