Smartphone Radar - Information and Installation

Posted on
Tue Jul 23, 2013 4:03 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Smartphone Radar - Information and Installation

What Smartphone Radar Does
Smartphone Radar allows you to keep track of when your family's smartphones were last seen on your network. Since our phones are generally always with us, it's a fairly reliable way of letting Indigo make some clever decisions. Some examples might be:

1. All the family members are not home yet, leave the porch lights on a little later tonight.
2. Nobody has been home for hours, might as well adjust the HVAC to save some cash.
3. It's really late and your daughter is still not back from her date, maybe Indigo should wake you up and let you know she broke curfew.
4. It's dark outside and nobody is home, maybe Indigo should play with the lights to help ward off potential burglars.

How It Works
The plugin works by scanning your router's logs or SNMP output for network activity of your smartphones.

What It Needs
To use Smartphone Radar you'll need an Apple Airport router, or a router with remote logging capabilities (this is sometimes called syslog). Your phones will also need to be set to access the network on a regular schedule. This can usually be accomplished by setting them to check for email on a regular schedule.

Download the Plugin
The latest version of the plugin can be downloaded here.
If you'd like to be emailed when the plugin is updated, please subscribe to this topic.

Installation
1. Download the plugin from the link above, unzip it if your browser doesn't do that automatically.
2. Double-click on the Smartphone Radar.indigoPlugin file.  Indigo will launch and ask if you'd like it to install the plugin.

3a. The plugin's configuration dialog box will popup. Select "Apple Airport / Time Capsule" if you have an Apple router, or select Generic if you have a standard router that can send it's log to a remote server (see 3b below).
- Enter the IP address of your Airport device. If you have multiple airport devices enter all the IP's separated by commas.
- Enter the SNMP community string for your Airport device, this is often the Airport's password. If it's not, check the SNMP settings of the Airport, it may let you specify a password for SNMP access.
Image


3b. Select "Generic" if your router will be sending it's log to Indigo.
To use this option your router must have remote syslog ability, and you must be able to specify a port. Routers running Tomato or DD-WRT firmware have this option, so do some higher-end consumer routers. Do NOT use this option for Apple routers. See Generic Router Setup below for more detailed router information.
Image

4. Go to your Device list and click New. Create a new Smartphone device for each of your phones.
Image

5. The Device Settings will open. Enter an IP or MAC Address depending on what your router log uses. Apple routers use MAC Address.
Image

6. Create some triggers if you're confident your router will work. Or maybe skip to the router setup below first to make sure ...

Setting up Triggers

Do something when a phone leaves the house:
Image

Do something when the house is empty:
Image

Use the optional variables as a condition to decide when to turn off lights. First enable Create Variables in the plugin's config. Useful variables will automatically be created:
Image

Then create a scheduled trigger using the variable as a condition:
Image

Generic Router Setup
Many routers already support logging to a remote server. If they don't, they can often be upgraded to have these features by installing DD-WRT or Tomato firmware on them. The best option is syslog support with the option to specify a non-standard port, this is GREAT for us. If they don't allow you to specify the port, they are likely locked on port 514.

DD-WRT Firmware: http://www.dd-wrt.com/site/index Supported Routers: http://www.dd-wrt.com/wiki/index.php/Supported_Devices
Tomato Firmware: http://www.polarcloud.com/firmware Supported Routers: http://www.polarcloud.com/tomatofaq#what_will_this_run_on

Please do not ask router-specific questions in this thread. Not that I don't want to help, but there are other forums dedicated to exactly this purpose with users much more knowledgable than I am on these subjects. If you've decided to go the DD-WRT route, their website has an extensive wiki and a very helpful forum.

The quick and dirty for the advanced users:

1. Setup a static IP for your Indigo server.
2. Set your router to remote syslog to your Indigo server's IP address at port 1514. Turn on outbound connection logging.
3. To confirm it's working check the "Show router log" checkbox in the Smartphone Radar config and watch your Indigo Event Log.
4. Use your phone, you should start seeing activity entries. If the entries all use MAC Addresses you can skip to step 6.
5. If your log entries all contain IP addresses you'll need to tell your router to assign static IPs to your phones.
6. Adjust your Smartphone Devices in Indigo to use MAC Addresses or IP Addresses based on what you saw in your logs.

OR with pictures for normal users. Shown using a Tomato router which logs with IP Addresses:

1. Open the Status -> Device List. Find your smartphones in the list, then click on the IP address.
Image

2. That will open the Static DHCP page with the MAC Address already filled out. Enter an IP address outside of the dynamic range. This is usually below 100, or over 200.
Image

3. Repeat steps 1 and 2 for all your phones and your Indigo server.

4. Setup syslog to log to your Indigo server's IP address on port 1514. Disable most of the logging options with the exception of connection logging. This must be enabled.
Image

5. Renew the DHCP leases on your phones and computer so they are all assigned the new address.
iPhone: Go to Settings/WiFi Networks, touch the blue arrow on your home network, tap Renew Lease on the bottom.
Mac: Go to System Preferences/Network, select your interface, select Advanced, then press Renew DHCP Lease.

Using port 514
Some routers do not let you specify a port for the syslog service. To work around this issue you'll need to make a few changes to the syslog service already running on your mac. We basically need to tell it to accept your router's logs on port 514, then forward everything to port 1514 for Smartphone Radar to sift through.

Thanks to lharris9 for this tip. Various users have reported success using this.

First tell syslog to accept logs from other devices:
http://superuser.com/questions/131578/how-do-you-enable-syslogd-to-accept-incoming-connections-on-snow-leopard-from-rem

Now tell it to forward the logs to itself at port 1514. See the link below. But use the following line in step 4:
Code: Select all
*.*                                       @127.0.0.1:1514

http://www.splunk.com/wiki/Community:HowTo_Configure_Mac_OS_X_Syslog_To_Forward_Data

Posted on
Tue Jul 23, 2013 7:42 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Information and Installation

Version Changes so far...

1.1.3 - May 19, 2013
- Quick fix for compatibility with Indigo 6 beta 8

1.1.2 - Nov 17, 2012
- A minimum of 2 minutes is now forced for the MinutesTillAway config setting.
- Fixed a possible bug when using SNMP.

1.1.0 - Nov 14, 2012
- Fix for Indigo 6 compatibility.
- Fixed a bug where spaces after commas when using multiple IP address in the Airport setup would cause problems.

1.0.0 - Dec 5, 2011
- Changes to phone devices are now correctly updated in the plugin without having to restart it.
- A bug that would cause errors on the very first run has been fixed.
- A few other cosmetic changes.

0.9.2 - June 28, 2011
- Phone home/away states now show up correctly in Indigo's Device List. Unfortunately the device has to be deleted and recreated for this fix to take effect.

0.9.1 - June 11, 2011
- Fixed issue where phone variables were not automatically created if the plugin was running.
- Fixed issue where if all phones went on vacation, the AllPhonesHome variable would be set to True.
- Adjusted the device config text to help users of Apple routers.

0.9.0 - June 10, 2011
- First release of Smartphone Radar that uses devices to specify phones.
- Smartphones are now devices so there is no limit to how many you can monitor.
- Each device has Home, Away, and On Vacation states that can be used to trigger events.
- There are global events that trigger when ALL the phones are Home, Away, or On Vacation.
- Variables can be automatically created and used as conditions for other triggers or schedules.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests