How I know I am home
Jeff Wooding
jeff at qualitytubandtile.com
Thu Jun 4 01:31:10 EDT 2015
I Like! :)
Thanks,
Jeff
On Wed, Jun 3, 2015 at 4:02 PM, rnaleonard <rnaleonard at rcn.com> wrote:
> When there is motion in selected outside areas like the driveway, and if
> we are not home, then an external script runs. This script checks the ARP
> entries for our phones. If either is found, the necessary incantations to
> update XTension to at home status are issued. My guess is that since the
> phone(s) have just arrived and are switching from cellular to wi-fi, the
> ARP tables update immediately. We choose not to let the system determine
> when we are not home. We have a separate process for that. Here is the
> external script (with personal identification elements removed and
> described inside [ ] ). Run the shell script to get the exact entries for
> your phones. Works every time for us. YMMV. The advantage is that there
> is no external web service or app involved.
>
> *on* arpcheck()
> *set* theMsg *to* ""
> *repeat* *with* theCount *from* 1 *to* 60
> *set* theResult *to* *do shell script* "arp -a"
> *if* theResult *contains* "? ([Assigned IP for phone 1]) at [MAC address
> for phone 1] on en0 ifscope [ethernet]" *then*
> *set* theMsg *to* "Phone 1 "
> *end* *if*
> *if* theResult *contains* "? ([Assigned IP address for phone 2]) at [MAC
> address for phone 2] on en0 ifscope [ethernet]" *then*
> *set* theMsg *to* theMsg & "Phone 2 "
> *end* *if*
> *if* theMsg *is* "" *then*
> *set* theCount *to* theCount + 1
> *delay* 1
> *else*
> *exit* *repeat*
> *end* *if*
> *end* *repeat*
>
> *tell* *application* "XTension"
> *write log* "Checking for iPhones"
> *if* theMsg *is* *not* "" *then*
> *set* theMsg *to* theMsg & ": At Home"
> [do things here to turn on your at home status]
> *else*
> *set* theMsg *to* "No iPhones are home"
> *end* *if*
> *write log* "" & theCount & ": " & theMsg & return & theResult
> *end* *tell*
>
> *set* theMsg *to* ""
> *set* theResult *to* ""
> *end* arpcheck
>
> _______________________________________________
> XTensionList mailing list
> XTensionList at shed.com
> http://shed.com/mailman/listinfo/xtensionlist
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shed.com/pipermail/xtensionlist/attachments/20150603/067b05fa/attachment.html>
More information about the XTensionList
mailing list