A Beginner's Guide to Automation: What is Automation?

By now, you’ve installed all the various devices in our home. You can whip out your phone to change the temperature on your thermostat, turn on the lights, see who is at the door, close the blinds, and make sure the door is locked with the greatest of ease. Congratulations, you have a connected home! The next step is to start turning your connected home into a smart home. If the hub is the brain of your home, then (at the risk of taking the analogy too far), your home’s “thoughts” are automations.

An automation can have one of several different degrees of complexity. The level of complexity you require typically informs that class of device you need. I’ve grouped these complexity levels into 4 major categories. We’ll start with the simplest category, discuss an example, and then build on it through the increasing levels.
To start, let’s get some terminology out of the way:
  • Condition or trigger: These aren’t exactly the same thing but for now, let’s say they both refer to something that happens or an event that occurs. Some examples of these events might be clock based as in “it is now 8pm” or “it is the weekend”. Others can be based on action you or your family members take: “Mom came home”, “my doorbell rang”, “motion was detected in the hallway”.
  • Action: this is something you want your smart home to do in response to a trigger. Examples of this would be “turn the hallway light on”, “sound an alarm”, or “announce that Mom is home”
These terms make up the building blocks of home automation. The complexity of the automation is typically determined by the number and composition of conditions that can be addressed.

IFTTT creates Level 1 Automations
Let’s start off with Level 1. The simplest level is one condition can trigger one action. Simply put: If this happens then do that. In fact, an awesome online service that specializes in this type of simple automation is called If This Then That or IFTTT for short. IFTTT is great because it can tie together many different online services and have them interact with your smart home’s hub. Some of examples of this are: If my Wyze camera (a wifi, cloud-based camera that does not work with SmartThings) detects motion then turn on my SmartThings controlled porch light. Or post a tweet. Or log it to a Google Sheet. The possibilities are endless! This service is used my many people as the connective glue between many of their wifi-based devices. You should check it out and even use it for automations that have nothing to do with your smart home. (IFTTT is probably worth a blog post all on its own!)

The automation we’re going to build on is If there is motion on my front steps, then play an announcement on my Google Home speaker that “Someone is at the door”. This is useful for letting us know when the mailman comes or that the kids have let themselves in or someone is knocking at the door. As its most basic essence, the automation is pretty cool. We’re using a motion detector (cool!) and my house can tell that something is moving at the front door (very cool!) and can then trigger an announcement (super cool!) and it seems like magic. We’ll never miss a package or a soft-knocker again! Success, right? Not so fast. The way we've built it, this simple rule will “always” blare the announcement when motion is detected, regardless of the time of day. So when my teenager tiptoes home a 1am trying to be as quiet as possible out of consideration for all the folks in the house that actually require sleep, a Google Home proclamation that “someone is home” is not that useful or welcome.

Alexa provides Level 2 fixed
conditions for its automations
Enter Level 2. Level 2 allows us to add a fixed set of conditions to our simple automations. These conditions are usually the day of the week and time of the day. They also allow more than one action to be performed. This means that our “If this happens then do that” statement becomes “If this happens on day X between these times then do that and that other thing”. Going back to our example, we can change our simple automation to be If there is motion on Monday, Tuesday, Wednesday, or Thursday between 8am and 10pm then announce “Someone is at the door”. This way, anyone arriving after 10pm (I go to sleep pretty early) or weekends won’t be announced. Alexa and Google Home allow you to create routines that can be triggered by an action and limited to certain days and time of the day which puts them firmly in the Level 2 category. Level 2 might be enough for many things but it is still only scratching the surface of what we can do. This is why they are not considered true automation hubs.

SmartThings "mode" condition
in SmartLighting app
Many real smart hubs, including SmartThings and Hubitat use Level 2 automations as their default or simplified automation engine. However, they expose another dimension by adding an additional type of condition called a “mode”. A mode is a value meant to represent the state of your home and is visible to all of your automations. Common modes that people use in their homes are “home”, “away”, and “night”. These are clues that your home can use to decide which automations should be activated. These mode values arbitrary and need to be set up and changed by the homeowner. You might have a routine that you run at bedtime that turns off the lights and sets the mode to “night”. In the morning, a motion sensor might see you moving and change the mode to “home”. When you leave to work, your phone might detect you are out of the house and set the mode to “away”. Modes are an extremely powerful concept and allow a great deal of flexibility when added to a Level 2 automation. They allow you to set up automations and have them only run during certain modes. This means that you can set up multiple automations for a single trigger that behave differently when run in different modes. If you have your bathroom light go on when motion is triggered, you can have it fully turn on when the mode is “home” but dim to only 50% brightness when mode is “night” and you don’t want to be blinded.  In our front door example, we could have the announcement only trigger if the mode is “home” and not when the mode is “night”.

When you are creating the automation that uses the mode in one of the hub’s simple apps, it is really just another fixed condition. Our running example becomes: If there is motion on Monday, Tuesday, Wednesday, Thursday, Or Friday and mode is “home” then announce “Someone is at the door”. But because modes can be set by other conditions and automations, they elevate the automations they are used in to another level; Level 3 to be exact. When you use a mode, you are relying in its value to be set by a button press or a presence sensor or a time of day (i.e sunset) or other automations. This complexity and power is where the true hubs begin to pull away from the level 2 automations provided by Alexa and Google Assistant.

Modes and Level 3 automation can help you accomplish most tasks, especially if you get creative with the type of modes you use. However, there are times when even more flexibility is required. Level 4 automations allow much more complex and compound triggers. The statement becomes "If thing 1 or thing 2 happens and this other thing is also true but thing 4 has not happened, do a whole bunch of other things.”  I use a Level 4 automation to set my home’s mode to “away”. It goes like this: If all of my motion sensors have been inactive for 30 minutes and all of my presence sensors are not present, set the mode to to away. If any presence sensor becomes present or any motion sensor detects motion, if the time is before sunset set the mode to home, otherwise, set the mode to “night”. You can see the multiple conditions and nested “if”s in that statement. But once that is set up and working properly, I have a reliable mode indicator that allows me to change my thermostat settings to energy saving mode, turn off all the lights the kids have invariable left on, and ensure that when we do come home, it's never to a dark or uncomfortable house. Now, our front door example can be enhanced even further. If there is motion at the front door and my presence sensor has just arrived and my wife’s presence sensor is present, announce “Honey, I’m home”. If my son’s presence sensor has just arrived and it is after midnight, announce “We’ll talk about this tomorrow” and send me a reminder to actually do that.

WebCore routine
NodeRed Flow
Most popular hubs support these complex, Level 4 automations. SmartThings uses a smartapp called WebCore which looks a bit like a programming interface. It looks much more intimidating than it actually is, the routine on the right was built entirely with a point and click interface. Hubitat works with WebCore as well but recommends using their own tool called Rule Machine. Many Home Assistant users build their complex automations with a tool called NodeRed. No matter what hub you use, it pays to get comfortable with and then master the level 4 functionality your hub offers. It often means the difference between an automation that sometimes works and one that always works.

What cool, complex automations have you built?

For real-time updates and notification of posts and smart home deals, follow us on Instagram at @HouseSmarty!

Popular posts from this blog

A Beginner's Guide to Smart Bulbs

Migrating Z-Wave Devices to Home Assistant

Please, Please, Please Do Not Disturb!