[Deprecated] BI Control - Local Blue Iris control

Introducing 'BI Control'
This app is designed to work locally with Blue Iris security software.

Note: This was written for BI4. If using BI5 results may vary.

This app has been merged into Event Engine - Automate your world with easy to use Cogs. Rev up complex automations with just a few clicks!

  • 100% Local Control - No Internet needed
  • Ability to change BI Profile based on HE Mode, Switch or Motion
  • Ability to move a camera to a Preset using a Switch or Motion
  • Ability to get a Camera Snapshot using a Switch or Motion
  • Ability to start or stop manual recording on camera using a Switch or Motion
  • Ability to control PTZ using a Switch or Motion
  • Uses Hubitat's standard Virtual Switches
  • Devices are also available to use in Rule Machine, Alexa and Google Home
  • Parent/Child App structure
  • Create as many child apps as needed

Apps can be found on my GitHub or by using the Bundle Manager.

When reporting problems...

  • Be sure you are on the latest version. I won't troubleshoot an older version.
  • Turn on debug and screenshot the issue happening in the log. One line or just the error doesn't cut it. I need a log.
  • Post the screenshot of the log with an explanation of the problem.

Thanks


Note: (this was written for BI 4, not sure if it'll work in 5)
BI Control is one way, Hubitat to Blue Iris. BUT... there is a way to receive alerts from Blue Iris just using Rule Machine!
Note: This was written for BI4. If using BI5 results may vary.

  • In Rule Machine:
    • 'Create New Rule', 'Define a Trigger', 'Name the Trigger'
    • 'Select Trigger Events', 'Select capability' = 'Local End Point'
    • Note: you will need the 'Local End Point URL' in Blue Iris
    • 'Select Actions' to do whatever you like!
  • In Blue Iris
    • Select the Camera to use as a Trigger then 'Right Click' and select 'Camera Properties'.
    • Select 'Alerts' and then check-off 'Post to a web address...' and then click 'Configure'
    • Under the heading 'When Triggered', make sure that "Http://" is selected
    • Then next to that box, put in the 'Local End Point' URL from Hubitat. Note: do not include the Http:// ... just start with the ip address. (ie. 192.168.1.123/apps/api/....)
    • Click 'OK' and your done!
21 Likes

Great, My BI cameras are one of the last things I still have in smart things. I use my cameras to trigger virtual motion sensors in ST. Does this allow for that?

BI Control is one way, Hubitat to Blue Iris. BUT... there is a way to receive alerts from Blue Iris just using Rule Machine.

I've updated my post #1 explaining how to do this. :slight_smile:

I've been using the maker API and have setup Virtual "Motion Sensors" in HE. It works perfect and requires no extra tools. Simply create a "Virtual Motion Sensor" in HE. Install the Maker API, choose your sensor in the Maker API app. Then click "Get All devices" to get your device list. You'll see something like this:

{
        "id": "170",
        "name": "BI-Backyard Garage",
        "label": "BI-Backyard Garage"
    },

You just need that ID: 170

Look down below on the maker API page and you will see code showing you the URLS in the example above we will have the URL we need:

http://192.168.13.46/apps/api/206/devices/[Device ID]/[Command]?access_token={YOUR ACCESS TOKEN}

So this would be my URL to turn "active" my motion sensor:

http://192.168.13.46/apps/api/206/devices/170/active?access_token={YOUR ACCESS TOKEN}

Notice I replaced device ID with my ID and Command with "active". Just change that to "inactive" to turn it off.

Then in BI under the camera just go to the "alerts" tab and for URL use the above. AGAIN WITHOUT THE HTTP:// part. You select that in a drop down.

Likewise you can send a URL in RM to BlueIris to change modes very easily.

In RM use the following URL

http://192.168.13.60:81/admin?profile=2&user=admin&pw={your password}

That sets profile to 2.

If you need more information I can take BI screenshots to show this better.

OR Use this app (sorry wasn't trying to say not to) but letting people know it's pretty easy (and local) to control both ways with only the maker API.

@bptworld code above is obviously going to make this a bit cleaner.

5 Likes

Sure, that will work... but if you want to say "Hey Google, turn Front Yard Camera Preset 5 on" (camera magically swings around to where the action is), then you need a switch. :wink:

Best thing about Hubitat is there is always more than 1 way to get something done. Find what works for your situation and run with it!

2 Likes

Agreed and I like the flexibility that Hubitat offers in some generic (like Maker API) apps.... AND the fact that as folks like you create apps specifically for things...it just makes life easier!

BTW, Thank you!

1 Like

This is awesome!

Do you happen to have any plans to implement PTZ controls? I'm not a programmer, but I'd be happy to help out. Looks like we'd need to add a new triggerMode to your code. Looks like it would be very similar to the camera presets code.

I didn't but now that you've asked for it... I'll get that added for you. Should be easy enough to add.

All set!

New Update:

  • V1.0.3 - 11/25/18 - Added in PTZ Controls.
4 Likes

Works great, thanks!

1 Like

Awesome, and thank you!

New version on Github...

V1.0.4 - 12/30/18 - Updated to my new color theme. Applied pull request from the-other-andrew - Added Mode mappings and switch support for Blue Iris schedules.

1 Like

I've run into an issue - when I set up a Camera_Trigger child and attach it to a virtual switch, the camera doesn't trigger in Blue Iris. When I looked at the app code, it looks like the trigger argument in the URL should have been used, but manrec was used instead. I have the latest (4.8.5.0) version of Blue Iris.

This line:

biRawCommand = "/admin?camera=${biCamera}&manrec=${num}&user=${parent.biUser}&pw=${parent.biPass}"

Had to be changed to:

biRawCommand = "/admin?camera=${biCamera}&trigger&user=${parent.biUser}&pw=${parent.biPass}"

Am I missing something? Thanks!

Just double checked it here and it's working just fine, turning the camera manual recording on and off with the switch.

Are you saying it worked for you after you changed that line? If so, that's very weird but hey if it works leave it. I won't change it in the app but I will put a note in there about it. Let me know if this is the case and I'll add it.

If you're saying it doesn't work then...
Make sure you have the correct credentials in the parent app. Then make sure you are using the correct short name for the camera you are trying to do the manual recording with.

It worked after I changed it from manrec to trigger. What version of Blue Iris are you using? Do you recall if there was a manual recording option that needs to be enabled? Anyways, thanks for checking.

I'm running the latest, 4.8.4.3 X64. Don't remember changing anything, if I had to..I would have put it in the notes. But stranger things have happened, lol.

I'll go ahead and put a note below that line about trying this version if it doesn't work for them.

Thanks

1 Like

Thanks, this was one of the lat few things left on ST, I mainly use it to change my profiles on BI with the Mode changes on ST now Hubitat to follow my Geofencing rules. While I was installing this I saw you have a modified driver for Axis gear on your github, did this fix an issue you were having with the original driver, I'm planning to try to move over my Axis shades tonight or tomorrow, I originally was planning to use the v3 driver provided for ST but if your's fixes something in that on Hubitat I'll switch to that.

Thanks.

Since adding and testing that BI Control did change the profiles correctly on mode change I have gone into the BI App on my phone multiple times and two of those times it was back to profile 1 even though the mode hasn't changed, any idea what to check? I just enabled debug logging so hopefully I can catch something with that.

Thanks.

This is just the V3 driver with the adjustments needed for it to work on Hubitat. Nothing special.

Let me know if you find anything

I didn’t see anything in the log when it changed to home again so I disabled the child process and it still changed so I think the issue is on my BI server. Maybe an old schedule or Geofencing setup from the first few days when I originally had port forwarding enabled. I’m guessing the Blue Fusion app on ST kept sending the commands occasionally so I never noticed this happened when that was controlling it? I’ll check the server when I get a chance to try to find what is causing it. It seems to Change within 30 minutes each time so hopefully I can narrow it down.