SYS-CON MEDIA Authors: Pat Romanski, Yeshim Deniz, Janakiram MSV, Liz McMillan, Elizabeth White

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
Docker and Kubernetes are key elements of modern cloud native deployment automations. After building your microservices, common practice is to create docker images and create YAML files to automate the deployment with Docker and Kubernetes. Writing these YAMLs, Dockerfile descriptors are really painful and error prone.Ballerina is a new cloud-native programing language which understands the architecture around it - the compiler is environment aware of microservices directly deployable into infra...
Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also received the prestigious Outstanding Technical Achievement Award three times - an accomplishment befitting only the most innovative thinkers. Shankar Kalyana is among the most respected strategists in the global technology industry. As CTO, with over 32 years of IT experience, Mr. Kalyana has architected, designed, developed, and implemented custom ...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
10ZiG Technology is a leading provider of endpoints for a Virtual Desktop Infrastructure environment. Our fast and reliable hardware is VMware, Citrix and Microsoft ready and designed to handle all ranges of usage - from task-based to sophisticated CAD/CAM users. 10ZiG prides itself in being one of the only companies whose sole focus is in Thin Clients and Zero Clients for VDI. This focus allows us to provide a truly unique level of personal service and customization that is a rare find in th...
As you know, enterprise IT conversation over the past year have often centered upon the open-source Kubernetes container orchestration system. In fact, Kubernetes has emerged as the key technology -- and even primary platform -- of cloud migrations for a wide variety of organizations. Kubernetes is critical to forward-looking enterprises that continue to push their IT infrastructures toward maximum functionality, scalability, and flexibility. As they do so, IT professionals are also embr...

CloudBees, Inc., the hub of enterprise Jenkins and DevOps, today announced a major investment in Kubernetes technology across all areas of the business. CloudBees has made Kubernetes a key part of its lon...

Signs of a shift in the usage of public clouds are everywhere. Previously, as organizations outgrew old IT methods, the natural answer was to try the public cloud approach; however, the public platform alone is not a complete solution. Complaints include unpredictable/escalating costs and mounting security concerns in the public cloud. Ultimately, public cloud adoption can ultimately mean a shift of IT pains instead of a resolution. That's why the move to hybrid, custom, and multi-cloud will ...
The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get tailored market studies; and more.
Signs of a shift in the usage of public clouds are everywhere Previously, as organizations outgrew old IT methods, the natural answer was to try the public cloud approach; however, the public platform alone is not a complete solutionThe move to hybrid, custom, and multi-cloud will become more and more prevalent At the heart of this technology trend exists a custom solution to meet the needs and concerns of these organizations, including compliance, security, and cost issues Blending Ser...
While a hybrid cloud can ease that transition, designing and deploy that hybrid cloud still offers challenges for organizations concerned about lack of available cloud skillsets within their organization. Managed service providers offer a unique opportunity to fill those gaps and get organizations of all sizes on a hybrid cloud that meets their comfort level, while delivering enhanced benefits for cost, efficiency, agility, mobility, and elasticity.
Serverless Computing or Functions as a Service (FaaS) is gaining momentum. Amazon is fueling the innovation by expanding Lambda to edge devices and content distribution network. IBM, Microsoft, and Google have their own FaaS offerings in the public cloud. There are over half-a-dozen open source serverless projects that are getting the attention of developers.
If you are part of the cloud development community, you certainly know about “serverless computing,” almost a misnomer. Because it implies there are no servers which is untrue. However the servers are hidden from the developers. This model eliminates operational complexity and increases developer productivity. We came from monolithic computing to client-server to services to microservices to the serverless model. In other words, our systems have slowly “dissolved” from monolithic to function-...
Docker is sweeping across startups and enterprises alike, changing the way we build and ship applications. It's the most prominent and widely known software container platform, and it's particularly useful for eliminating common challenges when collaborating on code (like the "it works on my machine" phenomenon that most devs know all too well). With Docker, you can run and manage apps side-by-side - in isolated containers - resulting in better compute density. It's something that many developer...
The KCSP program is a pre-qualified tier of vetted service providers that offer Kubernetes support, consulting, professional services and training for organizations embarking on their Kubernetes journey. The KCSP program ensures that enterprises get the support they're looking for to roll out new applications more quickly and more efficiently than before, while feeling secure that there's a trusted and vetted partner that's available to support their production and operational needs.
When a company wants to develop an application, it must worry about many aspects: selecting the infrastructure, building the technical stack, defining the storage strategy, configuring networks, setting up monitoring and logging, and on top of that, the company needs to worry about high availability, flexibility, scalability, data processing, machine learning, etc. Going to the cloud infrastructure can help you solving these problems to a level, but what if we have a better way to do things. ...