Is there an API to control BlueIris?

Bard

n3wb
Joined
Mar 8, 2018
Messages
1
Reaction score
0
Hi, I'm new to BI and I'm just running the demo, still a couple of days left.
I was wondering if there is any way to control BI using RestAPI or something like that.

Specifically I want to change the active profiles based on a Bluetooth sensor, so that the alerts gets activated if my smartphone isn't in range and deactivated when I come back.
Before investing too much time trying to figure out the BT part, I tried to look into existing APIs for Blue Iris but have not found anything yet, so I decided to ask!

I suppose that at worse using looking into the web interface might turn out something usable, but I'd rather use a proper API if avilable.
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
11,308
Reaction score
23,542
Location
Alabama
Hi, I'm new to BI and I'm just running the demo, still a couple of days left.
I was wondering if there is any way to control BI using RestAPI or something like that.

Specifically I want to change the active profiles based on a Bluetooth sensor, so that the alerts gets activated if my smartphone isn't in range and deactivated when I come back.
Before investing too much time trying to figure out the BT part, I tried to look into existing APIs for Blue Iris but have not found anything yet, so I decided to ask!

I suppose that at worse using looking into the web interface might turn out something usable, but I'd rather use a proper API if avilable.
BI's JSON interface provides a way to change the traffic signal status or call up a profile. Go to BI's help (the "?") and search for 'JSON' in the index.

BTW, you are aware of BI's 'Geofence' configurations for 'Mobile Devices', right?

Paging @bp2008 !
 
Last edited:
Joined
Mar 25, 2020
Messages
5
Reaction score
0
Location
Brisbane Australia / Phuket Thailand (currently)
Hi, I'm new to BI and I'm just running the demo, still a couple of days left.
I was wondering if there is any way to control BI using RestAPI or something like that.

Specifically I want to change the active profiles based on a Bluetooth sensor, so that the alerts gets activated if my smartphone isn't in range and deactivated when I come back.
Before investing too much time trying to figure out the BT part, I tried to look into existing APIs for Blue Iris but have not found anything yet, so I decided to ask!

I suppose that at worse using looking into the web interface might turn out something usable, but I'd rather use a proper API if avilable.
Hi Bard,

As Paiging said there is Json Api via http. There are some command line tools using that interface, in Python my Magnus (magapp/blueiriscmd) and a Java command line app I have written (jurek1oo/blueiriscmdj). The java app provides full coverage of methods, ad described by House Logix document - JSON interface.

You can go to Github, download the apps and try to issue commands to your BI System. You need to set up in BI the web server, to listen for the commands. I use the Java app to control BI from my Raspberry pi 3. When I go out/in I press a hidden button to activate/deactivate cams.
I have found that using geo-fencing was depleting my Android phone battery very fast, as I had to run all the time the gps locator. I had to give it up. I have seen posts that iPhone is more efficient with gps on and the battery usage.

I have Raspberry monitoring digital i/o switch and send change BI profile, which activates/deactivates cams. If I forget to to press "alarm on" switch, I can go onto my mobile BI app and switch the profiles there.

You just gave me an idea, if I can check on my Raspberry if my phone is in range, using phone wifi or Blue-Tooth. This should be less demanding on the phone battery.

Let me know if you need help with Java app.

Jurek
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
747
Reaction score
735
Location
SF Bay Area
Another option is to have your device issue the json 'geofence' cmd on demand.
For example, you could do this when your device connects to (or disconnects from) your car's bluetooth.
{"cmd":"geofence","session":"182c8a04f7d4ab042ff8e4a2","inside":"0"} or
{"cmd":"geofence","session":"182c8a04f7d4ab042ff8e4a2","inside":"1"}

The key to making this work is to first issue a json 'login' command with the current 'session' id AND the device 'uuid'.
e.g., {"cmd":"login","session":"182c8a04f7d4ab042ff8e4a2","uuid":"abcd-efgh-xyz"}

The 'uuid' is the "DeviceID" on the "mobile devices" tab.

mobile_devices_tab.png


To trigger actions in response to these 'on-demand' geofence events, simply assign whatever actions you want via this dialog...

edit_mobile_device.png
 
Last edited:
Joined
Mar 25, 2020
Messages
5
Reaction score
0
Location
Brisbane Australia / Phuket Thailand (currently)
Hi jaydeel,

Interesting, "cmd":"geofence". Where did you find reference to thei cmd?
I am using JSON interface, and it is not there.
Is there another document. Is t BI 5 API?

I am using two profiles "AtHome" - 1 where only external camera is working, and "OnTheRoad" -2 where internal camera is recording.

I switch profiles using "cmd":"status" with "profile": 1 or 2 to switch. To issue this commands I use:

java -jar blueiriscmdj-1.2.23_SNAPSHOT-jar-with-dependencies.jar -host 192.168.1.42:8882 -u admin -p password --status-set -j '{"profile":1}'

My Raspberry pi is sensing what I want to do and issuing command to BI. I can use linux "sudo arp-scan -l | grep 'd4:e6:b7:e7:e3:d9'" to check if my mobile is on wifi, to sense if I am home or not.

More here jurek1oo/blueiriscmdj.

Regards Jurek
 
Joined
Mar 25, 2020
Messages
5
Reaction score
0
Location
Brisbane Australia / Phuket Thailand (currently)
Hi jaydeel,

Interesting, "cmd":"geofence". Where did you find reference to thei cmd?
I am using JSON interface, and it is not there.
Is there another document. Is t BI 5 API?

I am using two profiles "AtHome" - 1 where only external camera is working, and "OnTheRoad" -2 where internal camera is recording.

I switch profiles using "cmd":"status" with "profile": 1 or 2 to switch. To issue this commands I use:

java -jar blueiriscmdj-1.2.23_SNAPSHOT-jar-with-dependencies.jar -host 192.168.1.42:8882 -u admin -p password --status-set -j '{"profile":1}'

My Raspberry pi is sensing what I want to do and issuing command to BI. I can use linux "sudo arp-scan -l | grep 'd4:e6:b7:e7:e3:d9'" to check if my mobile is on wifi, to sense if I am home or not.

More here jurek1oo/blueiriscmdj.

Regards Jurek
By the way, the java app does the login and logout handshakes for you.
 
Joined
Mar 25, 2020
Messages
5
Reaction score
0
Location
Brisbane Australia / Phuket Thailand (currently)
The command is in the BI5 help pdf, last chapter, ‘Administration’.
The cited houselogix link is outdated.
Thanks, so it is BI version 5. Unfortunately my version 4 is "not qualified " for upgrade to 5. I have to figure out how much I have to fork out to get it. I have bought version 4 a few years ago. If you want to try out, you can use my Java app and use an arbitrary cmd with a json. The app will handle the handshake and will give you BI json response. Thanks again. Jurek
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
747
Reaction score
735
Location
SF Bay Area
Don't overthink the upgrade. It's worth it. :D

Thanks. I use my own PHP script command engine (with PHP installed on my BI machine). It's a server-side solution and does not require sending credentials in URLs.
 
Top