Loading...

Set up Blue Iris Surveillance software with IFTTT

I have two cameras in which I’d like to always have a notification for if I’m not home. Initially I set this up to always send me an alert but I’m sure as you can imagine, my phone blew up with me walking around. Blue Iris has a neat feature which is simply a traffic light. If red, it will disable various things including recording (not desired for me in this case), but it can also disable alerts. I selected to only disable alerts if the traffic light is red. In the past, I had never used this feature. So here’s a brief how-to.

Click settings button and modify the settings as illustrated.

Set User Account that will perform this action.

Set Traffic Signal to Alerts Only

Verify web server port & disable Secure only for the web server

  1. On your server computer (Blue Iris Windows machine), install something like WAMP or XAMPP to handle web requests.
  2. After install set up a script similar to this one in PHP (create a php file with the name of your choice and .php extension):
    1. After you’ve created the script, drop it in your HTDOCs directory in WAMP or XAMPP
      1. For example, my directory is here: C:\Bitnami\wampstack-7.1.19-0\apache2\htdocs
<?php
$home = $_GET['home']; //get and set variable for the home status.
$my_file = 'log.txt'; //store logs so we know if our server is being used improperly and by whom

if($home == 'true')
{
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' Request to set RED.' . "\r\n";
	fwrite($handle, $data);
	fclose($handle);
	file_get_contents("http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1");
	echo "home";
}
elseif($home == 'false')
{
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' Request to set GREEN.' . "\r\n";
	fwrite($handle, $data);
	fclose($handle);

	file_get_contents("http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1");
	echo "away";
}
else
{
		
	$handle = fopen($my_file, 'a') or die('Cannot open file:  '.$my_file);
	$data = date("Y.m.d.h.i.s") . ' on requesting ip: ' . $_SERVER['REMOTE_ADDR'] . ' FAILED REQUEST!!! Request: ' . $home . "\r\n";
	fwrite($handle, $data);
	fclose($handle);
	echo "invalid";
	//donothing
}
?>
  1. Now let’s explain the URL in there so you can get an idea of what is happening and how Blue Iris is interpreting it. http://10.1.1.99:8080/admin?user=admin&pw=password&signal=1
    1. Where 8080 is the port you’ve set blue iris to
    2. User is the user account you create in Blue Iris
    3. PW is the password for said account (recommended to restrict this account down to admin tasks only not viewing rights or anything else).
    4. Signal is the traffic symbol where 1 is active (green) and 0 is inactive (red).
  2. Now if you browse to your local host URL 127.0.0.1/myphpfile.php?home=false you should have a value returned. In this case, you should see “away” in your web browser. If you see this, that means your PHP script is working. Blue Iris at this point should also change the animation in the traffic symbol.

  3. Let’s take a moment to understand all of what just happened and why. You set up a web server with a script to change the alert status on the local Blue Iris machine. Now you’ll need to expose the web server to the internet (or if your security aware, you may also set it to only work with IFTTT IP addresses). This step I will not outline as there are too many router combinations, but you need to port forward to your web server.
  4. IFTTT is super easy! Just log in, select Location for the “this” (set up an enter an area and set it appropriately for your home) and a “that” with a webhook in which you will put in your IP/ domain so something like x.x.x.x:PORT/myphpfile.php?home=true for enter and home=false for exit. You will create 2 webhook applets, one for enter and one for exit, each with the appropriate URL.

This guide is somewhat advanced as it assumes you know/ can port forward and you have a static IP or a domain set to change with your IP.

Leave a Reply