[PROJECT] Driver for Blink API

SharpTools has a feature called Custom Tiles which gives you the ability to build mini apps using HTML + JS, so I suspect it would be possible, but of course would require a bit of developer skills:

That sounds a good starting point, the question is where I can find the URL ?

There are 3 main elements you will need:

  1. The base URL varies by type of camera. Camera (Indoor, XT, XT2, Outdoor), Owls (MiniCamera), or Doorbells. But these can all be found listed (as sample Params prepped for httpGet or such) in the parent driver on lines 911 to 913 (at present). All the variable fields in there you could hard-code for a particular camera because the IDs will not change in the API, EXCEPT the ThumbnailFile, and the AuthToken.
  2. The "Thumbnail File" attribute will change whenever a new thumbnail is taken. But since it is an attribute for each camera-type child device you could easily poll it from a Rule or such.
  3. The AuthToken listed in the headers section will be a bit more problematic. I do NOT expose it as an attribute in the parent device (for security reasons). So right now there is not a way to use it outside of the driver. IF you want to make it an attribute you would need to perform two steps:

a) Add an attribute to the parent "BlinkAPI.groovy" driver by inserting a line after 235:

attribute "AuthToken", "string"

b) You would need to change where the AuthToken is presented. Right now it is on line 519. If you replace that line with the below line, it will now post an Event for the AuthToken and it will be useable by Rules or such:

ProcessEvent( "AuthToken", ResponseData.auth.token )
2 Likes

Hi!
I have the same issue like markbellkosel84 posted on 7th of may.

I have a system of 2 Blink cameras and two sync moduls running without issues by using the BlinkAPI and Childs. Works well, automations created, no issues.

Then I bought 2 weeks ago a 3rd camera and a 3rd sync module. I cannot add it by pressing GetHomeScreen.
Was trying reauthorization, nothing helped. Saved again the drivers as well, nothing.
I need 3 sync modules because of the distances, to add it to another existing sync module is not really an option.

In parallel I have a Raspi running with HomeAssistant to implement on my HE dashboard the cameras which pic will be refreshed ervery 30min via picture path pointing to the Pi's www folder.
The HA Blink integration was updating and implementing the 3rd new camera and module without any issue. So, this makes it clear that the issue is on the hubitat.

I receive the following messages:

2022-07-27 12:56:26.857 errorjava.lang.NullPointerException: Cannot get property 'label' on null object on line 2422 (method ProcessHomescreen)
dev:4322022-07-27 12:56:26.850 error Blink Cameras - Failure to add Network-207036 and post Name=Pool
dev:4322022-07-27 12:56:26.848 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.844 error Blink Cameras - Failure to add Network-207036 and post Arm String=Disarmed
dev:4322022-07-27 12:56:26.843 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.839 error Blink Cameras - Failure to add Network-207036 and post switch=off
dev:4322022-07-27 12:56:26.837 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.793 error Blink Cameras - Failure to add Network-207036 and post Armed=false
dev:4322022-07-27 12:56:26.791 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.787 error Blink Cameras - Failure to add null and post Daylight Savings Time=true
dev:4322022-07-27 12:56:26.785 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.781 error Blink Cameras - Failure to add null and post API Data Updated=2022-07-19T18:14:22+00:00
dev:4322022-07-27 12:56:26.779 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036
dev:4322022-07-27 12:56:26.775 error Blink Cameras - Failure to add Network-207036 and post ID=207036
dev:4322022-07-27 12:56:26.774 error Blink Cameras - BlinkChild-Network driver is not loaded for Network-207036

I try to avoid to delete childs, several automations are created and linked therefore.

Any idea?

THX!

Dan

Do you have the BlinkChild-Network.groovy driver loaded? It missing appears to be most of the errors.

I run two hubs myself, so I know it does work that way.

Hi!
Thx for the fast reply.
Men... u r right. Wasn't installed. I added now the network AND the sync driver as well.
All devices found and assigned corretly.

What did I wrong?:
Last year I was just installing the REQUIRED drivers. Was no issue, automations were working with available attributes.
Your point 6 in the instructions I was not considering... Dont ask why.
If u allow me to make an recommendation...: In your instructions I would change OPTIONAL to REQUIRED, based on the type u install and thats it.
...its required to read all the instructions. U could say that also, true. Just tell u my approach and the problem is mostly in front of the PC.

But, ey, u r the boss. I just tell u what I missed.

Anyway, thx!!!
Works perfectly thx to u.

BR
Dan

I am actually thinking about changing Network to a required one. It seems every Blink account has one via the API.

Maybe I will look more at the initial instructions as well. Just to confirm, you were using the drivers directly, not via HPM?

Yes, I confirm that I was using the drivers directly.

To change at least network to required would make for me totally sense.

As I was doing that last year the first time, I was wondering what is that child "network"?!
2 childs are clear, camera and sync module based on the hardware in my hands. And with the 2 cameras and 2 sync modules it was completely working with only having the required drivers installed.

If u would change the drivers according to the hardware of the user to required + always network to required it is directly correct installed. It would be for me not optional if u want your hardware properly running, because I was able to run it without optional drivers (only with API and child groovy) till 3rd device was in the game. But this is not your intented usage. Every child type has its own driver.

Thanks for your work, its running amazing.

BR
Dan

Honest question. What do people use the Blink Integration for? I have 10 cameras and set it up a few weeks ago. I discovered you cannot grab images from the cameras. And you can't depend upon the camera motion detection for realtime usage. While this code was a ton of work for the developer and I appreciate the efforts, I can't figure out what value my fellow Blink users are getting from the integration?

To arm the cameras inside the house when mode switches to Away, for example.

2 Likes

Like @HAL9000 said, it is primarily to Arm/Disarm the system (and Enable/Disable motion for the main cameras) in sync with your overall Hubitat.

When I first started making it I was very excited about being able to post the thumbnails on my dashboard.. Arm/Disarm was a very close second though... with video being a distant 3rd. As I started making the drivers though... I discovered that the thumbnails were not possible at that time (and still are not), nor was the video. But at least I got the 2nd place feature. Since then I have tried to make everything possible from them but there are definitely limitations that are a bummer.

2 Likes

This one capability alone was enough for me to kick IFTTT to the curb.

1 Like

I use my one and only "free" IFTTT to Arm/Disarm. If they decide to charge for just one IFTTT rule, I guess I'll have to reload the Blink App. Meanwhile, I uninstalled for now. Thanks for your input guys.

1 Like

I am trying to do just that. I have 1 cam inside and one outside. If I am in the house, i would like in inside cam off, or motion detection set to off- while the outside cam is on. And when I leave turn on motion detection for the inside cam. I can't seem to do this-- is there a step by step process i can follow (I have the devices and drivers installed).

I know from this thread that others have had success turning motion detection on and off at the camera level, but that isn't something I've had to do. All my indoor cameras are on one sync module and all my outdoor cameras are on another, so I can simply arm and disarm at that level.

ok thanks. looks like my problem is I only have 1 sync module.

I think you should be able to do it by enabling/disabling motion detection per camera. I just have never done that so cannot offer any assistance.

thanks. @snell - any hints? thanks

Even if you only have 1 sync module, when you look at the Device list on your hub you should see (in addition to the Blink Camera System Master) a child device that corresponds to each of your cameras. If not, there may be some issue in how you have the driver installed. They'll also be a network device (under the Blink Master parent device) that corresponds to your sync module.

Then you would use an app like Rule Machine (I happen to use WebCoRE) to activate the Motion Detection Enable / Motion Detection Disable function for each of the cameras individually according to your preferences. I don't bother with arming/disarming the master system or networks; I just leave them always armed and control motion enable on the cameras individually.

In WebCoRE, for individual cameras these commands are MotionDetectionEnable and MotionDetectionDisable. If you're using Rule Machine, I would expect something similar to be available.

1 Like

@ryan3:
@Tony seems to have summed it up pretty well with the Rule Machine (although I can do some exact steps if you need). HOWEVER, one thing to confirm... is the indoor camera a MiniCamera? I do not think so because you mention the sync module, and mini's do not use one, but want to be sure. If it IS a Mini... you cannot control the motion because the API does not have any (known) way of doing so. It CAN control the Arm/Disarm of the Mini's individually though.