[PROJECT] Driver for Blink API

Look for “custom action” and choose motion as a capability.


2 Likes

Okay that makes sense, but none of my Blink Cameras (I have 10!) show up as a "motion Sensor" that I can select.


I have the latest version of the Blink integration. Any other ideas as to why these don't show up? All my actual motion sensors ARE there, but none of the Blink cameras.

EDIT: Trying a Repair on HPM to see if anything changes.

So actually that did make it show up! However, not sure what the parameter should look like. Tried "String" and "True". Nope. Your screenshot did not include the data type. Thanks!

Those motion detection methods do not take any parameters. Just leave the parameter type to "no selection".

1 Like

I’m having troubles to get the virtual driver authorized. First installation and i followed the instructions. I got to enter username/password, but when i click on Authorize (with Reauthorize set to false) no email arrives. In the logs i get the following

BlinkAPI - Unauthorized response during authorization

I enabled Trace logging and initially thought the issue is that i have a double quote in my password. I don’t think the code can handle that, but even after changing my password, i am still receiving a 401 response. My hubitat is based in the UK, in case this makes a difference. That said, with the Samsung Smarthub, i had no problem to use the api.

Any idea what the cause could be?

Thx,
Peter

Yes! That definitely worked. Much appreciated!

@wiegout: I would recommend relying more on your other motion sensors than the Blink cameras as motion sensors... because the API makes for very poor motion detection. It can only detect motion if the query to check the API happens WHILE the camera is detecting motion. You could use them through an Alexa method (as @thebearmay has details shortly above your posts) or just other motion sensors.

@user4251: I do not know if there has been someone from the UK before but there have been people outside the US. The queries to the Blink servers DO require a regionalization but that is provided as part of the authorization, which is not working for you... The code should handle a double quote (it is just part of the string). That response is more of their server at rest-prod.immedia-semi.com/api/v5/account/login does not like it. Normally the "prod" portion should be replaced with whatever your regional server is... but on the first connection it does not know that yet. I wonder if they changed it so that accounts have to only go to their "correct" URL and prod will only work for those that it is the primary.

Checking if I can find a list of what your correct one should be... and we can see if we can "force" it.

UPDATE:
OK... I found something (thanks to Google) about an HA user in the UK. Their server is apparently rest-prde... but that was years ago. So... if you are willing to try it, you could try these steps:

  1. In the BlinkAPI.groovy, uncomment the "DoSomething" command on line 162 (I use it for testing things).
  2. Go to line 193 and paste ProcessState( "Tier", "prde" )
  3. Save the driver code.
  4. On your parent device, run the "DoSomething" command.
  5. Double check that a "Tier" State Variable with prde has been added.
  6. Try the authorization process again.
    That should pre-configure the regional server.

Thanks. Only using that to disable a camera motion detection during sprinkler operation early in the morning. Was getting a ton of motion events that were just water hitting the camera.

1 Like

Ah! Makes perfect sense then. Since you know when the sprinklers will run, you can avoid it. Sounds like another good example use case.

I just tested the original url (rest-prod) using Postman from my laptop (uses same out ound connection as hubitat hub) with the same url and json body and it worked without issues. I didn’t change the user agent (default is Post,anRuntime)

UPDATE: I added more logging to get to the response body and the reason is Invalid credentials. Now the interesting thing is that i copied the body from the hubitat log of the unauthorized request into postman and in Postman the request is successful.

Could be a user agent blocking (just a guess). Could you try entering the latest in your preferences, saving, and trying again? The latest for an Android device appears to be:
Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.122 Mobile Safari/537.36

No luck, new user-agent still returns the same 401

Ok, it definitely had something to do with the password. I used a very strong password - 16 characters and lots of special characters like double quote, percentage, etc. i simplified the password and it works. Is it possible that the http library expects encoded passwords?

Is there a way to arm Blink through HSM when away?

I tested all characters and the one that causes the error is “<“.

You can arm/disarm the Blink networks within Rule Machine or enable/disable motion detection on particular cameras, because Rule Machine offers custom commands to do so. HSM has a separate Arm/Disarm for itself and does not appear to be able to send custom commands, so it would not be able to arm the Blink cameras.

Not sure why "<" does not work... but it is good to know. Maybe triggering some sort of oddity with the http portion that Hubitat uses. Thanks for investigating it and posting the troublemaker. Glad you got it working!

True however Rule Machine can be trigged on HSM status events to achieve the same result.

1 Like

That would be a workaround. Since I am not familiar with HSM (I do not use it myself) I was just going by what it showed it could do when I installed it and checked it out before answering. Glad the community can help as always!

I’m using Geofancy to change the mode to away when all are out. A basic rule reacts to mode=away and activates Blink Sync module. Not sure why I used Blink sync module, but it seems to work. Probably because it was the quickest to identify as a Blink device by name. Should I activatecthe network or the cameras directly instead? If yes why?
I use now HSM when there is movement and mode is away, but it doesn’t get triggered. As a workaround i also configured a standard notification.

There are multiple methods to arm/disarm the devices and the sync module is just fine for it, so no problems there.