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.
GOALS
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.
SOLUTION
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.
SIREN/ALARM
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).
SECURITY CAMERAS
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.
GEO-FENCING
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.
WISHLIST
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.
PRODUCTS
- 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.
CONCLUSION
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.
ABOUT
Russ Widstrand is a photographer, technologist and Apple user since 1985. Learn more here./
bruce burr says:
Sorry for your break. Hope your away time is pleasurable. Best to you and Barb.
· February 13, 2019 @ 8:55 pm
Russ Widstrand says:
Thanks Bruce. Pretty geeky of me, but time to kill proved to be productive.
· February 13, 2019 @ 9:57 pm
Richard Gunther says:
This is a great post, Russ. Using an outlet module to manage state is a clever workaround to get past some of HomeKit’s limitations.
I don’t know if you’re aware of this or not, but you could also try using IFTTT to arm and disarm your Blink cameras so they don’t have to rejoin your network every time they’re turned on again.
Can’t wait to see what else you’re doing with HomeKit!
· April 7, 2019 @ 1:53 pm
Russ Widstrand says:
Thanks Richard. Yes I am aware of IFTTT geo fence for Blink cameras, but only solves one of many conditions, I also want it on at night when I am at home, for example. I also like having the button in the Home app to turn on and off manually.
· April 7, 2019 @ 5:04 pm
Macinspak says:
In case anyone else is trying to build a DIY alar with HomeKit, I built this node red DIY alarm system that I use in our house to do exactly that.
https://flows.nodered.org/node/node-red-contrib-alarm
· December 11, 2020 @ 7:32 am
Russ Widstrand says:
Thanks for your tip. A bit beyond my knowledge base, you might say what it is first, software or hardware. I don’t know what a red node is for example. On another note, my system went down, siren connected to smart switch would not shut off. Deleted motion sensors from Home app., no change. Deleted automations controlling security sys., no change. Deleted entire home from Home app., no change. Had to hire electrician to physically disconnect siren from power. So I’d say a failed approach on my part. Still disabled to this day.
· December 12, 2020 @ 8:29 pm