Smartphone Radar - Smartphone presence detection (Locked)

Posted on
Thu Jun 30, 2011 7:45 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

support wrote:
Instead of deleting and recreating, try changing the Device type to an X10 appliance module, OK out of the dialog, then switch back and change it back to the plugin's type. That should re-create the Device but the device ID will be the same (not that it matters since it currently is referenced in the plugin by name, but the general technique of toggling between 2 device types is useful to know).


Cool tip. I just used that to update the alarm zones for the DSC Plugin, saved a lot of time. Thanks.

Is there anyway I can do this in the plugin? Like say if I saved a device version number as a hidden field in the .pluginProps, then the plugin checks that against the known latest version. If it's out of date at startup it can automatically update the device by creating a new instance of a fresh device, transfer the .pluginProps, then do a .replaceDeviceOnServer.

Posted on
Thu Jun 30, 2011 8:05 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Smartphone Radar - Smartphone presence detection (Update

A new instance would have a new ID, so it would break the linkages with other elements.

Is the main problem that you cannot get Indigo to update its device states dictionary? That only is read from the plugin/XML when it is initially created, but if that is the problem maybe we can add an API to tell Indigo Server a refresh is needed. Then you can call that when you detect a version number bump.

Image

Posted on
Thu Jun 30, 2011 8:16 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

support wrote:
A new instance would have a new ID, so it would break the linkages with other elements.

Is the main problem that you cannot get Indigo to update its device states dictionary? That only is read from the plugin/XML when it is initially created, but if that is the problem maybe we can add an API to tell Indigo Server a refresh is needed. Then you can call that when you detect a version number bump.


Yeah that would be great. Right now the problem is I updated the Devices.xml file with the UiDisplayStateId tag to show the correct state in Indigo's Device List. But that change won't take effect unless the device is re-created. But I could also see this problem popping up if I added a new feature to a plugin that required a new checkbox or textfield in the device's config. Wouldn't that also require the device to be re-created so those would be visible? An API call for a refresh would be sweet!

Posted on
Mon Jul 04, 2011 7:54 am
hammer32 offline
Posts: 66
Joined: May 13, 2006
Location: Copperas Cove, TX

Re: Smartphone Radar - Smartphone presence detection (Update

Sometimes I've noticed that 'Andrea iPhone' will have a state of away, but the variable 'AndreaiPhoneHome' is true. When I delete and recreate an iPhone device after updating the SmartPhoneRadar plugin, do I need to delete the variables and let SmartPhoneRadar recreate them? I haven't yet, because the have associated actions that will apparently also get deleted.

Thanks!

Posted on
Tue Jul 05, 2011 10:32 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

hammer32 wrote:
Sometimes I've noticed that 'Andrea iPhone' will have a state of away, but the variable 'AndreaiPhoneHome' is true.

Hmmm. Is this after you restart the plugin or relaunch Indigo? When the plugin starts up it sets the device state to home. If the lastSeen variable is already over the Away threshold the phone will won't be set to Away until the phone comes home once to reset the lastSeen variable. I'm going to go back in and adjust some of these things that I'm a little better with Python. :)

hammer32 wrote:
When I delete and recreate an iPhone device after updating the SmartPhoneRadar plugin, do I need to delete the variables and let SmartPhoneRadar recreate them? I haven't yet, because the have associated actions that will apparently also get deleted.

No need to delete the variable as long as the iPhone device you create has the exact same name. Smartphone Radar will recreate the variable only if the device name is different and it can't find the existing variable. You can also use Matt's trick of just setting the phone to an X10 device, pressing OK, then editing it again and setting it back to a Smartphone and entering the IP address.

Posted on
Thu Jul 21, 2011 7:00 pm
loafbread offline
Posts: 137
Joined: May 25, 2009

syslog and Lion

Has anyone figured out how to get Lion to accept syslog from the router? They changed the launchctl plist file to a binary.

Posted on
Thu Jul 21, 2011 10:05 pm
loafbread offline
Posts: 137
Joined: May 25, 2009

enabling syslog network listener in Lion

Googled my own answer to enabling syslog listener in Lion
One of the commenters in this post shows how to convert the plist from binary to xml and back. Its one solution that works.
http://superuser.com/questions/131578/h ... d-from-rem

Posted on
Sun Sep 04, 2011 10:46 pm
dnomode offline
Posts: 366
Joined: Apr 12, 2008
Location: North Georgia

Re: Smartphone Radar - Smartphone presence detection (Update

I'm having a hard time with this.

It looks like my Airport Extreme is seeing my phone coming and going.

69:ti:81:s9:bb:98 is my buddies iPhone and 40:p3:t8:ac:54:34 is my iPhone:
Code: Select all
Sep 04 21:21:47   Severity:5   Installed unicast CCMP key for supplicant 40:a6:d9:ac:54:40
Sep 04 21:22:04   Severity:5   Disassociated with station 40:p3:t8:ac:54:34
Sep 04 21:22:05   Severity:5   Rotated CCMP group key.
Sep 04 21:22:13   Severity:5   Associated with station 40:p3:t8:ac:54:34
Sep 04 21:22:13   Severity:5   Installed unicast CCMP key for supplicant 40:p3:t8:ac:54:34
Sep 04 21:22:20   Severity:5   Disassociated with station 69:ti:81:s9:bb:98
Sep 04 21:22:21   Severity:5   Rotated CCMP group key.
Sep 04 21:22:27   Severity:5   Associated with station 69:ti:81:s9:bb:98
Sep 04 21:22:27   Severity:5   Installed unicast CCMP key for supplicant 24:ab:81:e1:bb:a7


And it looks like SPR is getting some of the Logs:
Code: Select all
Sep 4, 2011 8:54:28 PM
  Starting Indigo Server version 5.0.0 b8
  Loading attachments
  "device target attachment.scpt" script loaded
  "group target attachment.scpt" script loaded
  "growl attachment.scpt" script loaded
  "iTunes attachment.scpt" script loaded
  "scenes attachment.scpt" script loaded
  "time stamp attachment.scpt" script loaded
  Loading plugin "Growl 1.0.3"
  Starting plugin "Growl 1.0.3"
  Loading plugin "Smartphone Radar 0.9.2"
  Starting plugin "Smartphone Radar 0.9.2"
  Found disabled plugin "Action Collection 1.0.2"
  Found disabled plugin "Airfoil 1.0.0"
  Found disabled plugin "EasyDAQ Relay Card 1.0.7"
  Found disabled plugin "iTunes 1.0.9"
  Found disabled plugin "NOAA Weather 1.0.0"
  Bonjour registered "Indigo - My House"
  Indigo Cocoa client connected
  Plugin "Growl" connected
  Plugin "Smartphone Radar" connected
  Reflector                       starting reflector connection to https://dnomode.goprism.com
  Plugin "Growl 1.0.3" started
  Plugin "Smartphone Radar 0.9.2" started
  Smartphone Radar                Watching for smartphone 'Ed's iPhone' at address 40:p3:t8:ac:54:34
  Smartphone Radar                Watching for smartphone 'Trisha's iPhone' at address 69:ti:81:s9:bb:98
  Smartphone Radar Debug          Entered createVariables

Sep 4, 2011 8:54:40 PM
  Trigger                         Timers
  Trigger                         Sprinkler Runtime
  Trigger                         PhoneValet Startup
  Connected to SmartHome PowerLinc USB E
  PowerLinc address 09.48.09, firmware version 2.13
  info                            Timer script heartbeat
  WebServer client connected
  WebServer                       started on port 8176 -- digest authentication enabled
  PowerLinc standalone operation disabled
  Indigo directly controlling automation logic

Sep 4, 2011 8:55:20 PM
  Received INSTEON                "shower" off
  Received INSTEON                "powder room" off
  Received INSTEON                "closet" on
  Trigger                         Button 2 Status of lights Front Door and Hallway
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 52)
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 42)

Sep 4, 2011 8:56:17 PM
  Received INSTEON                "closet" off

Sep 4, 2011 8:56:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Received INSTEON                "kitchen main light" on
  Trigger                         AutoOff Kitchen Step 1 (On 1 hour)
  Trigger                         AutoOff Kitchen step 2 (Plus 1/2 hour)
  Trigger                         Button 2 Status of lights Front Door and Hallway
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 52)
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 42)

Sep 4, 2011 8:57:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Received INSTEON                "kitchen main light" off
  Trigger                         AutoOff Kitchen step 5 (ManualOff)
  Trigger                         AutoOff Kitchen step 4 (AutoOff)
  Sent INSTEON                    "kitchen main light" off
  Received INSTEON                "upstairs lights" off

Sep 4, 2011 8:58:20 PM
  Received INSTEON                "Kayla switch" off
  Trigger                         Kayla Lamp with light switch
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 8:58:53 PM
  Smartphone Radar                Router Log: <133>Sep  4 20:58:53 10.0.1.1 edmonds-airport-extreme 80211: Installed unicast CCMP key for supplicant 24:ab:81:45:xx:xx

  Smartphone Radar Debug          "Trisha's iPhone" network activity detected.

Sep 4, 2011 8:59:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 8:59:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  info                            Timer script heartbeat

Sep 4, 2011 9:00:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:00:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:01:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:01:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:02:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:02:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:03:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:03:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:04:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:04:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Schedule                        Auto Off Thermostat (delayed action)
  Sent INSTEON                    "Thermostat" turn all off
  Trigger                         Is Thermostat Off

Sep 4, 2011 9:05:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:05:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:06:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:06:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:07:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:07:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:08:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:08:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:09:34 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:09:53 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:10:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:10:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:11:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:11:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:12:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:12:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:13:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:13:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:14:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:14:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:15:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:15:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:16:26 PM
  Received INSTEON                "Cooper" off
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:16:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:17:14 PM
  Received INSTEON                "upstairs hallway, bathroom" off
  Trigger                         Upstairs hallway light switches on 4 way

Sep 4, 2011 9:17:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:17:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:18:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:18:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar                Router Log: <133>Sep  4 21:18:57 10.0.1.1 edmonds-airport-extreme natpmp: Binding added for udp, 173.60.78.187:32769 to 10.0.1.2:4500 with lifetime 3600

  Smartphone Radar                Router Log: <133>Sep  4 21:19:05 10.0.1.1 edmonds-airport-extreme natpmp: Binding added for udp, 173.60.78.187:32770 to 10.0.1.2:5353 with lifetime 3600


Sep 4, 2011 9:19:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:19:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:20:15 PM
  Received INSTEON                "upstairs hallway, bathroom" on
  Trigger                         Upstairs hallway light switches on 4 way
  Trigger                         Button 2 Status of lights Front Door and Hallway
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 52)
  Sent INSTEON                    "PowerLinc Interface" on (group/scene 42)

Sep 4, 2011 9:20:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'

Sep 4, 2011 9:20:54 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:21:35 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Smartphone Radar                Router Log: <133>Sep  4 21:21:47 10.0.1.1 edmonds-airport-extreme 80211: Associated with station 40:a6:d9:ac:xx:xx

  Smartphone Radar Debug          "Ed's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:21:47 10.0.1.1 edmonds-airport-extreme 80211: Installed unicast CCMP key for supplicant 40:a6:d9:ac:xx:xx

  Smartphone Radar Debug          "Ed's iPhone" network activity detected.
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'
  Smartphone Radar                Router Log: <133>Sep  4 21:22:04 10.0.1.1 edmonds-airport-extreme 80211: Disassociated with station 40:a6:d9:ac:xx:xx

  Smartphone Radar Debug          "Ed's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:22:05 10.0.1.1 edmonds-airport-extreme 80211: Rotated CCMP group key.

  Smartphone Radar                Router Log: <133>Sep  4 21:22:13 10.0.1.1 edmonds-airport-extreme 80211: Associated with station 40:a6:d9:ac:xx:xx

  Smartphone Radar Debug          "Ed's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:22:13 10.0.1.1 edmonds-airport-extreme 80211: Installed unicast CCMP key for supplicant 40:a6:d9:ac:xx:xx

  Smartphone Radar Debug          "Ed's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:22:20 10.0.1.1 edmonds-airport-extreme 80211: Disassociated with station 24:ab:81:e1:xx:xx

  Smartphone Radar Debug          "Trisha's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:22:21 10.0.1.1 edmonds-airport-extreme 80211: Rotated CCMP group key.

  Smartphone Radar                Router Log: <133>Sep  4 21:22:27 10.0.1.1 edmonds-airport-extreme 80211: Associated with station 24:ab:81:e1:xx:xx

  Smartphone Radar Debug          "Trisha's iPhone" network activity detected.
  Smartphone Radar                Router Log: <133>Sep  4 21:22:27 10.0.1.1 edmonds-airport-extreme 80211: Installed unicast CCMP key for supplicant 24:ab:81:e1:xx:xx

  Smartphone Radar Debug          "Trisha's iPhone" network activity detected.

Sep 4, 2011 9:23:14 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:24:14 PM
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Ed's iPhone'
  Indigo Cocoa client authenticated (10.0.1.8)
  Smartphone Radar Debug          Incrementing lastSeen timer of 'Trisha's iPhone'

Sep 4, 2011 9:24:46 PM
  Sprinkler Runtime Modifier      Past high temp of 90.0 is greater than or equal to the current temp of 70.0


However the Variable List never changes. It always says True
And in the Device List it always shows the phone as being Home.

Below is how I configured everything.


First I updated the com.apple.syslogd.plist file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.apple.syslogd</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
<!--
   Un-comment the following lines to run syslogd with a sandbox profile.
   Sandbox profiles restrict processes from performing unauthorized
   operations; so it may be necessary to update the profile
   (/usr/share/sandbox/syslogd.sb) if any changes are made to the syslog
   configuration (/etc/syslog.conf).
-->
<!--
      <string>/usr/bin/sandbox-exec</string>
      <string>-f</string>
      <string>/usr/share/sandbox/syslogd.sb</string>
-->
      <string>/usr/sbin/syslogd</string>
    </array>
   <key>MachServices</key>
   <dict>
      <key>com.apple.system.logger</key>
      <true/>
   </dict>
   <key>Sockets</key>
   <dict>
      <key>AppleSystemLogger</key>
      <dict>
         <key>SockPathName</key>
         <string>/var/run/asl_input</string>
         <key>SockPathMode</key>
         <integer>438</integer>
      </dict>
      <key>BSDSystemLogger</key>
      <dict>
         <key>SockPathName</key>
         <string>/var/run/syslog</string>
         <key>SockType</key>
         <string>dgram</string>
         <key>SockPathMode</key>
         <integer>438</integer>
      </dict>
<!--
   Un-comment the following lines to enable the network syslog protocol listener.
-->

      <key>NetworkListener</key>
      <dict>
         <key>SockServiceName</key>
         <string>syslog</string>
         <key>SockType</key>
         <string>dgram</string>
      </dict>



   </dict>
</dict>
</plist>


Then I edited the syslog.conf file:
Code: Select all
*.err;kern.*;auth.notice;authpriv,remoteauth,install.none;mail.crit             /dev/console
*.notice;authpriv,remoteauth,ftp,install.none;kern.debug;mail.crit      /var/log/system.log

# Send messages normally sent to the console also to the serial port.
# To stop messages from being sent out the serial port, comment out this line.
#*.err;kern.*;auth.notice;authpriv,remoteauth.none;mail.crit            /dev/tty.serial

# The authpriv log file should be restricted access; these
# messages shouldn't go to terminals or publically-readable
# files.
auth.info;authpriv.*;remoteauth.crit                    /var/log/secure.log

lpr.info                                                /var/log/lpr.log
mail.*                                                  /var/log/mail.log
ftp.*                                                   /var/log/ftp.log
install.*                                               /var/log/install.log
install.*                                               @127.0.0.1:32376
local0.*                                                /var/log/appfirewall.log
local1.*                                                /var/log/ipfw.log
# logging of airport info
local0.notice                                           /var/log/airport.log
local0.notice                                           @127.0.0.1:1514

*.emerg                                                 *

Then I created the log file:
Code: Select all
sudo touch /var/log/airport.log


Then I restarted syslogd:
Code: Select all
sudo launchctl stop com.apple.syslogd


and I followed the instructions for Water Roof.
Image

and this is how I setup the Airport Extreme
Image

I restarted the system a few times with no luck.

Any ideas on what I'm missing.

Thanks for your help.
Ed

Posted on
Mon Sep 12, 2011 10:28 pm
dnomode offline
Posts: 366
Joined: Apr 12, 2008
Location: North Georgia

Re: Smartphone Radar - Smartphone presence detection (Update

So I got home today and decided to try rebooting everything again. All of a sudden its working. :D

Thanks Travisc, this plugin is super cool

Thanks Matt and Jay for adding support for plugins. I can't wait to see what other cool plugins become available.

-Ed

Posted on
Sat Sep 17, 2011 6:30 am
ChrisB offline
User avatar
Posts: 41
Joined: Sep 12, 2011

Re: Smartphone Radar - Smartphone presence detection (Update

Travis,

I installed SPR last night and everything has been working as designed.

I'm using a Time Capsule and I noticed that it logs an entry every time my iPhones connect and disconnect from the router. Specifically it logs Associated with station and Disassociated with station. While the phone is not plugged into a charger, it will associate whenever it checks mail or powers on and disassociate when it goes back to sleep. While it is plugged in, it remains associated because the wifi connection stays on.

Would you be able to have your plugin act a little different if it was working with an Airport Express/Time Capsule? Maybe in the configuration put an option for Airport Express/Time Capsule and if true, keep the phone's state set to "home" until it sees a Disassociated with station log entry? After it receives the disassociated with station then it can start Incrementing the last seen timer of each phone.

The problem is that, when it is plugged in, it does not generate an log entries because it remains Associated and that causes my phones to appear away after 30 minutes when they are really home.

Thanks again Travis,

Chris

Posted on
Thu Sep 29, 2011 8:23 pm
dnomode offline
Posts: 366
Joined: Apr 12, 2008
Location: North Georgia

Re: Smartphone Radar - Smartphone presence detection (Update

Hello Everyone,

I've been using this plugin with my Airport Extreme. I also was having the problem with the iPhone not being detected when plugged into the charger. Finally I got frustrated, so I got a router that I can install Tomato on. I've been running the tomato router for one week and it's been detecting my iPhone perfectly.

Thanks again Travisc

Ed

Posted on
Sat Dec 03, 2011 10:30 pm
bluenoise offline
Posts: 143
Joined: Aug 23, 2008

Re: Smartphone Radar - Smartphone presence detection (Update

I just got this working (I think) under Lion, but I have some questions.

It created variables as described, but those variables don't seem to reflect what is really happening. Currently, for instance, my iPhone (of three being tracked) is home. In the device list, mine is "home" while the other two are "away." But, in the variable list, all three <iPhoneName>Home variables are "true." Additionally, until just a moment ago, AllPhonesAway was true, in spite of mine being known as "home" in the device list. Lastly, though it says all three phones are home (according to the variable list), AllPhonesHome is "false." Is there something I need to do to ensure those variables are updated properly?

Thanks!

Posted on
Mon Dec 05, 2011 7:53 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

Version 1 of Smartphone Radar has been released and is available in the Contribution Library, or in the first post of this thread.

1.0.0 - Dec 5, 2011
- Tested with Indigo 5 final
- 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.

Posted on
Mon Dec 05, 2011 8:08 pm
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Smartphone Radar - Smartphone presence detection (Update

@bluenoise and ChrisB

Sorry for the late reply! I was not receiving emails that there were posts in this thread. I guess after a certain amount of forum inactivity on my part I'm no longer emailed about replies. Not sure. Anyways, sorry guys!

ChrisB wrote:
Would you be able to have your plugin act a little different if it was working with an Airport Express/Time Capsule? Maybe in the configuration put an option for Airport Express/Time Capsule and if true, keep the phone's state set to "home" until it sees a Disassociated with station log entry? After it receives the disassociated with station then it can start Incrementing the last seen timer of each phone.


Hmmm. Is the disassociated log entry reliable enough to use for this purpose? I'm open to adding an option for this if we know it will be reliable. Does an iPhone generally always disassociate when it's done using the network? For example, what if you surf to a webpage and then leave your house. Will there be a disassociate entry in the log when the page finishes downloading, when you sleep the phone, or none at all because the phone goes out of range before it can disassociate?
If we can nail down exactly when it does this I can add support.

bluenoise wrote:
I just got this working (I think) under Lion, but I have some questions.

It created variables as described, but those variables don't seem to reflect what is really happening. Currently, for instance, my iPhone (of three being tracked) is home. In the device list, mine is "home" while the other two are "away." But, in the variable list, all three <iPhoneName>Home variables are "true." Additionally, until just a moment ago, AllPhonesAway was true, in spite of mine being known as "home" in the device list. Lastly, though it says all three phones are home (according to the variable list), AllPhonesHome is "false." Is there something I need to do to ensure those variables are updated properly?


I tested this today before I uploaded v1.0.0, I can't reproduce it. Are you sure "Create Variables" was still checked in the config? If you uncheck it the variables will not be deleted, but they won't be updated. If you see this popup again and can reproduce it let me know and I'll check it out.

Travis

Posted on
Tue Dec 13, 2011 12:39 pm
BeNoOne offline
Posts: 30
Joined: Oct 11, 2006
Location: Netherlands

Re: Smartphone Radar - Smartphone presence detection (Update

Oké, just came accross this thread en was very interested what solution was being used to detect an iPhone/iPad. I already used some proximity detection in the past, but this was via Bluetooth. Although this was working fine, the range was very limited. Also the application (Salling Clicker) I used doesn't support iOS devices.

So in my search for alternatives I wanted to use WiFi.
At the moment I'm using a very simple Python script to do just that. Only I do it the other way around. I'm pulling the info from my 2 Airports with a snmpwalk command.

In the past, pre iOS5, this resulted sometimes in false aways on my iPhone, but worked flawless on my iPad if I turned my 3G radio off. Now I have a new iPhone and iOS5, and as of yet haven't had a false away. And I'm not using any time filtering or other trickery to keep the connection alive. Also this method doesn't need any configuration of ports of some sorts. U only need to turn allow snmp on in your Airport.

I don't know if this helps to build a better plugin, but below U see a snippet of my code.

Code: Select all
"""
MAC adres iPhone  : 00:00:00:00:00:00 hex = 000.000.000.000.000 decimal
"""
import subprocess

myVar = indigo.variables[123]

def mySnmp(adr='Primair-eXtreme.local', pwd='######'):
   cmd = 'snmpwalk', '-m', 'AIRPORT-BASESTATION-3-MIB', '-Os', '-v', '2c', '-c',    '%s' % (pwd), '%s' % (adr), '1.3.6.1.4.1.63.501.3.2'
   try:
      p = subprocess.Popen(cmd, stdout= subprocess.PIPE, stderr= subprocess.STDOUT)
      return p.stdout.read()
   except:
      indigo.server.log("********Airport Down********")
      return 'something'

if '"00:00:00:00:00:00"' in mySnmp():
   indigo.variable.updateValue(myVar, "true")
elif '000.000.000.000.000.000' in mySnmp('AirPort-Express.local', '######'):
   indigo.variable.updateValue(myVar, "true")
else:
   indigo.variable.updateValue(myVar, "false")


I wanted to use subprocess.check_output(cmd), but Indigo uses an old version of Python.

Grts,

Page 6 of 23 1 ... 3, 4, 5, 6, 7, 8, 9 ... 23

Who is online

Users browsing this forum: No registered users and 3 guests