Blink Security Camera Binding

I was able to reproduce this, just today.

It looks like the API is being called with a stale security token, which gets replaced with a new one after calling the login endpoint again during reenabling of the bridge.
Don’t know why that wasn’t an issue before. I’ll add a perodic refresh of the token. Look like every 12 hours should be enough.

Thanks for reporting!
Matthias

Thank you very much! I have been waiting for this for years! Best christmas present :wink:
How can I use this binding? I mean, how can I integrate this in my openhab Installation?

Wow, so now I am a bit disappointed. Not because you made this great binding, but because I have started implementing roughly the same binding this weekend without checking if someone else did. :relaxed:

From what I can see, our approaches have quite some similarities, so I guess I will drop my binding and try yours instead.

From what I have implemented in my binding I would like to make a few suggestions:

  • when a HTTP call returns 401 unauthorized (as done in the blinkpy library, maybe the status is 409?) although a token is available, reset the token and try logging in again and then retry the current action (instead of periodic refresh)
  • add a periodic refresh of the homescreen and update all channels based on the result, so changes made via the mobile app are reflected after a given time
  • check the results of the command api (enable/disable, arm/disarm) in the background and trigger a homescreen refresh after completion instead of updating the corresponding channels directly. This would save a few false-positives in case of “system is occupied” or “timeout” (which happen quite a lot if three people are updating the same camera from their mobile apps at the same time)
  • automatically get a new thumbnail if the thumbnail-URL changes with a homescreen refresh and update corresponding channel. In the current code I can’t see that channel updated anywhere except when OpenHAB sends a Refresh command.

Would you be willing to pick up any of those or maybe even let me contribute?

Hi Sascha,

first of all, you’re more than welcome to contribute. Please contact me directly so we can set it up on Github.

Thank you for your suggestions. I haven’t updated the pull request, since I wanted to finish the documentation of the new code.
Except for the first suggestion, the other suggestions are already available in the recent version of the addon (the one available through the link above):

  • add a periodic refresh of the homescreen and update all channels based on the result, so changes made via the mobile app are reflected after a given time

Homescreen is polled with the given refreshInterval config parameter and states updated accordingly.

  • check the results of the command api (enable/disable, arm/disarm) in the background and trigger a homescreen refresh after completion instead of updating the corresponding channels directly. This would save a few false-positives in case of “system is occupied” or “timeout” (which happen quite a lot if three people are updating the same camera from their mobile apps at the same time)

Addon is now using the async command callback to get the finished status of the async actions instead of “predicting” the result

  • automatically get a new thumbnail if the thumbnail-URL changes with a homescreen refresh and update corresponding channel. In the current code I can’t see that channel updated anywhere except when OpenHAB sends a Refresh command.

Thumbnail state is now updated during homescreen refresh (see above) and also after the setThumbnail returns successfully.

As for the first one, I was thinking about a 12 hour refresh of the token. But I’ll add your suggestion of trying to refresh the token once after a failure.

Cheers,
Matthias

Hi _radza,

How can I use this binding? I mean, how can I integrate this in my openhab Installation?

right now the addon is only available as a pre-compiled jar through the link above. You have to place this jar in your openhab addons directory and openhab will pick it up automatically.

Hi all,

Sascha made some excellent contributions to the binding, bugfixing and optimizing the code. An updated version is available through the new link (since its now a 3.3.0-SNAPSHOT version):
https://drive.google.com/file/d/1rMMoMOizZmr5RzgaYPUJWbCQpyO7d3ot/view?usp=sharing

Merry christmas everyone!

Matthias

2 Likes

What a nice Xmas present :smiley:
Thank you both very much!

Have some great christmas days!

Ciao Mattia io sarei davvero interessato, ma vorrei che tu mi insegnassi come rilevare i miei sistemi blink, sono un principiante se ti va di insegnarmi te ne sarei grato buon Natale

English please, this is an international community!

Merry X-Mas

Sorry

Hi Mattia I would be really interested, but I would like you to teach me how to detect my blink systems, I’m a beginner if you want to teach me I would be grateful Merry Christmas

Hi Matthias,

Great Work, everything is working without fails.
Is ist possible to get Temperatur in degrees Celsius ?

Greetings Guido

When the power goes off definitely, the Blink camera will automatically be … For D-Link router, click IP & MAC Binding->Binding setting on the left page.

advancedmd

Hi Guido,

did you use the most recent version from here:

This version returns the temperature as a convertible unit.

Regards,
Matthias

Hi Matthias,

Happy new year, I have just added the Things via the Admin Console and then created an item file. Now the temperature is displayed in °C.
Thank you for the tip.

// Blink Kameras
Number:Temperature Temperatur_Blink_Terasse "Terasse: [%.1f %unit%]" <temperature> (GP_SENSOR_TEMP)
        { channel="blink:camera:eebxxxx8f50:256xxx6:temperature" }

Best regards
Guido

Hi & happy new year!

I am running the 3.3.0 version for a couple of days now and had again some (2-3)

Blink API Call unsuccessful <Status 409>

errors :cry:.
Did you also encounter this behaviour?

Hi Sascha,

I am currently working on an error handling that attempts a reconnect after refreshInterval after any communication error. Patience pls :slight_smile:

Hi Sascha,
thanks for the update.
Looking forward to the next version :slight_smile:

Hi all,

the newest version is online through the link.
Thanks to Sascha, everything should work smoothly now.

All the best
Matthias

Good morning Matthias and Sascha,

thank you both so much for this new version!
I got the new version running for 3d now and didn’t get any Status 409 anymore :slight_smile:

But in my logs I found new message:

Error calling Blink API. Reason: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header internal.service.BaseBlinkApiService

Are you aware of this?

I also saw that you’ve added the trigger for a movement recognition with is awesome! I haven’t tested it yet but will do soon.

Thanks again for your fantastic work!