Smartphone Radar - Smartphone presence detection (Updated)
| Author |
Message |
|
ateliers119
Joined: Feb 02, 2012 Posts: 11
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Indeed there is: - Code: Select all
10.0.0.37 - arnan [14/Jan/2012:21:32:37 +0200] "REPORT(CalDAV:calendar-multiget) /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/662A5CB7-C6BF-4627-B248-C9297D111988/ HTTP/1.1" 207 1376 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8445 t=21.1 or=2 rcount=1 10.0.0.37 - arnan [14/Jan/2012:21:32:37 +0200] "REPORT(CalDAV:calendar-multiget) /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/90CB0AE5-CA44-47ED-8F1F-0FC189501075/ HTTP/1.1" 207 10028 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8445 t=110.3 or=2 rcount=11 10.0.0.37 - - [14/Jan/2012:21:32:38 +0200] "PROPFIND /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/inbox/ HTTP/1.1" 401 141 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8444 t=5.5 or=2 10.0.0.37 - arnan [14/Jan/2012:21:32:38 +0200] "PROPFIND /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/inbox/ HTTP/1.1" 207 1265 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8444 t=84.8 or=2 responses=1 10.0.0.37 - - [14/Jan/2012:21:32:38 +0200] "REPORT /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/inbox/ HTTP/1.1" 401 141 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8444 t=5.5 or=2 10.0.0.37 - arnan [14/Jan/2012:21:32:38 +0200] "REPORT(CalDAV:calendar-multiget) /calendars/__uids__/5AB723C3-D8F3-4F01-8CB9-D02540D866B6/inbox/ HTTP/1.1" 207 65 "https://aramaki.kudde.net:8443/webcal/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7" i=8444 t=15.2 or=2 rcount=0 Log closed - server stop: [Sat Jan 14 21:33:55 2012].
On this particular server iCal is not really in use, but this is what typical log looks like.
|
| Sun Feb 19, 2012 2:38 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 227 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
That might work then. You'd have to figure out how to get that log forwarded to SR in some way. I'm no expert in this, maybe someone else knows an easy way to do this.
|
| Sun Feb 19, 2012 2:57 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1720 Location: Berkeley, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
travisc wrote:That might work then. You'd have to figure out how to get that log forwarded to SR in some way. I'm no expert in this, maybe someone else knows an easy way to do this.
See my earlier post re: using logger. With a few lines of shell scripting you should be able to do what you want without modifying the plugin.
|
| Sun Feb 19, 2012 3:12 pm |
|
 |
|
ateliers119
Joined: Feb 02, 2012 Posts: 11
|
 Re: Smartphone Radar - Smartphone presence detection (Update
The log is in /var/log/caldavd/access.log
Perhaps you can have SR peek in that file as is. This is a pretty busy file though. So i would filter out only the REPORT entries, as these are for reading the servers events. The PROPFIND entries seem to he to do with saving new events in iCal. Which is less relevant here.
|
| Sun Feb 19, 2012 3:13 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 227 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I don't mean to be rude, but you're on your own on this one. I'd rather not add support for what is clearly a very rare case. Such an obscure feature will only confuse the target audience that have more typical router setups. It's also more code for me to maintain or workaround when I need to narrow down bugs or add features in the future.
I'd follow berkinet's advice if you want to be able to use the plugin as-is. Or feel free to modify the plugin's source for your own purpose.
Last edited by travisc on Sun Feb 19, 2012 4:32 pm, edited 1 time in total.
|
| Sun Feb 19, 2012 3:56 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1720 Location: Berkeley, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Without a sample showing exactly how a smartphone appears in the iCal log, it is hard to know if this will work as-is, or need some minor tweaking. But, the following 6 line shell script should do what you want. Note, you still have to configure /etc/syslog.conf to forward the log messages to the plugin as described in the Smartphone Radar documentation. - Code: Select all
#!/bin/sh /usr/bin/tail -f /var/log/caldavd/access.log | while read LINE; do if [ `echo $LINE | grep -c "192.168.1.123"` -eq 1 ]; then /usr/bin/logger -p local3.info $LINE fi done&
You just need to change the IP Address grep is looking for to your phones address. You can change the log level and facility as needed and you can customize the log message text if you want. If you have more than one smartphone, you can add additional lines in the form: elif [`echo... But, as it stands, this script will put it self in the background (like a daemon) and watch as lines are added to access.log. If it sees a line matching the IP Address of your phone, it will send the line containing the IP Address to syslog, which will then forward that line to the Smartphone plugin, which will scan the log entry, find the IP Address and you are done.
|
| Sun Feb 19, 2012 4:28 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1720 Location: Berkeley, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Feature request: How about another Event/Trigger that watches for the house to go from Vacant to any phone is home?
The idea being that there are some functions, like arming/dis-arming an alarm system, that should be set when a house is "vacant" (all phones away) and un-set when the house is occupied (any phone home).
|
| Thu Feb 23, 2012 3:27 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 227 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Enable variables in the config, then set a trigger or condition for the "AllPhonesAway" variable = false. That would be equivalent to any phone arriving or being home.
I'll see if there's an elegant way to add this without using variables.
Thanks
|
| Fri Feb 24, 2012 4:46 pm |
|
 |
|
odavis
Joined: Jan 14, 2011 Posts: 26 Location: El Cerrito, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
So fun to set this up and start playing with it. Thanks to Travis and all who helped it along. It was quite easy to add this once I read enough of the thread to figure it out. To save others some reading here's a little cheat sheet if you are using the plug in with airports: 1. You'll want the plug in linked to on page 10 of this thread (link copied below). It has extra configuration fields not yet found in the User Contribution library. 2. Once you download the plug in, install it by double clicking to add it to Indigo. 3. A configuration dialog will appear: use the drop down box at the top to select apple airport/time capsule. Two fields will appear that let you specify the airports IP or MAC address and the airport password/community name (public by default on airports). Note: if you have multiple airports you can list their addresses and passwords separated by commas (WITHOUT spaces - spaces will prevent the additional routers from being recognized). Follow the rest of the instructions at the start of this thread or in the user library to complete setup. Very cool. Thanks, Travis!
|
| Sun Mar 11, 2012 1:54 am |
|
 |
|
hamw
Joined: Mar 31, 2008 Posts: 738
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I think the Airport router setup is working well for me. However, I've noted that if there is no phone activity and the phone is not plugged in the phone will fall off SPR even if still at home? Should that happen, e.g. that's the reason for the 30 min timeout to determine "Away", or am I missing a step? Here's a snippet of my log output: - Code: Select all
Mar 11, 2012 10:53:51 AM Smartphone Radar SNMP Output for 10.0.1.1: wirelessnumber.0 = integer: 0
Smartphone Radar SNMP Output for 10.0.1.35: wirelessnumber.0 = integer: 1 wirelessphysaddress."00:1f:f3:c2:xxx" = string: "00:1f:f3:c2xxx" wirelesstype."00:1f:f3:c2:xxx" = integer: sta(1) wirelessdatarates."00:1f:f3:c2:xxxx" = string: 1(b) 2(b) 5(b) 6 9 11(b) 12 18 24 36 48 54 mcs: 0-15 wirelesstimeassociated."00:1f:f3:c2:xxx" = integer: 19 wirelesslastrefreshtime."00:1f:f3:c2:xxx" = integer: 0 wirelessstrength."00:1f:f3:c2:xxx" = integer: -72 wirelessnoise."00:1f:f3:c2:xxx" = integer: -82 wirelessrate."00:1f:f3:c2:xxx" = integer: 13 wirelessnumrx."00:1f:f3:c2:xxx" = integer: 54624 wirelessnumtx."00:1f:f3:c2:xxx" = integer: 25828 wirelessnumrxerrors."00:1f:f3:c2:xxx" = integer: 0 wirelessnumtxerrors."00:1f:f3:c2:xxx" = integer: 0
Smartphone Radar SNMP Output for 10.0.1.30: wirelessnumber.0 = integer: 3 wirelessphysaddress."00:1c:b3:b1:xxx" = string: "00:1c:b3:b1:xxx" wirelessphysaddress."00:1f:f3:f7:xxx" = string: "00:1f:f3:f7:xxx" wirelessphysaddress."00:26:4a:e9:xxx" = string: "00:26:4a:e9:xxxx" wirelesstype."00:1c:b3:b1:xxx" = integer: sta(1) wirelesstype."00:1f:f3:f7:xxxx" = integer: sta(1) wirelesstype."00:26:4a:e9:xxx" = integer: sta(1) wirelessdatarates."00:1c:b3:b1:xxx" = string: 1(b) 2(b) 5(b) 6 9 11(b) 12 18 24 36 48 54 wirelessdatarates."00:1f:f3:f7:xxx" = string: 1(b) 2(b) 5(b) 6 9 11(b) 12 18 24 36 48 54 mcs: 0-15 wirelessdatarates."00:26:4a:e9:xxx" = string: 1(b) 2(b) 5(b) 6 9 11(b) 12 18 24 36 48 54 wirelesstimeassociated."00:1c:b3:b1:xxx" = integer: 2688530 wirelesstimeassociated."00:1f:f3:f7:xxx" = integer: 2619299 wirelesstimeassociated."00:26:4a:e9:xxx" = integer: 2623112 wirelesslastrefreshtime."00:1c:b3:b1:xxx" = integer: 0 wirelesslastrefreshtime."00:1f:f3:f7:xxx" = integer: 0 wirelesslastrefreshtime."00:26:4a:e9:xxx" = integer: 0 wirelessstrength."00:1c:b3:b1:xxx" = integer: -77 wirelessstrength."00:1f:f3:f7:xxx" = integer: -81 wirelessstrength."00:26:4a:e9:xxx" = integer: -48 wirelessnoise."00:1c:b3:b1:xxx" = integer: -96 wirelessnoise."00:1f:f3:f7:xxx" = integer: -96 wirelessnoise."00:26:4a:e9:xxx" = integer: -96 wirelessrate."00:1c:b3:b1:xxx" = integer: 12 wirelessrate."00:1f:f3:f7:xxx" = integer: 21 wirelessrate."00:26:4a:e9:xxx" = integer: 54 wirelessnumrx."00:1c:b3:b1:xxx" = integer: 75459 wirelessnumrx."00:1f:f3:f7:xxx" = integer: -1 wirelessnumrx."00:26:4a:e9:xxx" = integer: -1 wirelessnumtx."00:1c:b3:b1:xxx" = integer: 320260 wirelessnumtx."00:1f:f3:f7:xxx" = integer: -1 wirelessnumtx."00:26:4a:e9:xxx" = integer: -1 wirelessnumrxerrors."00:1c:b3:b1xxx" = integer: 3683 wirelessnumrxerrors."00:1f:f3:f7:xxx" = integer: -1 wirelessnumrxerrors."00:26:4a:e9:xxx" = integer: -1 wirelessnumtxerrors."00:1c:b3:b1:xxx" = integer: 2795 wirelessnumtxerrors."00:1f:f3:f7:xxx" = integer: -1 wirelessnumtxerrors."00:26:4a:e9xxx" = integer: -1
Any advantage to building in a "ping" of the phones if they are undetected? I also have the iPhone presence detection script set up as a trigger on Indigo. Pressing the button sends a "dopushmail" message to the phones to see who's home if SPR shows everyone gone. http://www.perceptiveautomation.com/userforum/viewtopic.php?f=4&t=4894 See the middle section of page 3.
|
| Sun Mar 11, 2012 9:01 am |
|
 |
|
odavis
Joined: Jan 14, 2011 Posts: 26 Location: El Cerrito, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I have three iPhones in my house and over my first 12 hours of SPR use i've found that two of them stay associated as long as wifi is turned on. The third phone disassociates after 5 to 15 minutes no matter what.
I've started looking for a setting or app that explains this difference in behavior but have yet to find it. The phone models that stay on are a 4 and 4s. The one that drops is a 4s. All are running 5.10.
|
| Sun Mar 11, 2012 11:01 am |
|
 |
|
odavis
Joined: Jan 14, 2011 Posts: 26 Location: El Cerrito, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I might have found the trick to keeping the iPhone wifi associated: enable wifi syncing with iTunes.
After disabling it on my iPhone my 4s finally dropped it's association for the first time.
|
| Sun Mar 11, 2012 2:09 pm |
|
 |
|
odavis
Joined: Jan 14, 2011 Posts: 26 Location: El Cerrito, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
After enabling wifi sync on the one iPhone that kept dropping the iPhone now stays associated.
|
| Sun Mar 11, 2012 8:57 pm |
|
 |
|
rszmetro
Joined: Sep 10, 2009 Posts: 88 Location: East Hills, NY
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Hi,
Great plugin. I have a problem, though, and not sure why. I have two iPhone 4s phones. Mine, and my wife's. The plugin tracks my phone accurately as far as home or away. But my wife's phone changes to away after about 10 minutes after getting "home", although the phone hasn't been touched. It sometimes goes home and away at other times, but I haven't detected a pattern.
Any ideas?
Thanks, Rob Z
_________________ Rob Z
|
| Fri Apr 06, 2012 11:15 am |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 227 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
The phone needs to access the network in order for it to be detected by the plugin. Is the phone setup to check an email account on a regular basis? Are you matching by ip address or Mac address?
|
| Fri Apr 06, 2012 11:30 am |
|
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|