I am installing a fresh openhab 5 installation and want to add my lately bough ring system. When initialising the bridge I am seeing in error
11:53:26.512 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'ring:account:8687647e14' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR) to INITIALIZING
11:53:26.514 [DEBUG] [.ring.internal.handler.AccountHandler] - Initializing Ring Account handler
11:53:26.515 [DEBUG] [.ring.internal.handler.AccountHandler] - getHardwareId H:2C-CF-67-9A-43-53
11:53:26.517 [DEBUG] [.ring.internal.handler.AccountHandler] - AccountHandler - initialize - VSP: OH: /etc/openhab
11:53:26.518 [DEBUG] [.ring.internal.handler.AccountHandler] - Logging in with refresh token: STRINGEMPTY
11:53:26.519 [DEBUG] [nhab.binding.ring.internal.RestClient] - getOauthToken - refreshToken not set - trying username/password
11:53:26.679 [WARN ] [nhab.binding.ring.internal.RestClient] - RestApi error in postRequest!
java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[bundleFile:9.4.57.v20241219]
at org.openhab.binding.ring.internal.RestClient.postRequest(RestClient.java:113) ~[?:?]
at org.openhab.binding.ring.internal.RestClient.getTokens(RestClient.java:213) ~[?:?]
at org.openhab.binding.ring.internal.handler.AccountHandler.initialize(AccountHandler.java:350) ~[?:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:149) ~[?:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) ~[?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
at org.eclipse.jetty.client.AuthenticationProtocolHandler$AuthenticationListener.onComplete(AuthenticationProtocolHandler.java:164) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:218) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:210) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:481) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:461) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:424) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:374) ~[?:?]
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:596) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1723) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1552) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:208) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:148) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:80) ~[?:?]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131) ~[?:?]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:172) ~[?:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[bundleFile:9.4.57.v20241219]
very odd, so it seems like in the first place it has to do something with the 2FA account setting. I had it set to an auth app and now changed it to SMS -
When I try to login without a 2FA set it looks like this
19:52:23.025 [DEBUG] [.ring.internal.handler.AccountHandler] - Initializing Ring Account handler
19:52:23.026 [DEBUG] [.ring.internal.handler.AccountHandler] - getHardwareId H:2C-CF-67-9A-43-54
19:52:23.027 [DEBUG] [.ring.internal.handler.AccountHandler] - AccountHandler - initialize - VSP: OH: /etc/openhab
19:52:23.027 [DEBUG] [.ring.internal.handler.AccountHandler] - Logging in with refresh token: STRINGEMPTY
19:52:23.027 [DEBUG] [nhab.binding.ring.internal.RestClient] - getOauthToken - refreshToken not set - trying username/password
19:52:23.253 [WARN ] [nhab.binding.ring.internal.RestClient] - RestApi error in postRequest!
I am not seeing AuthenticationException when initializing Ring Account handler Two factor authentication enabled, enter code as in your logs (I am also not getting any sms)
When I enter the 2FA that I can find at the ring page, under register a new device it loos like this
19:53:50.136 [DEBUG] [.ring.internal.handler.AccountHandler] - Initializing Ring Account handler
19:53:50.137 [DEBUG] [.ring.internal.handler.AccountHandler] - getHardwareId H:2C-CF-67-9A-43-54
19:53:50.138 [DEBUG] [.ring.internal.handler.AccountHandler] - AccountHandler - initialize - VSP: OH: /etc/openhab
19:53:50.138 [DEBUG] [.ring.internal.handler.AccountHandler] - Logging in with refresh token: STRINGEMPTY
19:53:50.139 [DEBUG] [nhab.binding.ring.internal.RestClient] - getOauthToken - refreshToken not set - trying username/password
19:53:50.350 [DEBUG] [.ring.internal.handler.AccountHandler] - AuthenticationException when initializing Ring Account handler Bad request
19:54:29.858 [WARN ] [trol.internal.util.HttpRequestBuilder] - Parsing json failed: false
com.google.gson.JsonParseException: Empty result
at org.openhab.binding.amazonechocontrol.internal.util.HttpRequestBuilder$Builder.lambda$0(HttpRequestBuilder.java:268) ~[?:?]
at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
at java.util.concurrent.CompletableFuture.complete(Unknown Source) ~[?:?]
at org.openhab.binding.amazonechocontrol.internal.util.HttpRequestBuilder$HttpResponseListener.onComplete(HttpRequestBuilder.java:364) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:218) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:210) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:481) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:461) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:424) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:374) ~[?:?]
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:596) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1669) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1552) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:208) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:148) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:80) ~[?:?]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131) ~[?:?]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:172) ~[?:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410) ~[?:?]
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164) ~[?:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[?:?]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[bundleFile:9.4.57.v20241219]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[bundleFile:9.4.57.v20241219]
at java.lang.Thread.run(Unknown Source) [?:?]
I guess because the current code is only designed to send back an SMS code - perhaps the handling by the Ring code is different for an ‘Authenticator’ app.
@J-N-K and I talked about the potential to support a different way of logging in, via an applet - ie install the binding then go to http://openhab:8080/roborock/ and login - but have not progressed yet.
Seems right now there is a limitation that login only works with either NO 2FA (If Ring even allows this now), or with SMS 2FA.
When I get some time, I’ll switch my account to use an auth app and try fix this.
@Paul_Smedley I have changed the password on the original account and now it also worked on this one - tbh I am not sure if it that was the root cause
My previous password was “fTuh58&r#35” (no worries, this is a random generated pw and not in use for any account), maybe there is an issue with some special chars?
OK I tested the above and it works - I used a complex password with lots of special characters, and also tested with an authenticator app. I’ll raise a PR to fix this.
I believe I am experiencing a related issue. I have had it working with 2FA in the past, though I do not recall if it was working right before I upgraded to 5.0 (and now 5.0.1).
Here is my set up, followed by a DEBUG log of an attempt to bring the account thing online.
Have you removed the older 4.x binding that was manually installed, and installed the 5.0 binding via openhab?
Your error is a different root cause as you have saved token already, MPower did not. I would maybe remove /var/lib/openhab/ring/ring*.refreshToken - perhaps the token is stale/expired?
Yes, I removed the manually installed binding when I upgraded to OH 5.0 (actually, I think the upgrade tool purged everything in the add-ons folder) and and installed the native 5.0 binding (which I recognize took a lot of work to make happen - thanks for that).
I will give this a try and report back. Thanks for the help!
Update: that worked. The account thing is now on line!