We have moved at community.getvera.com

Author Topic: Alert if away from home with windows open?  (Read 1795 times)

Offline hunjkins

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Alert if away from home with windows open?
« on: December 17, 2011, 11:09:16 pm »
I have some software called "AirLock" from http://themha.com/airlock/ which uses bluetooth to measure where an iOS device is from a computer, so if you simply take your iOS device away fro the computer with you it will be out of range and turn the screen saver on.

This got me thinking about other uses of Proximity, you see in my area, it's not so safe, so I like to close the windows when I'm out for safety, but sometimes I forget. Could I configure Vera (probably needing a script) to sense if my iPod Touch was off the network that I would be out of the house and in that case would check to see if the sensors were close i.e. the window was shut and if not to alert the iOS devices I have due to such an event?

The window sensor I have in mind is here:

http://www.uk-automation.co.uk/products/Z%252dWave-Door-and-Window-Sensor.html

..but I should think it would be a script at the users end that would need to be made to achieve this.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Alert if away from home with windows open?
« Reply #1 on: December 18, 2011, 08:23:03 am »
You'd have to write some lines of Luup code to periodically check whether your mobile phone is reachable via ping; if unreachable, check your sensors; if any of the sensors is tripped, send a notification to your mobile phone (http://wiki.micasaverde.com/index.php/Luup_plugins_and_Luup_code#Notifications).

Alternatively, you may get along with a combination of: Ping sensor plugin; a Luup scene with a list of events corresponding to your sensors, run by a dummy Luup scene triggered by a Ping sensor event; a notification plugin, triggered by the first Luup scene.

There are some reports that the SM103 sensors are eating batteries like crazy.
« Last Edit: December 18, 2011, 08:30:09 am by Ap15e »

Offline hunjkins

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Alert if away from home with windows open?
« Reply #2 on: December 18, 2011, 10:04:55 am »
Thanks for your reply. Well I might have configured my wireless device to not respond to ping requests as a matter of security and regarding the battery issue I don't think that is a good idea either. My iPod Touch would register it's MAC address with my hub and so when it drops out of range for a specific period it would do the business.

Why use ping when the MAC address absentee would suffice, would this work?

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Alert if away from home with windows open?
« Reply #3 on: December 18, 2011, 12:31:20 pm »
IIUC for your scenario you would need a Class 1 Bluetooth device in your mobile phone.

Offline hunjkins

  • Sr. Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Re: Alert if away from home with windows open?
« Reply #4 on: December 18, 2011, 06:23:57 pm »
Well no, that's the thing I didn't want to rely on Bluetooth because it's unreliable and a battery drain, much like BT v4, it's no good for home automation. There is a much more indicative method to determine if a user has left the building and that would be to monitor the MAC addresses.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Alert if away from home with windows open?
« Reply #5 on: December 20, 2011, 09:37:02 am »
Chances are that you can modify the Ping Sensor plugin to check for MAC addresses. Vera is based on OpenWrt and comes with a busybox that is accessible from Luup via os.execute(). Luup itself provides a method to retrieve web pages.

Code: [Select]
Vera V2@1.1.1362
Currently defined functions:
        [, [[, adduser, adjtimex, arping, ash, awk, basename, blkid, brctl,
        bunzip2, bzcat, cat, chgrp, chmod, chown, chroot, clear, cp, crond,
        crontab, cryptpw, cut, date, dd, deluser, df, diff, dirname, dmesg,
        dos2unix, du, echo, egrep, env, ether-wake, expr, false, fgrep, find,
        free, ftpput, fuser, grep, gunzip, gzip, halt, head, hexdump, hostid,
        hwclock, id, ifconfig, init, insmod, kill, killall, killall5, klogd,
        length, less, ln, lock, logger, logread, losetup, ls, lsmod, md5sum,
        mesg, microcom, mkdir, mkfifo, mknod, mkpasswd, mkswap, mktemp, mount,
        mv, nc, netmsg, netstat, nice, nslookup, passwd, pgrep, pidof, ping,
        ping6, pivot_root, pkill, poweroff, printf, ps, pwd, rdate, readlink,
        reboot, reset, rm, rmdir, rmmod, route, sed, seq, sh, sha1sum, sleep,
        sort, start-stop-daemon, stat, strings, swapoff, swapon, switch_root,
        sync, sysctl, syslogd, tac, tail, tar, tee, telnet, telnetd, test,
        time, top, touch, tr, traceroute, true, udhcpc, umount, uname, uniq,
        unix2dos, uptime, uudecode, uuencode, vconfig, vi, watch, watchdog, wc,
        wget, which, xargs, yes, zcat