Welcome!

Blog Feed Post

Greg Frank’s Smart Home Experiment: How one engineer/dad protected his home from flood, fire, and incomplete homework assignments.

Greg Frank is a VictorOps engineer on the plat-frastructure team. An iOT aficionado, Greg built a smart home system using SmartThings and VictorOps.

Over the years, I’ve had the misfortune of experiencing some small water leaks at my house. These were minor events: a leaky ice maker and a water valve for a sink. But among my friends and relatives, I have seen and assisted with cleanup for more severe water leaks that involved great expense and effort.

Configuring a smart home

My instinct as a developer is to attempt to find patterns of problems and connect them with general, proactive solutions that address the broadest category possible. This thinking process sent me down the path of evaluating smart home solutions and using automation to reduce the problems and stress of owning a home.

Throughout this search for a solution, my instinct toward DIY was tempered by a need to have something useful and reliable without inventing my way into constant troubleshooting and upgrades.

Looking at the various commercial options available, I was cautious of any choice that would limit an ability to integrate with the already existing large selection of sensors and actuators sold for smart homes. Of course, I also wanted the option to build some devices myself. SmartThings won me over with their large and growing selection of integrated devices and especially their (now discontinued) Arduino ThingShield with a zigBee module able to attach to a standard Arduino microcontroller.

Looking beyond the physical devices to the cloud platform, SmartThings also offers an extensively documented API with a web-based IDE for developing both new device handlers and “SmartApps.” I could not find another off-the-shelf solution for smart home hubs catering to my software developer need to tinker with everything.

Over the next year, our home system grew to include water sensors under every reasonable potential leak source, a smoke/CO alarm on each floor, some controlled outlets, a few controlled wall switches, and an automated master water valve for the whole house.

How the system works

Getting back to the original scenario of water leaks, these components all fit together very nicely. The SmartThings water sensor detects even a tiny amount of water and sends an event to the hub. From there, a SmartApp called “If Flood Turn Valve Off” receives the event and sends a “turn off” command to the main water valve and then sends me a text message. This configuration will help defend against scenarios where the source of the water is from the house plumbing, while still providing useful notification if the leak is originating from outside.

Our house already has the typical collection of required smoke/CO detectors, but there did not seem to be a convenient bridge to send data from that system into a smart home hub. So it seemed helpful to add one more alarm to each level of the home, giving the system some reasonable visibility into the state of the house.

When it comes to home security, there are so many systems and options, it would take a whole series of posts to cover that subject. Here is one specific use case to demonstrate the nuance of how a smart home can provide features above and beyond an ordinary alarm system.

Garage door closed?

Consider the scenario of driving away from your garage while the door is still on the way down and wondering if it hit some obstacle and proceeded to bounce back up. A tilt sensor on the door is commonly used to detect the up/down/currently moving state of a garage door. Couple that sensor with a SmartApp to detect “door is up,” followed by a bunch of motion ending with “door is up,” and it can send an alert for that specific situation. The added logic filters out alerts for everyday life and focuses alerts on truly noteworthy events.

tilt sensorhttps://victorops.com/wp-content/uploads/2017/06/garage_sensor-300x293.jpg 300w" sizes="(max-width: 250px) 100vw, 250px" />

Attic fan turned off?

We try to use the least amount of AC possible and depend on a whole-house fan to cool down the house on summer evenings. Unfortunately, it seems to bring a lot of pollen into the house if it runs past 2:00 am, causing allergies and sneezes for all family members. This started my hunt for a timer that could run something for three hours or turn off at 2:00 am, whichever comes first. Not long into that search, it became obvious that a Z-Wave wall switch coupled with a simple SmartApp would solve the problem quite easily. This gives the best combination of results with simple manual control from an ordinary switch on the wall and automatic shutoff timing from a background application keeping an eye on the switch.

Z-Wave wall switchhttps://victorops.com/wp-content/uploads/2017/06/ge_zwave_switch-172x300... 172w" sizes="(max-width: 315px) 100vw, 315px" />

Z-Wave wall switch

As our smart home system exited the proof-of-concept phase and became a regular, vital tool for home convenience and security, there were some clear limitations of the notification system.

Most smart home products offer a variety of contact methods such as phone calls, SMS, and email. This is very helpful, but just one contact attempt is not enough for truly severe situations.

Adding Incident Management to the system

It was right about this time when I started working for VictorOps, and for the first time in my career, the product I developed at work was something truly useful to me in my own home. The features needed to dial-in a perfect smart home notification solution turned out to be exactly what an incident management system offers.

Much of my professional life has involved receiving automated pages and emails related to the health of software systems under my care. Sadly, I had never experienced the reduction of stress possible when this happens within the context of a feature-rich incident management system. VictorOps truly offers an array of configuration choices and convenience settings to make everyday life so much more tolerable, while still keeping me connected.

The first step is to create a team for the users who will manage the incidents within the house. Here we have the Opsalot family with neighbor and relative:

Next, the single most helpful concept applicable to our smart home is an escalation policy.

Using the original example of a water leak, the ideal response is to make a few attempts to contact a member of the household, and then try reaching a next door neighbor, before calling an out-of-state relative. If you are going to have a system with automatic notifications, it is only fair to share the burden of being the first point of contact with a rotation:

Integrating with VictorOps

The first step was to write a SmartThings SmartApp to register for device events from a variety of devices (temperature sensors, battery states, water sensors) and forward them as alerts to VictorOps via our REST Integration API.

Smart Home Diagramhttps://victorops.com/wp-content/uploads/2017/06/Screen-Shot-2017-06-20-... 300w, https://victorops.com/wp-content/uploads/2017/06/Screen-Shot-2017-06-20-... 510w" sizes="(max-width: 600px) 100vw, 600px" />

The unique name of each device within a SmartThings hub is a natural fit for translation into a VictorOps EntityId.

Next, a value from the SmartThings device event had to be translated into Critical/Warning/Recovery states. For something like a battery level, you might use thresholds such as:

  • <= 10% is Critical
  • <= 30% is Warning
  • > 30% is Recovery

These thresholds can be defined as user-adjustable configuration values in a SmartApp to allow customization via the SmartThings mobile app.

Other devices such as water sensors or smoke alarms have natural distinct states easily translated into alert levels without thresholds. “On fire” or “water detected” are definitely always critical.

Recovery events on a VictorOps timeline are only desired when an EntityId is transitioning away from a Critical or Warning state to a healthy state. So, I used the SmartThings state feature to store the current state of each device and only transmit Recovery events to VictorOps at appropriate times.

SmartThings VictorOps Integration SmartApp Source

Integration sourcehttps://victorops.com/wp-content/uploads/2017/06/victorops_smartapp_scre... 300w, https://victorops.com/wp-content/uploads/2017/06/victorops_smartapp_scre... 768w, https://victorops.com/wp-content/uploads/2017/06/victorops_smartapp_scre... 1024w, https://victorops.com/wp-content/uploads/2017/06/victorops_smartapp_scre... 510w" sizes="(max-width: 600px) 100vw, 600px" />

A day in the life of the Smart Home with VictorOps

Let’s imagine the whole system working together in a realistic situation. We’ve all had a busy morning, and I start a load of laundry on the way out of the house before dropping the kids at school and heading to work. 45 minutes after we leave, the washer begins the spin cycle and the vibrations shake the 15-year-old water hose one last time, causing it to burst and spray a flood all over room. The water sensor on the floor detects water and sends a notification through the SmartThings App, indicating it is wet.

The “if-flood-turn-off-valve” SmartApp receives the water-detection event and sends a “close-valve” command to the LeakSmart valve installed on the main house water line. That action automatically stops the flood, but there is still a large amount of water on the floor. Meanwhile, the VictorOps SmartApp Integration has also received the water notification and forwarded it as a critical alert.

VictorOps incident management apphttps://victorops.com/wp-content/uploads/2017/06/victorops_incident_wate... 174w, https://victorops.com/wp-content/uploads/2017/06/victorops_incident_wate... 768w, https://victorops.com/wp-content/uploads/2017/06/victorops_incident_wate... 593w, https://victorops.com/wp-content/uploads/2017/06/victorops_incident_wate... 348w, https://victorops.com/wp-content/uploads/2017/06/victorops_incident_wate... 510w" sizes="(max-width: 300px) 100vw, 300px" />

The critical alert is routed to the family team within the family VictorOps organization and generates an incident.

Step One
Step One of the escalation policy is to send a push notification to me. Unfortunately, I’m in a long meeting with no technology and so I don’t receive the alert.

Step Two
After a couple of minutes, the water on the laundry room floor starts to drip down to the basement and spills into a ceiling light which shorts out and begins to send sparks. Meanwhile, five minutes after the first notification, the VictorOps escalation policy advances to Step Two (fortunately!) and alerts another family member.

That person is also unavailable to respond. At this point, the electrical short has a real risk of starting a fire.

Step Three
After two more minutes without an acknowledgement, Step Three of the VictorOps escalation policy kicks in, with the action of making a phone call to our next door neighbor.  Fortunately, the neighbors are home, head over to see smoke, and call the fire department.

How far can we take this?

Without annoying the whole family to the point where they leave me forever, just how far can we go down this path?

Do we need to connect the “late homework assignment” email from my kids’ school district to VictorOps, triggering an incident with its own escalation path?

Late homework policy

  1. 1) Page the child in question.
  2. 2) After a day, shut off the power and network to the Xbox.
  3. 3) After two days, notify a parent to intervene (interrupting our otherwise blissful life of leisure).

Switching to sanitation engineering, does the kitchen garbage can need a laser and optical sensor to detect when it is full, and assign an alert (to anyone but a parent) to take out the garbage?

Regardless of how far and silly this smart home concept goes, it’s clear that there are some good, practical, and fun applications for this technology.

So if you want to try this at home, head to Lowe’s for some sensors, hook up SmartThings, and sign up for a free trial of VictorOps. Let software solve your problems.                 </div>
      
                                  <p class=Read the original blog entry...

More Stories By VictorOps Blog

VictorOps is making on-call suck less with the only collaborative alert management platform on the market.

With easy on-call scheduling management, a real-time incident timeline that gives you contextual relevance around your alerts and powerful reporting features that make post-mortems more effective, VictorOps helps your IT/DevOps team solve problems faster.

Latest Stories
SYS-CON Events announced today that SourceForge has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
Today most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes significant work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reducti...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that Suzuki Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Suzuki Inc. is a semiconductor-related business, including sales of consuming parts, parts repair, and maintenance for semiconductor manufacturing machines, etc. It is also a health care business providing experimental research for...
"Our strategy is to focus on the hyperscale providers - AWS, Azure, and Google. Over the last year we saw that a lot of developers need to learn how to do their job in the cloud and we see this DevOps movement that we are catering to with our content," stated Alessandro Fasan, Head of Global Sales at Cloud Academy, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
Enterprises are moving to the cloud faster than most of us in security expected. CIOs are going from 0 to 100 in cloud adoption and leaving security teams in the dust. Once cloud is part of an enterprise stack, it’s unclear who has responsibility for the protection of applications, services, and data. When cloud breaches occur, whether active compromise or a publicly accessible database, the blame must fall on both service providers and users. In his session at 21st Cloud Expo, Ben Johnson, C...
Many organizations adopt DevOps to reduce cycle times and deliver software faster; some take on DevOps to drive higher quality and better end-user experience; others look to DevOps for a clearer line-of-sight to customers to drive better business impacts. In truth, these three foundations go together. In this power panel at @DevOpsSummit 21st Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, industry experts will discuss how leading organizations build application success from all...
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
Cloud-based disaster recovery is critical to any production environment and is a high priority for many enterprise organizations today. Nearly 40% of organizations have had to execute their BCDR plan due to a service disruption in the past two years. Zerto on IBM Cloud offer VMware and Microsoft customers simple, automated recovery of on-premise VMware and Microsoft workloads to IBM Cloud data centers.
Today traditional IT approaches leverage well-architected compute/networking domains to control what applications can access what data, and how. DevOps includes rapid application development/deployment leveraging concepts like containerization, third-party sourced applications and databases. Such applications need access to production data for its test and iteration cycles. Data Security? That sounds like a roadblock to DevOps vs. protecting the crown jewels to those in IT.
SYS-CON Events announced today that Cedexis will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Cedexis is the leader in data-driven enterprise global traffic management. Whether optimizing traffic through datacenters, clouds, CDNs, or any combination, Cedexis solutions drive quality and cost-effectiveness.