Alexa Automation Guide

Amazon’s Alexa has become more than just a voice assistant, having grown into a popular, and somewhat functional home automation platform. This is thanks to easy developer access to add new devices and services through Skills, and Amazon’s continuing enhancements to Alexa’s capabilities with things like Alexa Guard, Hunches, and the addition of hardware support for smart home protocols like Zigbee in their Echo devices.

This guide will look at the broad categories of home automation rules (called Routines in Alexa), what can be done with Alexa, and how we can get the results we need to make our smart homes work better using this platform.

Automation Rule Basics

Smart home platforms implement rules in different ways, but they generally fall into some broad categories, not all of which are supported by every platform. These can be classified as:

Trigger Actions (if A then B)

See How to Create Triggers

The most common automation type, and indeed the basis of the platform IFTTT (If This Then That). One input is used to trigger another action. The input can be a device control event (a device did something), a sensor event (motion, temperature, light level etc), a schedule event (a fixed time or date), or a geofence event (someone arrives or leaves a given location). Alexa supports all of these to some extent.

Conditional Actions (if A and B then C)

See How to Create Conditionals

An extension of the above with the ability to define filters that must be passed before the actions will be performed. The filters are similar to triggers being device state, sensor thresholds, geofence presence, time and date. If conditions are supported, more than one can typically be combined with AND and OR options (all conditions, or any one of the conditions). Alexa supports time and day-of-the-week conditions only.

Delay Actions (if A then B after X mins)

See How to Create Delays

Actions can be delayed by a given time interval before being performed. This can be as an overall capability allowing the entire rule to be delayed up front, or it can be a delay to undo (or turn off) the actions after the fact. Alexa can handle both with some limitations.

Stacked Conditionals (if A and B then C while/until D)

See Stacked Conditionals

This extends conditional rules to include exceptions and limits. These can be loosely defined with terms like while, unless, and until. Some uses of this kind of rule include things like seasonal changes, and manual overrides which can make your home a lot smarter and avoid some of the frustration that can result from inappropriate automatic behaviors. Alexa’s lack of conditionals makes this a challenge.

Now we know the kinds of things we could do, let’s look at how we can accomplish these in Alexa and what the limitations are.

How to create trigger actions

This is essentially how all Alexa Routines work, but where Alexa differs from some of the competition is in the number of trigger types there are to choose from. You can trigger a routine from a custom voice command, a set time schedule, a smart sensor, geolocation, cancelling an Alexa alarm, pressing a Echo Button (if you have one), or when the Alexa Guard security feature is switch between Home and Away. A new feature is being added to allow an Echo device to detect certain sounds as triggers as well, such as a baby crying, or the beep of an appliance.

To get started, tap on the More option at the bottom of the Alexa smartphone app, then tap Routines from the menu. On the Routines page Your Routines shows all the routines you’ve created, and Featured shows some typical suggestions you can use to quickly get something up and running.

Selecting Trigger, Action and the complete routine.

  • To create a new routine tap the + button at the top right.

  • Enter a Name for the routine that is meaningful to you (you can leave it blank and a name will be created for you based on the trigger you select, but this can get messy over time).

  • Tap Next in the top right.

  • Select the trigger to use on the When This Happens page.

Voice. With this trigger you type in the phrase you can Alexa to use. You’ll need to ensure it’s unique and can not be confused with something Alexa already does, a skill you have installed, or a smart device you have connected.

  • Enter the custom phrase.

  • Tap Next at the top right.

Schedule. Alexa allows the use an automatically determined Sunrise or Sunset time, or a specific time and day of the week. For the day you can choose Every Day, Weekdays, Weekends, or a specific day (but only one). For Sunrise and Sunset you can specify multiple days of your choosing, and an offset before or after sunrise/sunset to trigger, up to an hour either side.

  • On the Schedule page, select At Time, Sunrise or Sunset.

    • For At Time, select a day group or single day, then the specific time to run.

    • For Sunrise or Sunset, select the offset on the slider, and select the specific days you want it to run by tapping the buttons.

  • Tap Next at the top right.

Smart Home. This option allows you select a smart device connected to Alexa that you can use as a trigger. This is limited to simple sensor events like Motion Detected, or Door Opened, not values like light level or temperature, but can also be based off a state change, such as a light turning on.

  • Select the device from the list of available devices.

  • You may have a secondary selection depending on the type of sensor. For example a motion sensor allows you to choose Detected or Not Detected (for a certain period of time).

  • Tap Next at the top right.

Location. You can use your location data to drive actions based on you arriving or leaving from a specified location. You can enter any address to use for this, but it only works for the account holder, you can’t set up other household members. This makes it quite limiting from a home automation perspective and it’s more useful for personalized routines like checking appointments and playing music for your commute.

  • On the When This Device screen, select Arrives or Leaves

  • Enter the address to use, or select from the list below it.

  • Tap Next in the top right.

Alarms. This allows you to run a routine when a specific Alexa Alarm is dismissed.

  • Choose the Alarm to use.

  • Tap Next at the top right.

Echo Button. This allows you to use the purpose built Echo Button device, which is a standalone single button trigger you can place anywhere as a remote.

  • Press the Echo Button you want to use for the trigger.

  • Tap Next at the top right.

Sound Detection. This feature uses an Echo device to monitor for certain sounds that can trigger a routine. Amazon says no audio is recorded or sent to the cloud for this feature, it’s all processed locally.

  • Choose the type of sound to listen for. Currently this includes Snoring, Beeping, Cough, Water Sounds, Dog Barking, and Baby Crying.

  • Select the Echo device that will listen for this from your list.

  • Tap Next at the top right.

Guard. If you set up the Alexa Guard feature, you’ll be able to use the Home and Away modes to trigger actions. This could be used to make sure doors are locked and lights are off (or on) when you are out of the house, or similarly set up the house for arriving home.

  • Select Home or Away, when the state is changed to that mode the routine will be triggered.

  • Tap Next at the top right.

With the trigger selected, you can now create a sequence of actions to take which for the routine itself. The options here are quite varied, and range from having Alexa say a phrase through a smart speaker, controlling your smart devices, reading your calendar for the next day, telling a joke, running an IFTTT action, playing music, opening a skill, and many more. Simply choose from the list of possible actions, and specify any details specific to that option on the next page.

Once you tap Next at the top right you’ll be back on the New Routine page where you can add another action. You can add as many as you need, and then arrange them in the order you want by dragging them up and down the list using the handle on the right of each one.

If any of the actions need voice output, you’ll need to select a device to use for that at the bottom of the page before you can tap Save to complete the routine.

How to create conditional actions

Conditional rules are a powerful tool in making a smart home a lot smarter. These types of rules are a key part of more advanced smart home platforms, and is an area where Alexa currently falls flat. Alexa routines have limited support for this in that any routine can be time constrained. In other words, you can make a routine conditional on the time period and day of the week.

To do this, once you have added a trigger in the new routine:

  • Tap Change next to Any Time under the trigger.

  • On the Set Condition screen, select the days to run this routine (all of the days are selected by default).

  • Specify the time period it will be allowed to run using the Active Between fields.

  • Optionally specify the Suppress For duration, which will prevent the routine running again for that period of time, up to 12 hours.

Beyond a single time constraint, more advanced conditions will need you to use another smart home platform that can be linked to Alexa. IFTTT could be used to do this with their Pro subscription as it supports multiple conditional actions, and Alexa can run an IFTTT applet as an action. The applet could then perform additional checks, depending on which devices and services you have connected to that platform.

Other platforms that offer advanced conditional rule creation and can be used with Alexa include SmartThings, HomeSeer, or Home Assistant, to name a few. In any of these cases you wouldn’t be using Alexa routines to drive your automation rules. These are fully fledged smart home platforms intended to run your smart home instead, so they’re beyond the scope of this article.

How to create delay actions

While some triggers have a kind of delay, the time period of no motion being detected for a motion sensor for example, the main wait to delay things with Alexa routines is with the Wait action.

The Wait action can be inserted into any routine’s action list and will cause Alexa to wait there before executing the next action in the list. Wait can be any time value up to 4 hours, and can be used for simple home automation actions such as turning on a light for a fixed time period, or spacing out two related sequences of actions.

Let’s take an example from my own home, where I have a good night routine that shuts down the house at bedtime. I usually execute this by voice command as I head to bed, but doing so would plunge me into darkness. Instead, One of the good night tasks is to turn on a hall light that leads to the bedroom at a low level so I can find my way there. Wait is then inserted into the routine for 2 minutes followed by an action to turn that light off.

There are many other cases where two related actions can be separated by Wait in the one routine. A morning routine could wake you up, set up the lights and then wait for 10 minutes before starting to read the morning briefing in the Kitchen, or a door sensor could trigger and outside light which then waits for 15 minutes before turning it off again.

It’s a simple thing, but can prove very useful in making routines more effective.

Time conditions, the Wait action, and an example

What About stacked conditionals?

While there can be ways to implement this kind of behavior even without explicit complex rule functionality, Alexa lacks even the basic triggers and conditional elements needed to do so.

To do this would need more robust conditional capability, including the ability to check the state of smart devices, the presence of household members, and to combine more than one condition for each routine. With these added features, you could stack routines to be dependent on one another to create complex rule scenarios, even without explicit WHEN and OR capability.

Alexa’s skill framework is a bit limiting in this regard as it doesn’t allow Alexa to expose all the internal state values of smart devices without a more structured device definition approach, but the state data Alexa does have available would be a good start.

Conclusion

Alexa has come a long way since it’s initial introduction on the original Amazon Echo. Not only has it grown into a powerful voice assistant, and even companion for some, it’s smart home capabilities continue to grow along with it. We now have more triggers and many more action types that can be employed in routines, and these options provide a great deal of scope for useful and interesting automated activities.

Even with these improvements, though, Alexa lacks some key functionality that puts other smart home platforms ahead when it comes to truly useful automation rules. Key among these is a distinct lack of conditional filtering, which allows for a much needed control over when a routine should be run.

Without this capability we can’t have things like override capability to ensure routines don’t run when we don’t want or need them too, more control over variations of routines for different circumstances, and the ability to create more complex, fully automated behaviors based on conditions in the home.

Amazon’s work on the Hunches feature aims to fill some of these gaps by learning and taking actions it thinks make sense without user input, but it will take a long time before this alone can replace designed automation rules that do the specific things we want under the right conditions.

David Mead

David Mead is an IT infrastructure professional with over 20 years of experience across a wide range of hardware and software systems, designing and support technology solutions to help people solve real problems. When not tinkering with technology, David also enjoys science fiction, gaming, and playing drums.

Previous
Previous

How to Turn Off Annoying Command Responses on Your Google Home

Next
Next

Hey Siri, how should I name my devices?