Main image of article Amazon Updates API for New Alexa 'Routines'
[caption id="attachment_143837" align="aligncenter" width="2469"] Amazon Echo Plus Amazon Echo Plus[/caption] In addition to several new pieces of Echo hardware, Amazon has announced a new feature for users and developers that will help make the ‘smart home’ even smarter. Amazon’s aim with this new feature, dubbed 'routines,' is pretty straightforward. With a simple command, users can activate a series of Alexa skills. Rather than having to say "Alexa, turn on the kitchen light," followed by, "Alexa, turn my temperature down to 70 degrees," a user could simply say, "Alexa, good morning" and trigger both actions. It’s not a new concept. Apple’s HomeKit has 'scenes,' which also allow users to string together one-off actions under an umbrella voice command. Alexa’s leg-up on HomeKit is that it can also read you news items or inform you about Amazon deliveries, and Alexa skills are easily woven into third-party software. HomeKit requires a much deeper level of integration for manufacturers, and developers are limited to the few categories that Siri is capable of working with. It’s unclear what may change once HomePod is released, but the existing HomeKit/Siri tandem leaves some gaping holes when compared to Alexa. Routines don’t necessarily require developers to re-tool Alexa skills. Amazon has updated its Smart Home Skill API so that routines can find their place. Three new or updated features – Alexa.Discovery and Capability Interfaces, Asynchronous Programming, and Proactive State Updates – all serve to make routines easier and more contextual. [caption id="attachment_143839" align="aligncenter" width="954"] The Amazon Smart Home The Amazon Smart Home[/caption] Alexa.Discovery allows developers to represent devices and functions supported via the new Capability Interface. As Amazon writes: “You can use capability interfaces designed specifically for smart cameras, entertainment devices, lights, locks and thermostats, or you can use broadly applicable primitives, such as the power and percentage controllers, for many other smart device types.” In a nutshell, this gives users a bit more granularity when it comes to triggering multiple actions, and developers the opportunity to contain actions to a limited set so as not to cause an app or device meltdown. Asynchronous Programming allows any cloud service to send messages to Alexa. Many 'smart home' hardware manufacturers choose to have their own cloud service (often to own the security stack); previously, developers had to run messaging through AWS Lambda. This will come in handy for points of failure, such as when a device can’t be reached. ‘Lock my door’ will simply return an error message when there’s a problem, not hang endlessly while a user waits for Alexa. State updates allow users to see the current state of their devices, which Amazon says has “low latency.” When users ask Alexa about their devices, or view them in the Alexa app, it will show them if lights are on or off, for example, or whether doors are locked. Amazon doesn’t offer any limitations here; so long as the device is Alexa-enabled, it should show up in this view. Amazon has a handy (albeit lengthy) migration guide for updating skills to the newest version of the Smart Home Skill API, which developers should read through. As the API is an Alexa one, it’s not dependent on new hardware; that makes it even more critical for developers who are invested in the Alexa platform.