[PROJECT] Driver for Blink API

@jpage4500:
All three of mine have a more normal looking URL. Any other particular settings related to the video showing in your state variables maybe?:

rtsps://lv<#>-app-prod.immedia-semi.com:443/<STUFF>?client_id=<CLIENTID>&blinkRTSP=true

2 of mine are xt, the 3rd is a white (Indoor).

I also noticed that LiveView only has a duration of 300... which I assume means 300 seconds. Not sure how long before a new a new URL is required though. In my testing I could request another LiveView and it would have a new URL within ~1 min (50 seconds), but when I requested one in under 30 seconds (26 to be exact) I got a 409 error (that I still need to build into the response handling).

All of my cameras are XT2. I guess maybe there's something else they added to the API for this version.

I'm wondering if I can format my URL to look like the one you posted -- maybe that would work if the server is backwards compatible with older Blink apps? Just 1 question.. what is that "lv<#>" stand for?

The URLs I had started with lv, but then there was a number that seemed to vary. Basically Blink has multiple servers responding to LiveView requests. I saw lv1 and lv2, not sure if there are more.

As for the camera type... it would be interesting if the XT2 cameras really had significant differences in the API. If you manually copy the URL into your RTSP viewer and get it to work (with the edits) let me know. The type is a data field returned... so I should be able to edit the URL based on the type of camera.

Just makes life even more fun with this API. Hopefully someone else can chime in so we get some more samples. Also if anyone has the MiniCamera or one of the brand new XTs that just launched. I am very much looking forward to getting the local data storage Sync2... but I am a bit worried it will throw everything I am doing with the API for a loop.

1 Like

Since the last update (or yesterday sometime), my PIN no longer works, and requesting a new PIN doesn't do anything. I've tried deleting everything and reinstalling, but no luck. Any ideas?

PINs are only good for 40 minutes so reusing an old one will not work. Deleting and reinstalling is really not necessary but should not hurt it, although it does alter the ClientID I have it generate. However there appears to be some evidence that Blink "remembers" the client even after all that.

If you can set the log for Trace and then run a Request PIN command and then a Get Homescreen command... Please send me the results as a PM and I will take a look (you can remove or cover any auth-token & ID fields).

2 Likes

lol.. you have your work cut out on this one :slight_smile:

anyway, i'm really happy with just having the ability to arm/disarm and more importantly enabling motion detection for individual cameras. I've even got it implemented in my dashboard app and it seems like it's working well so far.

2 Likes

Just posting this as a data point. I continue to receive Verify Device Login emails daily 24 hours apart. It really doesn't bother me and not affecting use of the app to ignore them. I will try to remember to actually do the verify within the 40 minutes tomorrow and see if that stops it.

BlinkVerify

I just found this! I was trying to avoid using IFTTT to control Blink. I tried Node-Red and the Blink node seems abandoned.

Anyways, I followed the directions as best as I could. When I ran the request pin, it took 10 minutes before I received the pin then verified it. It seemed like it was working, but it only created one camera child device along with a network and sync module. First question. Should it create a camera child device for each camera? I have four cameras.

When I try arming and disarming, it appears to do nothing, and nothing shows in the log. Refresh gives this error:

errorjava.lang.NullPointerException: Cannot invoke method size() on null object on line 1358 (ProcessHomescreen)

The other thing I noticed, I tried requesting a new pin, but I haven't received another email, and it's been a few hours. Also, when I use the old pin, it appears to still work and the authtoken appears to still be valid?

I'm having the same issue as well, let me know if you would like me to send you a PM wit the logs

@HAL9000:
The app is working but you have not verified the PIN yet, or did you have it before and then uninstall/reinstall? In any case... let me know how it works after the verify. My guess is that if you have not verified it is being triggered each day when it does the daily check of stuff (separate from the refresh polling of the HomeScreen). But I would have expected it to not be working at all if you have not verified it. If that is true... do you have multi-factor authentication on your Blink account? I suppose it is possible if someone did not.

@M6TTL:
For the PIN time... That is outside of my control, as Blink sends those. 10 min is pretty long I would think though. As for your more specific questions:

  • Yes, it should create a device for each camera. I have 3 cameras on 1 sync module, so I end up with the Parent, 3 cameras, 1 network, and 1 sync module child. I would recommend trying the "Get Homescreen" command. Also, do you only have 1 sync module?
  • The log will only have much information if you have the logging level set for Debug or Trace. Not much happens in it otherwise yet.
  • The error is a known problem I made in the driver (oops). I will have it fixed in the next version, which may be coming tomorrow night.
  • You should only ever need a PIN once. Once Blink sends you a PIN and you verify it (and it works) it should not be needed again. At that point, even if you request more Blink will ignore it. The driver will use the authtoken from that point on, because that is what Blink expects.

@dioffo:
Not sure which same issue you are having, same as Hal, same as M6? You can always send me a log and I can look things over.

@snell Thank you for your reply. After verifying the pin, one camera child device and the network child device popped up. After I clicked something else, probably homescreen or refresh, is when sync module child device was created. I'm still only showing one camera despite having four. Yes, I only have one sync module.

I also did try both debug and trace logging level, and both seem to show no response when I click arm or disarm. Initially switching to trace, I believe, showed some camera detail which was promising, but again nothing happens with arming or disarming.

@M6TTL:
Ok. That bums me out. :man_shrugging: Things must have been going too smoothly. If you could set it for Trace, and send me a log when you run Get Homescreen... that should show all 4 cameras in the response and then I can try to see if I made a goof somewhere in generating children. With all the revisions, it is possible.

I'm fairly sure I did verify the PIN process and complete verification once, although we can't rule out my hitting Request PIN inadvertently after that. I doubt it is anything your app is doing .. it is just noteworthy that Blink won't give up.

Updated Version(s):
BlinkAPI.groovy = 0.1.10
BlinkChild.groovy = 0.1.6

Change(s):

  • Error on line 1358 should be fixed. This one turned out to be a bigger deal than I thought and was preventing most device data from populating properly for some reason. Trying to get IDs listed properly for devices... such a pain. But in any case, I deleted all my children and after fixing this they all came back properly.
  • Arm and Disarm information should now be posted to Cameras also. I only have one Network to try... so if someone has more than one with cameras on each, please let me know if arming one Network only affects the cameras on the correct network.
  • Added a couple more attributes that appeared in my camera data responses... I have a copy of past ones and they were not there before so I am not sure if sometimes things do not get sent or if Blink made a change.

Different Topic(s)

  • Still have not gotten a good handle on the batteries. The ones listed as low that I replaced were reported as a voltage value of 133 by Blink. After being replaced the value changed to 178 and listed as OK. Which... HUH? They use 1.5v lithium batteries in series. So they SHOULD be 3.0 volts (or some nominal amount thereof). So my assumption that somehow it was returning an integer per 0.01 volts appears mistaken (although how it was working if it has been at 1.33V I had no idea).
2 Likes

Does the latest update include this fix?

@nutcracker:
Nope, sorry. Should be in the next one this weekend (shooting for tomorrow but Sunday at the latest, depends on how Halloween decorations and family activities go).

2 Likes

Hey @snell - thanks for your work on this! I've been dealing with the ifttt integration since the rboy integration was dropped on ST and I appreciate your efforts here!

I set this up today about an hour before your post about the update and have been running into the error on line 1358 - no matter how many times I've tried to trick the system, it only finds one camera. It did get both my sync modules and it is seeing all my cameras, just won't create the additional 9 cameras.

You mentioned an updated version 1.10, but when I clicked the link at the top it still shows 1.09. I did try it and got the same 1358 error.

Try the import again. Make sure you Save after it. He’s definitely got 0.1.10 out there. Here's the link for importing the BlinkAPI code:

https://www.drdsnell.com/projects/hubitat/drivers/BlinkAPI.groovy

Thanks @HAL9000 - I think it was a caching issue with my computer. I just did a ctrl+F5 on the code page and it refreshed to 1.10.

I'm having this exact issue. I'm new to hubitat and a lot of the process is foreign to me, but I'm stuck here with no pin email. I setup the first time no issue and got three child devices for camera, network, and sync module. I have about 8 cameras and four modules. None of these devices did anything concerning my blink system so I deleted. Started over. No pin email but the same three devices auto populated.