Extending Cortana’s reach with If This Then That | Artificial intelligence
The Internet of Things is, to be blunt, fragmented. Device A really should control Device B, but because there’s no relationship between their manufacturers you’re left unable to trigger your central heating from your garage door opener, or to turn on the porch light when someone rings the doorbell. Then there’s the proliferation of apps you need to control things: one for your lights, one for your heating, one for the plugs, one for…well, the list goes on.
Apps on your devices are one answer, but you need to have a phone in your hand, or a laptop on and ready to go, which can be awkward if you’re carrying something and need to turn on lights or change a setting. That’s where voice recognition from systems like Alexa and Cortana come in handy, as they’re able to give you hands-free access to your devices and services. Or at least that’s the promise.
In practice, you’re limited to the devices and services that your device is partnered with. That’s fine if you’re using popular products like Hue lightbulbs or a Nest heating controller, but less useful if you’re using devices from other manufacturers or if you live in a geography where those services might not be available.
In the race to deliver machine-learning powered personal assistants, Windows Phone’s Cortana was an early starter and made a quick move to the desktop. But it’s now lagging both Amazon’s Alexa and Google Home and needs to find a way to catch up. Compared to Alexa, Cortana’s list of supported Connected Home services is very short indeed.
With hardware vendors supporting the most popular services first, and focusing on popular smart speakers like Amazon’s Echo, it’s not surprising that Cortana lags behind, with its Harman Kardon Invoke speaker still only available in the US. So how can Microsoft take its devices’ IoT capabilities beyond its current partnerships?
If This Then Cortana
The answer could be quite simple: Microsoft recently announced Cortana support for a service that offers to build your own IoT controls, using Cortana as an input trigger for If This Then That (IFTTT).
I’ve been using IFTTT for a long time now. It’s a simple way of connecting two APIs together, using one as a trigger and another as an action. You don’t need to know how to code to automate actions, and the available combinations of triggers and actions are surprisingly flexible. They’re not only for IoT — I’ve got one that takes Instagram posts and delivers them to Twitter, for example, and another that will send me a SMS if my home fire alarm goes off.
Adding Cortana to your IFTTT account is simple enough. All you need to do is choose it as a trigger — the ‘This’ in IFTTT’s simple web-based development platform. You’ll be building it into what IFTTT calls an applet, which can be managed from the IFTTT website or through its Android and iOS apps. You’ll need to sign into the Cortana-IFTTT integration with your Microsoft account, and once you’ve made the connection Cortana will be available for any new applets you want to build.
Currently IFTTT’s Cortana integration is one-way: using Cortana as a voice-activated trigger for your applets. You can set up a mix of key phrases and numbers, with Cortana able to pass specific keywords and values through IFTTT to other APIs. This will allow you to, for example, choose a room and set its temperature, or to trigger a specific device if several similar devices are attached to an account.
IFTTT offers a wide selection of different IoT endpoints, well beyond the 12 currently provided by Cortana’s Connected Home skills. That allowed me to connect it to a Netatmo heating system and to a set of D-Link smart plugs. While Netatmo didn’t give me the room-level control I get from its own app, I could use Cortana to switch it between different heating modes for the whole house. The D-Link mydlink APIs were more powerful, and I could set up voice control for both the devices I had in my network, with an applet to turn them on and another to turn them off. Neither D-Link nor Netatmo offer Cortana services, so using IFTTT was the only way to extend.
SEE: How we learned to talk to computers, and how they learned to answer back (cover story PDF)
One thing to note: although Cortana’s IFTTT triggers let you declare variables to handle names and numbers, very few of the IoT actions support variables, so you’ll have to create specific applets for specific devices. While that may seem to be a significant issue, in practice it isn’t. That’s because it takes so little time to set up a new applet, once you’ve got one working. If IFTTT offered more complex program flows, then yes, it might well be a problem, but with simple trigger/action pairs it’s often easiest to set up a specific applet to cover a specific use case. All you have to do is remember your trigger phrases for each applet.
If the device you want to use isn’t supported by IFTTT you still have options, as IFTTT has tools that let you take it outside its ecosystem. It now offers a Maker service that lets you use it with webhooks, both as triggers and actions. These allow you to trigger your own custom hardware, if you’ve been building IoT tools using Raspberry Pi and platforms like Node-RED. The same techniques often work with IoT platforms’ public APIs, or can pass information from IFTTT to other, more enterprise focused, automation tools like Zapier or Microsoft’s own Flow.
As you can add payloads to webhooks, you might want to use Cortana’s text and number actions to send data to APIs. There’s also the option of feeding data from IFTTT webhooks to, say, Microsoft’s Flow and using its flow control structures to handle more complex actions. It would even be possible to use additional incoming webhooks to trigger different actions on IoT devices with IFTTT support.
There’s a lot that can be done with IFTTT, beyond working with IoT devices. You’ll find support for Office, for blogging platforms, for social media tools — even calendars and other common business tools. It’s a platform that adds a lot more scope to Cortana than you might initially think, giving you a large canvas on which to build your own Cortana skills. IFTTT also lets you share those skills with friends and colleagues.