Smartphone Radar - Smartphone presence detection (Updated)
| Author |
Message |
|
bluenoise
Joined: Aug 23, 2008 Posts: 108
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I agree that one minute is just too short of a time to determine we're away. That is actually my favorite feature of the plug-in. I like that it will determine we've returned home within a minute, but wait a longer period of time to determine we're away. My old script did everything on the minute and that occasionally caused minor issues. I have the away time set to 15 minutes in the plug-in as that's a good time for us. I have a trigger action that watches the variable AllPhonesAway. When that variable changes, the action sets the thermostat and lighting accordingly. Last night, that variable kept changing, in spite of all three phones staying present. I think I know what was causing those changes and why I thought it was toggling every minute. I think that variable was set to "true" briefly and then set back to "false" right away. But, Indigo triggered that action, which in turn triggered other watching trigger groups on the first change and that took nearly a minute to finish executing all the lights getting toggled. Since that variable changed back in the meantime, the actions were queued to happen as soon as the first batch completed. So, what I'm thinking might be happening is that the script is changing that variable to true, possibly at the start of execution as part of an initialization, before then determining the state of all the phones. Once it does the determination, it updates the value of the variable to the correct value of "false." If the setting for the minutes is greater than one cycle of the plug-in (one minute), then the temporary "away" value gets smoothed out. That's just my theory anyway. 
|
| Wed Feb 01, 2012 10:12 am |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 232 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
When the plugin is started all phones are set to "home", and all variables are initialized to reflect that status. That could cause problems if you use the variables as a trigger. The variables are meant more to be used as conditions in triggers. For example, Turn all Outside Lights off IF variable AllPhonesHome = True.
You should consider using the plugin's "All Phones Away" event rather than watching the variable. That method will not suffer from false triggers at startup.
|
| Wed Feb 01, 2012 10:23 am |
|
 |
|
ateliers119
Joined: Feb 02, 2012 Posts: 11
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Hi,
This is really a great feature! I have a Fritzbox router and several Airport extreme and airport express realizing my network. I work in MacOs 10.6.8 I have forwarded in my router the port and Indigo does see the iPhones (2 iPhones) What happens is that all tough Indigo does see these iPhones the STATE and the VARIABLE differ for my iPhone. And I get the change to HOME or TRUE when I click the 'edit device settings'. I filled in my MAC number. And it takes some time to view the change happen when I have been away. Wouldn't it be great to be able to arrive home and without using any means the light switches on. In fact that works but sometimes when I am already for 10 minutes in the house.
Can you help me out here? It would be great.
Thanks
Mirko
|
| Thu Feb 02, 2012 2:39 pm |
|
 |
|
automatr
Joined: Feb 02, 2012 Posts: 14
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Is there a wireless router that's particularly well suited for integration with Smartphone Radar and Indigo? It looks like the Airport Extreme we have is just not the way to go for this task. I know I need the ability to forward logs to a port that I specify. Can anyone recommend any currently available models that are able to do this easily? TIA!
|
| Sun Feb 05, 2012 5:02 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 232 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
The new Beta of Smartphone Radar should work well with an Airport Extreme. It doesn't require any forwarding of the log.
I posted it on page 10 of this thread.
|
| Sun Feb 05, 2012 5:20 pm |
|
 |
|
automatr
Joined: Feb 02, 2012 Posts: 14
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Hmmm, missed that somehow. Got it up and running and seeing my iPhones. Been wanting to use iPhones to determine who's home for years. Can't wait to play with this. Thanks!
|
| Sun Feb 05, 2012 6:59 pm |
|
 |
|
Randaulf
Joined: Jan 31, 2012 Posts: 10
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I'm not quite sure what my issue is, but I am having difficultly with triggers. It appears as if the Smartphone Radar Plugin is working properly (status changes to away after 15 minutes), but I am unable to set up any actions based on status change. Any thoughts as to why that is, or any suggestions? Thanks!
|
| Thu Feb 09, 2012 6:21 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 232 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Hmmm. What do your logs say at the time the phones became away? How many phones are you watching?
|
| Thu Feb 09, 2012 7:21 pm |
|
 |
|
Randaulf
Joined: Jan 31, 2012 Posts: 10
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Alright, so case of the Monday's on my part. I had set up my triggers incorrectly. The plugin works flawlessly!
|
| Thu Feb 09, 2012 9:09 pm |
|
 |
|
ateliers119
Joined: Feb 02, 2012 Posts: 11
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Hi Travis, We're running indigo 5.0.4 with your plugin 1.0.5. We're running these on Snow Leopard server with SNMP enabled. And are trying to configure the SNMP option for this. It seems the SNMP is limited to airport devices, looking for wireless info in the stream. Can you make it so, perhaps a 3rd option, to allow a broader scale of SNMP devices such as Snow Leopard Server. Below an outtake from the Indigo log - - Code: Select all
Plugin "Smartphone Radar 1.0.5" started Smartphone Radar Watching for smartphone 'iPhone' at address '40:a6:d9:2f:c9:f3'. Trigger NAME komt binnen in LOCATION Sent X10 "B01 Halogeen Schilder Atelier" on Sent X10 "B02 Halogeen werkplaats" off Smartphone Radar Error The SNMP request from 192.168.1.251 timeout out. Wrong password? Sent X10 "B02 Halogeen werkplaats" on
Feb 11, 2012 21:34:15 Reloading plugin "Smartphone Radar 1.0.5" Stopping plugin "Smartphone Radar 1.0.5" (pid 3862) Plugin "Smartphone Radar" disconnected Starting plugin "Smartphone Radar 1.0.5" (pid 3890) Plugin "Smartphone Radar" connected Plugin "Smartphone Radar 1.0.5" started Smartphone Radar Watching for smartphone 'iPhone' at address 'XX:XX:XX:XX:XX'. Smartphone Radar Error The SNMP output from 192.168.1.251 does not contain any wireless info. Wrong password?
This is using the Airport SNMP option in your plugin but pointed at 192.168.1.251 which is the Snow Leopard server. The community string should default to "public" as far as we could find in /etc/snmp/snmpd/conf. Any help appreciated. Thanks
|
| Sat Feb 11, 2012 2:48 pm |
|
 |
|
travisc
Joined: Sep 07, 2010 Posts: 232 Location: Toronto, Canada
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I wish it were that easy. I'm no SNMP expert by any means, but from what I've learned it's a hot mess. The SNMP output from can differ greatly from one device to another. You'd think the output would be standardized somehow, but every device outputs different data. Unless you have the MIB's for a particular device, you're just guessing as to where the data is and what the data means. And these MIB's aren't all that easy to get your hands on either.
Luckily the airport routers are very similar, and list their wireless client data under the same OID. I have no idea what OID Snow Leopard server lists its wireless client, if it lists it at all, or what it would look like if it did. I wish it was a little more standardized, a generic SNMP implementation would be much easier.
Do you happen to know the particular OIDs for the data and how it is formatted?
|
| Sun Feb 12, 2012 11:19 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
ateliers119 wrote:...Can you make it so, perhaps a 3rd option, to allow a broader scale of SNMP devices such as Snow Leopard Server.
This idea sounds intriguing, but I was wondering what you would be looking for in the OS X MIB. If you are looking to see if a given IP Address or MAC address has an open connection to the Mac (for example, an iPhone Indigo-Touch client connected to Indigo) you can see that with netstat. For example, this is what I got showing my iPhone connected to Indigo - Code: Select all
$ netstat -n|grep 10.0.1.122 tcp4 0 0 10.0.1.94.8176 10.0.1.122.52103 ESTABLISHED
Using a simple shell script you could probably then generate a syslog message (using logger) and send it to the Smartphone Radar plugin. But, it all depends on what it is you are looking for that will identify the presence of a smartphone.
|
| Mon Feb 13, 2012 12:01 am |
|
 |
|
ateliers119
Joined: Feb 02, 2012 Posts: 11
|
 Re: Smartphone Radar - Smartphone presence detection (Update
Looking for DHCP data would make the most sense. Typical log entry from DHCP: - Code: Select all
Feb 13 19:53:43 aramaki bootpd[67345]: DHCP REQUEST [en0]: 1,e4:ce:8f:c4:fc:10 <Fuchikoma> Feb 13 19:53:43 aramaki bootpd[67345]: ACK sent Fuchikoma 10.0.0.36 pktsize 300
Snatch the Mac address from there as an acknowledgement that the smartphone is present and voila. The only issue you'll get from that is whenever the IP lease is renewed the stream will show again the mac address. Making indigo think the phone just arrived. This can be circumvented somewhat by setting a timeout in your plugin. Tell the plugin what the DHCP renew timer is and have the plugin ignore the mac address after the first time it sees it except when it didn't see it for X amount of time after the renewal should have occurred. For example have the plugin monitor the mac addresses and if the DHCP server is set to renew the lease every 4 hours and after 4 hours no renewal is initiated the plugins current timer starts. I'm not aware of a syslog/eventlog that can be shared with Indigo on Mac OS Server. So that option is probably out of the question. Apple being Apple its very very likely they used the exact same string as they use in their Airport products. I saw similar lines in the /etc/snmp/snmpd.conf as to what you're scanning. Only because the server doesn't do wifi and such some info will be "missing" from the snmp stream. Which is probably where the error comes from in my previous post.
|
| Mon Feb 13, 2012 1:09 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: Smartphone Radar - Smartphone presence detection (Update
ateliers119 wrote:Looking for DHCP data would make the most sense...
It looks like rather than parsing syslog messages into fields, the Smartphone Radar plugin scans syslog messages looking for a matching IP Address of MAC Address. This means you could PROBABLY create a shell script that continually scanned the log output of the DHCP server ( tail -f) looking for (grep) your desired MAC addresses, and then, when they were seen, formatting a simple message, containing the MAC address, to be sent to the syslog daemon using the logger program. You would then configure your syslog daemon to forward those messages to the Smartphone Radar plugin on port 1514. You'd probably want to set the lease to a short length to try to quickly capture a phone's appearance. I don't think these frequent lease messages would present a problem. Also, the length of the lease would, effectively, be your timeout period before determining that a phone had left. One other consideration with DHCP. If you assign fixed addresses to your leases in the DHCP conf file, they will most likely NOT be logged. That is standard behavior for most DHCP servers. This might be an issue if you want your phone to always get the same address. If you would like to pursue this path, I could give you a rough shell script to play with. Also, @travisc has not commented on this idea yet and I think it is probably a good idea to hear what he thinks about the whole idea.
|
| Tue Feb 14, 2012 12:52 am |
|
 |
|
AlaskaDave
Joined: Oct 16, 2008 Posts: 215 Location: Juneau, Alaksa
|
 Re: Smartphone Radar - Smartphone presence detection (Update
I'm setting up Smartphone Radar 1.0.5 and keep begging an Error of "The SNMP reequest for Extreme-Master-Room.local timeout out. Wrong Password?"
I've reset my password (Airport Extreme Password) in case I was using the wrong on when setting up the plug-in and continue to get this error. My Extreme is using Version 7.6 I get this error whether using the local address or the IP Address of the Base Station.
Any ideas?
Update: I seem to have found it. I did not have Allow SNMP checked under the Logging & Statistics tab. After checking that, placing a string in the SNMP Community String field and using that in the Set up of the Plug-in my error has gone away. Once setting up the device it indicates a state of 'Home" so I'm assuming that in 30 minutes or so it should indicate away as I am at work.
|
| Wed Feb 15, 2012 2:38 pm |
|
|
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
|
|