Blink Binding

From what @Jogobo said up here, maybe removing this line can be the first thing to try (I’m just trying to help, not saying what you should do, I’m only a grateful user willing to help to the best of my knowledge):

1 Like

As far as I digged into the login process via curl and bash I can say that it depends on the time since last “rauth”. If it is too long “reauth” fails and a login with ‘{ “reauth”:false }’ results in a new PIN sent via SMS.

So if there is an auth token and login with “reauth=true” fails, I send a login request with “reauth=no”, verify the PIN and everything I moved to bash scripts works as expected. Set the time between two logins with “reauth=true” to 12 hours and up to now, I had no problems.

That’s great ! Thank very much. If you need help testing you can count on me again.

How can I set up?
I tried to delete the blink-thing an add a new blink-account, but there are no options to set “reauth”.
For a new think, no pin is generated :frowning: and the error “Blink API Call unsuccessful <Status 403>” is shown immediately after activating the blink account.

1 Like

There is no way to do this manually in openHAB (at least for the moment). My posting was just a hint for the developper of the binding where the solution might be found.

Alright. Another heads-up. This is caused by the User-Agent header set by the Jetty Library used in OpenHab (Jetty/9.4.50.v20221201, can reproduce it in Postman)

See also Change User Agent in HTTP Binding

I must see if I can find a way around that.

So it turned out that the AWS service blink is using got a little more restrictive. Next to the user agent, it also discarded parameters not sent in the body (don’t know why I didn’t implement it that way in the first place). So after jumping from 403 to 403, here’s a working version:

Please let me know it that works for you

3 Likes

it works, thank you :+1:

Things are online again. But I’m not sure if it works as before.

I take a new thumbnail every hour by sending “ON” to my “setThumbnail” item. A couple of seconds later the “getThumbnail” item received a change event and I then saved the new thumbnail to my hdd.
After installing the new binding the thumbnail was refreshed at the desired time but the “getThumbnail” item did not get the “changed” event. Will keep an eye on it for the next couple of hours.

Looks like the event listener was not ready when the first picture had to be saved. Now everything works like “before 403”.

Thanks!

Hello Mattias,

thanks for your support and the fix.
Did you make the fix based on the version 4.1.1 from Wouter Born from January 9th or based on your sources ?
I now have the error again that I only get the image loaded from one camera.

2024-04-19 13:02:36.800 [WARN ] [blink.internal.handler.CameraHandler] - Failed to create thumbnail servlet
java.lang.IllegalStateException: ServletModel{id=ServletModel-51,name='org.openhab.binding.blink.internal.servlet.ThumbnailServlet',alias='/blink/thumbnail/247398',urlPatterns=[/blink/thumbnail/247398/*],servlet=org.openhab.binding.blink.internal.servlet.ThumbnailServlet@53bcb92d,contexts=[{HS,OCM-47,default,/}]} can't be registered. ServletContextModel{id=ServletContextModel-4,contextPath='/'} already contains servlet named org.openhab.binding.blink.internal.servlet.ThumbnailServlet: ServletModel{id=ServletModel-50,name='org.openhab.binding.blink.internal.servlet.ThumbnailServlet',alias='/blink/thumbnail/764267',urlPatterns=[/blink/thumbnail/764267/*],servlet=org.openhab.binding.blink.internal.servlet.ThumbnailServlet@65e5f24,contexts=[{HS,OCM-47,default,/}]}
	at org.openhab.binding.blink.internal.servlet.ThumbnailServlet.<init>(ThumbnailServlet.java:57) ~[bundleFile:?]
	at org.openhab.binding.blink.internal.handler.CameraHandler.initialize(CameraHandler.java:166) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	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:840) [?:?]

Regards
Guido

Hi Matthias, thank you for the efforts you have done so far, really appreciated. Unfortunately in my case the new version doesn’t work, ending up by the following message:

java.io.IOException: java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header

at org.openhab.binding.blink.internal.service.BaseBlinkApiService.request(BaseBlinkApiService.java:87) ~[?:?]

at org.openhab.binding.blink.internal.service.BaseBlinkApiService.apiRequest(BaseBlinkApiService.java:75) ~[?:?]

at org.openhab.binding.blink.internal.service.AccountService.login(AccountService.java:67) ~[?:?]

at org.openhab.binding.blink.internal.handler.AccountHandler.lambda$0(AccountHandler.java:149) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

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:840) [?:?]

Caused by: 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) ~[?:?]

at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]

at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]

at org.openhab.binding.blink.internal.service.BaseBlinkApiService.createRequestAndSend(BaseBlinkApiService.java:126) ~[?:?]

at org.openhab.binding.blink.internal.service.BaseBlinkApiService.request(BaseBlinkApiService.java:83) ~[?:?]

... 9 more

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) ~[?:?]

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:1723) ~[?:?]

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) ~[?:?]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[?:?]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[?:?]

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[?:?]

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[?:?]

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]

at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]

Good news:

It was a bit tricky, trying a lot at the beginning without any impact on the blink:account thing, not getting it running. Therefore I have cleaned up the field by deleting everything and setting up the full package again: blink:account, Blink Sync 2 and all the things for the cameras, using the new binding version of @doktormo. I even had to “insist”, the validation by the validationUrl took a hell of tries and time, much more then at the initial installation, I got some strange thumbnail servlet creation error messages – however, here we are, everything is running now again.

Thank you, Matthias, again for your devoted work. I’m not feeling confident and happy having you on the road as your last contribution to this binding…:cry:

Hello Josef,
I’m glad you got the binding working again. So far I have used the binding directly from the Marketplace. Now I have to install and set up the binding manually and that’s where my problem lies. I have no idea how to set up the things for the account and the sync module. Would you be so kind as to help me out here and give me your definition? That would be super helpful.

Thanks in advance

Tobias

Hi Tobias,

I’m not sure what you mean by „So far I have used the binding directly from the Marketplace“. I was not aware about any Blink binding on the Marketplace. But maybe it’s just me, maybe I’ve just misunderstood your sentence. Anyway, delete first all your existing Blink binding elements coming from any “Marketplace” if any.

Just download the last jar file Matthias has published yesterday – see above in the chat, put it into your openHAB addons folder and wait a second.

For the rest, just use this manual: openhab-addons/bundles/org.openhab.binding.blink at blinkbinding · moesterheld/openhab-addons · GitHub

Some highlights:

In order to discover cameras, a blink account bridge has to be configured. After configuration, all available cameras and networks will show up in auto-discovery.

blink has implemented a 2-factor-authentication, so after the first login, a email or text message (as configured in your app settings) will be sent to you. This pin code needs to be entered into a form generated for each blink account bridge.

The URL for pin verification is /blink/. The easiest way to get this, is to copy the validationURL thing property (#6 out of 7). This particular step might take some time, but at he end you should receive a validation PIN from Blink via SMS or email, you have to fill it into the validationURL website. Then your blink:account should get ONLINE.

Hi Josef,

thanks for the quick answer. With Marketplace I mean that I install the binding directly from the paper UI. But as this is not working anymore I already copied the .jar file in the addon folder and delete any „old“ items and the old binding. So far so good.

But after that step I don‘t know how to proceed. I already found the manual, but I don‘t know how and where to setup / configure the blink account thing… here I would need a little help…

Hi Tobias,

As soon as the jar file is in the addon folder, you should see the blink Binding under Paper UI „Choose Binding“. Clicking on it, you will end up by 3 potential things the binging is offering to you:

  • blink Konto
  • blink Kamera
  • blink Network

Just start with the blink Konto, clicking on it you will be already be in the configuration menu of the blink Account. After creating the thing, the validation step will follow – as mentioned in the manual.

After getting the blink Account thing online, you can start to enable your cameras, they will be shown under Add a new Thing: blink via scan.

Fantastic - Many Thanks.
Replaced my previous .jar and everything just started working again without any input from me!
Really do appreciate your time and effort. Pleas post a link to your buy me a coffee or equivalent.

Hi Josef,
nothing to see in the Binding section… Maybe the .jar file doesn’t work with OH 3.4.4? Which version are you using?
And what I also see is, that via the Console and the command Bundle:list the Binding has the status “installed” but not “active” as the others. Do you have an idea what I could do next?

BR
Tobias