Ring Binding port from 2.5 to 3.x version

Sorry to bug you after this long on this post, I went looking for a PR and I can’t find one, even an abandoned or closed one. Do you know where it went?

Awesome. For now, just let me know I didn’t break anything that was working before. I’m about to go on vacation so you’ve probably got a solid week before I can even attempt to write anything on this.

I have a ring account, just got the doorbell put in at the new house (I had ring at a previous residence before). I believe my 2fa is enabled so I think I can do the testing. Again, going to be on vacation for a bit so it may be a while before I get into this. That said, from what I remember it’s just an extra API call with the 2fa key to validate the login so hopefully it won’t be horrible to add in. I will have to get used to the code structure of the binding.

Unless anyone has any particular issues, once we get 2fa working I’ll submit the PR for inclusion (with the original authors all noted, no intention here to take credit for the work, just looking to pickup maintenance as this has gone stale).

Biggest issue people complain about the Ring binding is the speed at which it alerts you for the doorbell ringing and/or motion. There is a 2-minute delay which may be an API issue for “non” commericial use. For example, the 2-minute delay is NOT there with the Amazon integtation (showing video on the Echo devices) and other commerical integrations with their camera’s.

Not sure if you can look into that aspect of it?

Best, Jay

I’ll throw that onto a todo list. If memory serves me, I had mine dialed down to like 5 or 15 seconds. That said it’s been a few years now, they may have imposed some additional delays.

Mine is dialed down also, that is account polling period but that’s doesn’t affect the 2-minute delay though, wish it did.

Best, Jay

I downloaded your jar and put it on my system. Loading fine and binding showing up. However, being on the road as well, I could not get it up/running remotely. As soon as I create the account thing, it shows up as “unitialized”. Regardless of me putting in mail and password only, adding 2fa code or even with the unique refresh token of the formerly working thing.

Might do a scan in my network, once at home, to see if it detects the account by itself.

Sounds good. I won’t have any time to work on this for the next week. I’ll see if I can get 2fa working next week, time permitting. Otherwise, for now, please just let me know if the jar works “the same as the last one”. All I’ve really done at this point is recompile it to work on newer OH builds.

Could not resist and logged in via VPN on my server. Removed all former items, deleted all remains of the old binding jar and started off with ring from scratch. It works like a charm even with 2fa enabled.

Cannot comment though on the delay, as it is 9:15PM here in Germany atm.

Well that’s definitely a good sign!

Let me know how things go over the next week.

Sorry, but don‘t know.

I lied, the json jar was required on that jar…

But this one fixes that issue…

https://github.com/morph166955/openhab-addons/releases/download/ring/org.openhab.binding.ring-3.2.0-4.0.0-SNAPSHOT-363a2f6.jar

No worries, I’ll create a new one then. Thanks!

I’ve pulled the jar onto my OH4 system and can confirm the account comes up and 2FA also works as expected.

Added my devices, I do get these exceptions. I’ll look into it, saving here for notes at this point.

2023-03-13 16:29:55.615 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NoSuchMethodError: 'void org.openhab.core.library.types.DecimalType.<init>(long)'
        at org.openhab.binding.ring.handler.DoorbellHandler.minuteTick(DoorbellHandler.java:101) ~[?:?]
        at org.openhab.binding.ring.handler.AbstractRingHandler$1.run(AbstractRingHandler.java:84) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
2023-03-13 16:34:53.255 [ERROR] [hab.binding.ring.internal.RestClient] - RestApi error in getRequest!
java.net.SocketTimeoutException: Connect timed out
        at sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546) ~[?:?]
        at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597) ~[?:?]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[?:?]
        at java.net.Socket.connect(Socket.java:633) ~[?:?]
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304) ~[?:?]
        at sun.net.NetworkClient.doConnect(NetworkClient.java:178) ~[?:?]
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:531) ~[?:?]
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:636) ~[?:?]
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266) ~[?:?]
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380) ~[?:?]
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193) ~[?:?]
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242) ~[?:?]
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128) ~[?:?]
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179) ~[?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665) ~[?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589) ~[?:?]
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529) ~[?:?]
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:308) ~[?:?]
        at org.openhab.binding.ring.internal.RestClient.getRequest(RestClient.java:219) ~[?:?]
        at org.openhab.binding.ring.internal.RestClient.getHistory(RestClient.java:617) ~[?:?]
        at org.openhab.binding.ring.handler.AccountHandler.minuteTick(AccountHandler.java:336) ~[?:?]
        at org.openhab.binding.ring.handler.AbstractRingHandler$1.run(AbstractRingHandler.java:84) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Mine is working as before with this new build.

Best, Jay

Awesome. I’ve created a draft PR to begin to track this and get it integrated into OH formally.

I’ll create a marketplace thread tomorrow (assuming I have time) so that this can be installed from there as opposed to using raw jar files. Also hopefully it garners attention from other users so we can get a good test base.

Hey @morph166955 ,

Another thing to put on the ToDo list, low priority, is these items circled below do not work on the Ring binding. Been this way since it was originally released.

Best, Jay

What are they supposed to be doing?

No clue, they are exposed item switches. I’m guessing they are for turning the account and doorbell OFF?

I’d be fine removing them, never thought about using them :wink:

Best, Jay

I’ll delete the channel for now since we don’t know what it was supposed to do and it doesn’t do anything either. It’s only a few lines we can add back later.

I’ve pushed this out to the marketplace and started a new thread. If everyone is OK with it, let’s please move conversation to that thread to keep it all in one place going forward. Thanks!