DIY Smart-Home Security with Apples’ HomeKit
Simulate Occupancy with Lights, Protect with Alarm/Siren, Initiate Geo-Fencing, Trick non compliant Accessories.
My interest in tackling this HomeKit security automation project was twofold: one we are planning on spending time away from home this year, and two whilst hiking in the Columbia River Gorge I managed to slip on some black ice and break my wrist, Merry Christmas. The latter afforded me several months of forced downtime with nothing to do as my dominant hand was the one that broke... badly - sounds like a TV show.
My goals were to simulate occupancy in the house when there was none, provide some kind of audio alarm to ward off unwanted intruders, enable geo-fencing automations, and provide a means to turn the whole scenario on and off. This was not easy. Unfortunately, Apple does not allow HomeKit to group automations into scenes, this would be the best solution to my problem, however it did not exist at the time of this article.
My solution was to use the hand that was dealt to me with Apple’s sole focus on accessories as the dominant means of control and manipulation. This accessory approach is inherently unsuitable for home security as the proper solution requires the grouping of many automations into a scene, in my case a desired scene titled “vacation mode on/off”. I discovered a workaround for this limitation by making use of the “When an Accessory is Controlled” automation. This automation affords the user to set up one accessory, in my case a smart plug, as a slave or trigger to activate a series of accessories over time. Additionally, I made use of the “Only at Night” setting, and both the on and off states of the trigger to control the automation scenario. By plugging this trigger accessory into yet another smart plug called master switch, I am able to turn the automation on and off globally.
The most frustrating hurdle in developing a HomeKit security solution, was the lack of any means to visualize or preview the automations. The easiest way I could think of to solve this was to create a spreadsheet displaying accessories over time. If any developer, Apple or otherwise, is interested in pursuing this home security automation they must provide a means of previewing the progression of lights coming on and off to prove the randomness and a faithful representation of simulating occupancy.
One means might be a three dimensional wire frame version of a house with drag and drop accessories, another would be simply to automate the homepage icons, showing them coming on and off over time, perhaps with a darkening of the background to show the progression of sunset to night and perhaps a time clock counting down on the page. (See gif here).
The programming analogy that I hoped to achieve would read something like this… When B and R are not at home (iPhones that is), and motion is detected, turn on all the lights, turn on the alarm/siren, and send me a notification. It would be great if Apple afforded a means to send a text message as well. Update... by using the IFTTT app I was able to get text and phone call alerts from Blink motion detection. Also, by adding the phone numbers from these services to Contacts (named SECURITY ALERT), then assigning custom ringtones (classic>alarm) and setting the Emergency Bypass to on, I get persistent and loud alerts to unwanted intruders globally. Video here.
Not surprising in Apple’s walled garden, trying to find any kind of 3rd party smart speaker that connects to HomeKit is nearly impossible (alas HomePod is nowhere near ready for prime time in this security project). I did purchase OneLink’s Smart and Sound product, but as that was solely driven by Amazon and Google, it had to go back. A good idea but not fully implemented either as a security device or as a HomeKit device. What I did end up finding was 110 V surface mounted siren/horn that I managed to put a smart switch between it and the power supply. This enabled me to add the siren as the HomeKit accessory device and could weave it into any number of automation scenarios. Horn sound (loud).
Prior to diving into this home security project with HomeKit I had already purchased the Blink home security camera system. Unfortunately Blink is not HomeKit compatible! However, I found a way to get around this limitation by plugging the Blink Smart Module into one of my smart plugs, again affording me the opportunity to control when the cameras came on through HomeKit. I do not want them on when I am at home during the day, too many false alarms.
One of the best parts of HomeKit, which many third-party applications do not support, is making use of sunset and sunrise automations. That is to say you can control whether an accessory comes on at sunset or some period of time up to an hour before or after sunset, or sunrise for that matter. This is an excellent feature in HomeKit that accommodates all-year, all-season automations with no fuss.
No, this is not a sword fight with the planet, but Apple’s location-based awareness that determines whether groups or individuals are home through their iPhones and activates a series of automations based on that occupancy or lack there of. This can be used for security/alarms, lights, heat or cooling and security cameras as previously mentioned. One can adjust the perimeter of the geo-fence to accommodate specific needs, in my case I set a eight mile perimeter on the automation titled…”When I arrive home”, that way there is enough distance and time for my furnace to kick on and heat the house before I arrive. Another geo-fence is to turn on Blink when I leave, ie safety for my wife.
My automation works, though it is cobbled together from a design solution that was not intended. Ideally, the ability to group automation’s and control them with a scene would be perfect. The ability to randomize start times and stop times would be another bonus. After investigating the products and services available for home automation, it became clear to me that a HomeKit controlled remote starter for my car would be fantastic.
- Insignia smart plug with power meter, bought on eBay.
- Ecobee3 with motion sensor, bought on eBay. $50 rebate from State of Oregon
- Blink home security cameras bought on sale at Amazon.
- Apple TV fourth generation, used as hub for HomeKit, already had it.
- Edwards Signaling horn/siren bought on eBay
- Orbit b-hyve irrigation controllers (2). Not HomeKit compliant… yet. $100 rebate from per controller from local Water Bureau.
Total cost $525 not counting ATV. Subtract a rebate savings of $250. This compared to $2,000 for a commercially installed system and $15-30/month.
The Home app ecosystem is just getting started but there are numerous ways to apply the technology to a user’s benefit, especially those who travel frequently. Personally, it is my belief that home security should be a higher priority than the convenience based implementation of HomeKit and the Home app as it currently stands. The notion of walking into a room and having a light turn on for me, change color and dim by 50%, seems to be a uniquely first-world luxury.
I am not a programmer. My results come from a dogged determination to find a solution to my specific needs, your needs may vary. There may be smarter, simpler, and more elegant solutions available than my approach, but I’m just not that smart.
Russ Widstrand is a photographer, technologist and Apple user since 1985. Learn more here.