Blink Security Camera Binding

Hello everyone,

I got myself a blink camera on Black Friday and since there’s no binding, I decided to seize the opportunity and write one myself.

Most recent version is now always available from the OpenHAB marketplace. Blink Binding

So far I have implemented:

The blink account as a bridge (using the two factor login), with auto-discovery for these things:

A “network” thing, which corresponds to the blink sync modules, this allows

  • arming/disarming the system

A camera thing with the following channels

  • enabling/disabling motion detection
  • low battery
  • temperature
  • create a new snapshot
  • retrieve current snapshot

This will probably be sufficient for me. The API (unofficial documentation) offers a couple of more options, the most interesting probably being retrieving the latest recordings (in mp4 format).
Unfortunately, the API only returns a proprietary stream format for the blink app and Echo Shows, so streaming a live video with the binding currently won’t be possible.

Now, before submitting the add-on as a pull-request (still have to go over my unit tests, internationalization and documentation before that, anyway), I have a couple of questions to you all:

  1. Is there anyone out there who is interested in beta-testing my binding? I only have one sync module and one camera. In theory, it should also work in larger setups, but I’d be happy if someone would test this for me.
  2. If you would use this add-on, what additional functionality would you be interested in?
  3. Using the API is, in theory, not allowed by third party clients. However, other home automation systems have plugins using the API. At some point, using the API might not be possible if restrictions are enforced. Should I still submit it to the official add-on repository or might that be a problem? Of course I’ll emphasize this point in the documentation, too.

I’ll be glad to hear your opinions and maybe find some willing guinea pigs :grinning_face_with_smiling_eyes:

Matthias

4 Likes

Hi Matthias,

I have 4 cameras connected to 2 sync modules. Very much interested in such a binding and I would happy to support in testing.

Cheers
Matthias

Hi Matthias (nice name by the way😉),

that’s great!

I’ll add some documentation and tie up some loose ends. I guess I could send you the jar this weekend. Unless you would like to check the code and build it yourself. Then, I would send you a GitHub link.

Any additional functionality you would like?

Thank you,
Matthias

Hi Matthias

These are awesome news! Like you I bought a Blink camera on Black Friday and started playing around with IFTTT, but involving a cloud service just for arming/disarming feels really like a workaround.

I haven‘t studied the unofficial API documentation yet, but do you think that a ‚presence detected‘ trigger would be possible to add to the binding?

Cheers,
Sascha

1 Like

Hi Sascha,

on the one hand, I have to disappoint you. The binding is still using the blink API, calling the blink servers. I don’t think the blinks were designed with “offline” usage in mind. However there is more functionality available from the API than from IFTT.

A presence detected trigger, for example, should be possible. I have seen it in other plugins. However, the reply won’t be immediate since it won’t be triggered by the Blink servers, but the servers are polled regularly. I still haven’t found a good advice on how short this interval can be set without upsetting the blink servers and getting locked out temporarily.

Cheers,
Matthias

It‘s fine to use their servers. But IFTTT is a component that I somehow dislike in my process chain and that will be obsolete :grinning:.

Also understood that a trigger could only be realized by a poll. I assume that could affect quite negative the energy handling of the system. Afaik doing so would tell the sync module to call the camera by radio signal to wake up and connect to wifi for communication with the cloud servers.
Polling regularly might drain the cameras batteries in a short time.
So probably polling the state is not a good idea.

Looking forward to your binding!

Good point with the energy handling. I’ll check into that.
Sorry for the delay, if (first_snow && kids) developmentTime--

I have uploaded a first version of the binding, compiled for OpenHAB 3.1.0 (will probably work with 3.0+) to https://drive.google.com/file/d/1gSc-iYcRsm0n9b7jpOkALh7fIx_aPmVu/view?usp=sharing

If this is against the community rules, please remove the link.

If you feel intimidated to install an addon from a dubious source (you should, actually), I understand.
However, the pull request for the addon won’t be ready till the end of the week and then, it’ll be available in the 3.2.0 version if everything works out, unless you want to build it from source. I don’t know what the best practice for providing early access is in this case. If there’s a better way, please let me know. If nobody is interested in early access anyway, please let me know, too. :wink: In that case, I’ll just walk the pull request road without providing a jar in the meantime.

This version contains all the above-mentioned channels and should be pretty self-explanatory, even the 2-factor-authentication part. Just drop it in your openhab/addons folder and add a blink account thing.
The 2-factor-authentication form is still basic html (= ugly) and the getThumbnail channel is still a little buggy. Other than that, everything should work as expected. Negative impact on your OpenHAB is highly unlikely.

Any kind of feedback is welcome.

Cheers,
Matthias

Hi Matthias,

I have installed you blink binding and really looking forward to get it online :slight_smile:

Currently I have the problem after typing in the verification pin to get the blink Konto online I receive this error message:

HTTP ERROR 500 javax.servlet.ServletException: java.io.IOException: Blink API Call unsuccessful <Status 400>

URI: /blink/56409a639a
STATUS: 500
MESSAGE: javax.servlet.ServletException: java.io.IOException: Blink API Call unsuccessful <Status 400>
SERVLET: org.ops4j.pax.web.service.spi.model.ServletModel-128
CAUSED BY: javax.servlet.ServletException: java.io.IOException: Blink API Call unsuccessful <Status 400>
CAUSED BY: java.io.IOException: Blink API Call unsuccessful <Status 400>

Do you have any idea…

Best regrds
Martin

The same I received when testing this morning.

Hi Martin and Matthias,

thanks for checking out the binding.

Unfortunately, it looks like the Javascript of the verification page isn’t loading correctly on Linux in the version I have uploaded due to incorrect line endings (since I built it in Windows). This problem won’t occur in the officially built version. An updated version will be available from the link in a couple of minutes.

Regards,
Matthias

Alright, updated version is online and verified as working on Linux.
I had to switch back to the “ugly” validation form as there was something else amiss, too. I’ll fix it when I have a little more time.

By the way, I submitted the pull request, so the documentation is online:

Hi Matthias,

I downloaded the updated version above and put it into the addons folder. But now it’s not showing the thing anymore. No change after restarting OH3.

Regards,
Matthias

Is there anything in the logs after adding it to addons? Are the permissions / ownership ok?

I had the problem with addons copied with sudo having root.root ownership and 500 as file permissions, thus not being recognized by OH

sorry, was my fault. So far both sync modules and all 4 cameras automatically discovered. Will continue during the weekend.

Hi Markus,

tha account is now online, thanks.

I’m struggeling a bit with the Network ID - isn’t that the IP V4 adress? I don’t kno what you mean with " Required Interne Network ID (bitte per Discovery ermitteln)." ->x Class C ?

Networks and Cameras are meant to be auto-discovered, the ids are the internal ids of sync modules and cameras used in the blink API.

Click on add new thing, go to blink binding and hit the scan button. Networks and cameras should then be in your inbox.

Hi Matthias,

I have 3 camera systems installed, however, data is only received once ( after the varaibles have been initialized) writing works, so if I e.g press the “take a picture” button", the Blink camera is doing it, but no response…

1 Like

If I make a change on one of the Blink items and store it, all Blink items receive an update for on time (mabe a tempreature has changed, or a new picture was stored)

Hi Matthias,
I’m interested in your binding. I currently have 4 cameras and 1 sync module working with their trial subscription.
Thank you so much for doing this!!!

1 Like