According to eMarketer, Amazon is expected to maintain a dominant 70-percent market share of the U.S. smart speaker market into 2021. It is no wonder that most smart home manufacturers have integrated Alexa voice commands into their platforms.
In addition, there has been a trend toward a voice-first approach for smart home control. The ease of use and low cost of smart speakers has led them to being installed in almost every room of a smart home at the expense of proprietary touchpanels, keypads, and wireless remote controls.
In spite of this, and the fact that each new generation of smart speakers has included improved audio quality, smart speakers are not the way that professional smart home integrators are providing homeowners with a whole-house audio system. The primary reason for this is the challenge of integrating them into the logic of a smart home.
I set out to find a way for professional integrators to use Alexa devices for a whole-house audio system.
The Evolution of Alexa Control
Alexa integration provided by smart home systems manufacturers has been a one-way street. Smart home commands spoken by homeowners are quickly passed along to the smart home processor/hub in a home so they can be acted upon. However, when the smart home processor/hub would like to, for example, turn off all the audio/video systems in a home because the homeowners have left and the home is unoccupied, sending a command to all the Alexa smart speakers in a home to stop streaming music has been a significant challenge.
Fortunately, there are now techniques to trigger:
- Shut down of audio playback on smart speakers throughout a home
- Shut down audio of playback on individual smart speakers in a home
- Playing a favorite audio selection or station on individual smart speakers, a group of smart speakers, or even all the smart speakers in a home
Setting Alexa Routines
Amazon has been steadily adding more, and more capabilities to Alexa routines. Routines are the equivalent of batch files or sub-routines in basic software programming. They allow a series of actions to be grouped together so they can be triggered with a single command.
Routines can be created using the Alexa app. I’m going to describe how this is done on the Alexa app running on an iPad. If you are running the Alexa app on a different device or platform, then the procedure may be slightly different. It is also important to note that the creation of Alexa routines is not supported on the Alexa web interface; you must use the Alexa app.
After starting the Alexa app, pressing “More” on the toolbar at the bottom of the Alexa app brings up a menu from which you can simply select “Routines”. The screen will then show a list of any routines that have already been created. Pressing the “+” button in the upper right-hand corner of the screen starts the process of creating a new routine.
There are three parts to any routine:
- The name of the routine
- How the routine will be triggered (“When this happens”)
- One, or more, actions that will be performed when the routine executes
The routine name should be something that describes the purpose of the routine. For right now, I’ll just focus on the actions that relate to the creation of an integrated whole-house audio system. Later, I’ll discuss ways to trigger a routine from a smart home processor/hub.
The basic assumption of using smart speakers as a whole-house audio system is that the vast majority of music selections will be made through Alexa voice commands. The reality is that this is just as easy for a homeowner as picking up a smart phone and using the smart home manufacturer’s app to select music or selecting music using a wall mounted touch panel. With that assumption in place, the primary functions that have to be performed using routines are:
- Stop music playing in a room when it isn’t occupied. This might be triggered by a standard occupancy sensor, when the rooms occupant leaves and presses a wall mounted keypad to turn off the lights in the room, or by an advanced occupancy sensing system, like RoomMe, that can identify the specific person in a room and can sense when the occupant of a room leaves and their presence is sensed in an adjacent room.
- Stop music playing throughout a home when the homeowners leave. This might be triggered by an integrated alarm system being armed in away mode, location sensing using the homeowners’ smart phones, or sensing that the homeowner’s smart phones have disconnected from the home’s Wi-Fi network.
- Play an individual’s favorite music when they enter a room using similar occupancy sensing as described above
Smart speakers are so energy efficient you may not think it is a big deal to leave them playing music, even when a room or the entire home isn’t occupied. However, ISPs are becoming much more rigid with their data caps. With people working from home and children spending more time learning remotely, Zoom meetings and online classes are forcing people to pay more and more for internet access. While streaming music doesn’t use nearly as much data as streaming video, being mindful of all data usage can be the difference of staying under a cap and having to pay extra monthly fees for exceeding it.
To stop music playing on smart speakers, either in an individual room or throughout a home in an Alexa routine is very simple, once you know where to find it.
After pressing “+” to create a new routine and pressing “Add Action,” select “Device Settings.” Then, under “Device Settings,” select “Stop Audio.” You will be presented with a list of Alexa smart speakers in a home as well as a selection for “All Devices” to stop music playing on all the Alexa devices in the home.
I am not sure why Amazon chose to hide this under “Device Settings” instead of simply including it as an option under the “Music” action. In any case, it is very easy to use once you know where to find it.
Similarly, to start music playing on Alexa smart speakers in a home, press “Add Action,” followed by “Music.” You will then need to enter the song, artist, playlist, or station that you want to play. You can optionally choose a provider, such as Pandora, and optionally include a timer that will shut down the music after a period of time.
Once that is done, press “Next” in the upper right corner of the screen. You will then be able to click on “Choose Device” and choose the smart speaker where this routine will execute and start playing the specified music.
If you want to play music on a group of Alexa smart speakers, then you have to take a different approach. First, you will need to define the speaker groups where you want to have music simultaneously play on in the home. For example, you might want a group called “Everywhere” that includes all the smart speakers in the home. You might also want a group called “Party” that includes all the smart speakers in public areas of the home. There is plenty of information available on how to define speaker Groups, so I won’t go into that here.
With your speaker groups defined, you can now create a routine that plays music using them. Use the steps outlined above to create a new routine. Then, press “Add Action” and select “Custom.” This allows you to execute any arbitrary voice command as if you spoke it to an Alexa smart speaker. You can, for example, enter the command “Play Stairway to Heaven Everywhere” assuming you have created a speaker group named “Everywhere.”
If you have a playlist or Pandora station that you like to use during parties, then this technique allows you to create a routine that could be triggered when a party button is pressed on a touch panel or keypad. That same button could also trigger a specific lighting scene and override the automatic setback on your thermostat so the temperature in the home isn’t set back when the party goes past your normal bedtime.
Now that it is clear how to create Routines, I’ll describe how to trigger them from a smart home processor/hub.
Triggering Alexa Routines from a Smart Home Processor/Hub
I’m not aware of any professional smart home processors/hubs that provide a way to natively trigger the execution of an Alexa routine. However, there are two ways to work around this limitation: mkZense or using a Hubitat Elevation Hub as an intermediary.
mkZense is a very inexpensive subscription service (only $5 per year) that provides the ability to trigger Alexa routines from smart home platforms. It was originally designed as an IFTTT service but has very recently expanded to include a simple https API. mkZense refers to this API as their “Direct Webhooks Feature” on their website using IFTTT’s Webhooks terminology.
The service is very easy to setup. Using the Alexa app, first search for a skill named “IFTTTrigger,” then walk through the process of enabling the skill and linking it to your Amazon account. There is a choice of a limited, free version of the service or paying the $5 annual subscription fee for the full service. Since the free version is limited to only three triggers and doesn’t include the ability to use the https API, you will need to select the paid version of the skill.
Once you complete Amazon’s payment process for the skill, you will need to go to the mkZense website and submit your email address (the same one associated with your Amazon account). mkZense will then email you your security token and the list of current IFTTTriggers associated with your account. If you have any issues with the setup process, mkZense provides a number of instructional videos on their website, and they were very responsive to my emails.
It is important to note that when you set up the skill, you will also have to select your location. Alexa has three endpoints around the world (North America, Europe/India, and Far-East/Australia) and mkZense simply needs to know which one to use. They don’t use this information for any other purposes.
Triggering a routine based on an IFTTTrigger is very simple. Simply, create a new routine, provide it with a name, select “When this happens,” select “Smart Home,” select one of your IFTTTriggers, then click “Save.”
Finally, you can choose any action you want, including playing a specific music selection on an Alexa smart speaker or group of speakers, stopping music playback, or any other action supported by Alexa routines.
There is one thing to note. By default, IFTTTriggers are named IFTTTrigger-1, IFTTTrigger-2, etc. You have the option to edit these when you first setup the IFTTTrigger skill. However, if you want to go back to edit them at a later date/time, then the only way to do this is to disable the IFTTTrigger skill and then re-enable it.
It would be much better if the ability to edit the trigger names was provided under the skill settings in the Alexa app. Users should use meaningful names for the triggers, so it is easier to maintain a smart home system over time. I doubt that many, if any, users will go through disabling and re-enabling the skill every time they want to edit the name of a trigger.
For Crestron programmers I wrote a module to easily trigger and IFTTTrigger from a Crestron SimplWindows program. The module can be downloaded from my GitHub here.
IFTTTriggers worked very well in practice. In fact, they only took around two seconds to execute on an Alexa device. This is certainly fast enough for a whole-house audio system.
Using a Hubitat Elevation Hub as an Intermediary
I’ve written quite a bit about using a Hubitat Elevation hub as a bridge to all people to integrate off-the-shelf Zigbee, Z-Wave, and IoT devices with a Crestron smart home processor. You can find the original article here. In addition, the Hubitat hub can also be used to trigger Alexa routines.
Alexa routines can’t be triggered by switches, dimmers, and other common smart home devices. However, they can be triggered by smart home sensors, such as a contact sensor. I developed the Crestron “Hubitat Alexa Virtual Contact Sensor Bridge” module to provide the ability to trigger an Alexa routine from a Crestron smart home processor.
The module integrates with a virtual contact sensor (one that doesn’t exist physically but is just defined as a “virtual” sensor using the Hubitat Hub’s web interface) on the Hubitat Elevation Hub that can then be used to trigger an Alexa routine. Detailed instructions for setting up the linkage between the Crestron smart home processor, the Hubitat Elevation Hub, and Amazon Alexa devices are provided in the original article.
Once the linkage is complete, an Alexa routine can be created that is triggered when the virtual contact sensor opens. On the Crestron processor, you simply open the contact sensor, wait one second, and close it so it is ready to be triggered again. The one second delay is necessary because I found in testing that the Hubitat Hub could get upset if messages were sent to it too quickly. Since that time, Hubitat has released a major firmware update that significantly increased the speed of the hub. I haven’t re-tested to see if this delay is still needed but it doesn’t hurt to include it.
Amazon Alexa Smart Speaker Options
Amazon offers three basic smart speakers.
The 4th Generation Echo Dot has a 1.6-inch front-firing speaker. While this certainly isn’t going to offer high-quality audio, it may be suitable for providing sound in a bathroom, laundry room, or similar space. And, like all the Echo speakers listed here, it has a 3.5mm line out connector making it ideal to route streaming audio into a listening room, or media room, audio system.
The 4th Generation Echo has a 3-inch woofer, dual front-firing 0.8-inch tweeters, and Dolby audio.
The Echo Studio has a 1.0-inch tweeter, three 2.0-inch mid-range speakers, a 5.3-inch woofer, and Dolby Atmos.
All of these speakers can be paired together to provide stereo sound and linked with the 100-watt Echo Sub that has a 6-inch woofer.
Limitations to Alexa Routines
The one limitation I have come across during my testing was when trying to control a FireTV cube from an Alexa routine. I could stop video streaming on the FireTV Cube but Amazon also provides the ability to turn off the TV that is connected to the FireTV Cube from a routine. I couldn’t get this functionality to work. This has been reported to Amazon and is being investigated by their development team.
Other than this one issue I haven’t found any reason you couldn’t create an integrated whole-house audio system using Alexa smart speakers.
Conclusion
With Alexa smart speakers already being deployed as voice control points around so many homes, their low cost and improved audio quality now make them a viable whole-house audio system option. In a listening room or media room with a separate audio/speaker system, the audio output jack on an Echo Dot can be used to add streaming music capabilities to the system for a fraction of the price of competing products, such as a Sonos Port.
Using the mkZense subscription service or a Hubitat Elevation hub as a bridge allows a smart home processor to control the audio playback of Alexa smart speakers in a way that was previously only possible with tightly integrated audio components, at a much higher price.