I know, this sounds like the project shown in the example video - door open/close sensor, well it is, but on steroids!
This project addresses several needs. As you may find, any home automation system needs a good way to detect the status of doors/windows, especially the front door. This is needed for:
- Security (obvious I guess)
- Automation of door locking
- Turning Lights on/off
Plus many more. The problem I found is that if you want wireless sensors (and who doesn't), there are really only two choices, Zwave and Insteon. Most of these consist of large ugly boxes, with magnets. Fortunately, you can get hidden sensors as well (some very weird ones - check this out
http://darwinsden.com/strips-zwave-door-window-sensor-review/).
This is the best Zwave one I have found:
http://aeotec.com/hidden-z-wave-door-sensor, and this is the best insteon one I have found:
http://www.insteon.com/hidden-door-sensor/The problem with all these sensors is that they only report when the status of the door changes (to save battery). You can't get an absolute value from them, just a change. The battery reporting is a bit digital as well - ie 100%, 100%, 100% - nothing. So when your door sensor battery dies, you have no idea what the door status is (especially if you are on the road as I tend to be), and that messes up all your other dependent routines (door locking/unlocking for example).
So my solution to date has been to have two sensors, the main Zwave one (which is ultra reliable until the battery dies), and a backup one (insteon) which is not as reliable - you would not believe how fast the front door opens and closes when my kids come and go, and the insteon sometimes misses a transition. The missed transition can be an issue, as now you have one sensor saying the door is closed, and one saying it is open. I believe the Zwave (reliable) one, but when the battery dies, I have to switch to the unreliable one. Not the best situation for the front door (especially when I use this to auto-lock the door with a yale zwave lock). I need a third sensor, that meets the following criteria:
- Small (no large boxes!)
- long battery life
- reliable
- can report status, not just events
- Not Zwave or Insteon
Solution:
mcModule 110! Bonus, with the accelerometer, you can also detect people knocking at the front door (I have a door bell, but lots of people are baffled by it - it's an August smart door bell). They knock on the door, and say "I couldn't find the door bell" - I say "it's the thing with the button with a picture of a bell on it next to the door".
NOTE: the code for this is written for the 110 module, it will not work for the 120 until the accelerometer library for the 120 module is working. You could use it without the door knock feature though.
The module is used as is, no wiring or anything. I attached it with velcro to the top left of the door. The module goes on the door, and a small magnet attaches to the frame (see the pictures).
The module reports battery, door status (open/closed), temperature (why not), and uptime every 30 seconds in turn. It also reports a double tap on the door as a door knock, with some lock out timing to prevent door opening/closing etc from setting off the knock sensor.
As usual (for me) this reports through my openhab set up, and pushes alerts to my phone when a door knock is detected.
With this added to the door, I now have an absolute method of telling if the door is open or closed, and with three sensors (using different technologies for redundancy), I can use 2 out of 3 voting to decide what is the actual door status, and best guess if one sensor has a dead battery.
We will see what the battery life is like.
code is here:
https://github.com/NickWaterton/mcScript/tree/master/projects/DoorSensorThis is what the output of my front door log looks like:
2016-11-04 15:25:15.758 [INFO ] - Front Door OPEN (ZWave Sensor)
2016-11-04 15:25:15.849 [INFO ] - Front Door OPENED - Master Sensor: Zwave
2016-11-04 15:25:16.116 [INFO ] - Front Door OPEN (Insteon Sensor)
2016-11-04 15:25:16.220 [DEBUG] - Setting Front Door Indicator (153) to hallway_HSM200_setcolour Mode: 8
2016-11-04 15:25:16.435 [DEBUG] - HSM200 Indicator Changed to value: 8 (Yellow)
2016-11-04 15:25:16.671 [DEBUG] - Setting Front Door Indicator (153) Mode to: Fast BLUE (door open)
2016-11-04 15:25:16.818 [INFO ] - Front Door OPEN (mcThings Sensor)
2016-11-04 15:25:24.377 [INFO ] - Front Door CLOSED (ZWave Sensor)
2016-11-04 15:25:24.414 [INFO ] - Front Door CLOSED - Master Sensor: Zwave
2016-11-04 15:25:24.415 [DEBUG] - Setting Front Door Indicator (153) to hallway_HSM200_setcolour Mode: 5
2016-11-04 15:25:24.417 [DEBUG] - HSM200 Indicator Changed to value: 5 (Blue)
2016-11-04 15:25:24.418 [INFO ] - AutoRelock: autolock timer (FrontDoor) reset by: Door Close Auto Lock for 5 more minutes
2016-11-04 15:25:24.420 [DEBUG] - Setting Front Door Indicator (153) Mode to: Tail Yellow (lock pending)
2016-11-04 15:25:24.700 [INFO ] - Front Door CLOSED (Insteon Sensor)
2016-11-04 15:25:24.968 [INFO ] - Front Door CLOSED (mcThings Sensor)
2016-11-04 15:30:24.423 [INFO ] - AutoRelock: Front Door Locked by: Door Close Auto Lock
2016-11-04 15:30:24.427 [INFO ] - Front Door LOCK command received
2016-11-04 15:30:24.432 [DEBUG] - Setting Front Door Indicator (153) Mode to: Tail RED (locking)
2016-11-04 15:30:33.380 [DEBUG] - Front Door Lock Status updated to: CLOSED
2016-11-04 15:30:33.380 [INFO ] - Delay between Front Door Lock receiving command and CONFIRMED response: 8.958s
2016-11-04 15:30:33.418 [INFO ] - Door Lock confirmed recipt of Lock command
2016-11-04 15:30:33.418 [DEBUG] - Setting Front Door Indicator (153) to hallway_HSM200_setcolour Mode: 4
2016-11-04 15:30:33.420 [DEBUG] - HSM200 Indicator Changed to value: 4 (Green)
2016-11-04 15:30:33.424 [DEBUG] - Setting Front Door Indicator (153) Mode to: Slow RED (locked)
2016-11-04 15:30:33.917 [INFO ] - Front Door is CONFIRMED LOCKED
2016-11-04 15:30:53.308 [INFO ] - Door Lock Battery level: 66%
2016-11-04 15:30:53.368 [INFO ] - Front Door command status: SUCCESS
2016-11-04 15:32:23.915 [INFO ] - Door Knock Detected at: 2016-11-04 15:32:23
All I need now is a nice white box to put the module in - hint hint...