No manufacturer of a smart device is likely to ignore the advantage of having Alexa support, but an increasing number do not provide an IFTTT interface or any other means that you can access them programmatically. To give an example, Nest thermostats have pulled their IFTTT support, but you can still issue commands such as “Alexa, set the temperature in the hallway to 22”. Wouldn’t it be nice to be able to do this from Apilio? So here is how you can do exactly that, for any action that Alexa can undertake.
The trick is to make use of a (currently free) service called Voice Monkey (https://voicemonkey.io/). Sign up for a free account, which links to your Alexa account. Now you can create any number of so-called ‘monkeys’, which are triggers that can be sent to your Alexa. You program Alexa to do anything you like when it receives the trigger, which you can even set to include any command that you would normally speak.
As an example, let me show how you can switch your Nest thermostat between heat mode and eco mode. The Alexa commands that you would speak for this are “Alexa set the [thermostat name] to heat mode” and “Alexa, set the [thermostat name] to eco mode”. To to do this:
- Create two monkeys on the Voice Monkey site called ‘Nest to Heat’ and ‘Nest to Eco’.
- In a few seconds, your Alexa will recognise two new devices (the monkeys are actually implemented as doorbell buttons).
- In Alexa, create a routine called ‘Nest to Heat’. For the ‘When this happens’ look under ‘Smart Home’ and select the ‘Nest to Heat’ monkey. Add a customised action, with the command string “set the [thermostat name] to heat mode”. Select one of your Alexa devices to implement the action (more on this later).
- Repeat similar steps to create a ‘Nest to Eco’ routine.
You can now test your monkeys on the Voice Monkey site (click the ‘manage monkey’ then use the ‘Trigger Test’ button).
If you have got this far, you will have discovered that the process works, but the Alexa device you have chosen will, unfortunately, speak to you to tell you that it has implemented the command. This is a side effect of the customised action—if you use commands that don’t involve a response (such as setting the colour of a light) that isn’t an issue, but the more powerful customised action does have this drawback. However, we can get around this.
To get around the nuisance of Alexa talking to you when you issue a customised action, do the following:
- Edit your previous Alexa routines, so that before they perform the customised action, they set the device volume to 0
- Create a third monkey called ‘Reset Volume’
- Create another Alexa routine called ‘Reset Volume’ that is triggered by the ‘Reset Volume’ monkey, and is set to put the Alexa back to your standard volume (4 or 5 works for me)
The whole process therefore becomes one of activating the ‘Nest to Heat’ (or ‘Nest to Eco’) monkey, then waiting a few seconds (5-10 seconds seems to work) for the command to implement before activating the ‘Reset Volume’ monkey. This does mean that your selected Alexa will be silent for a few seconds—if this is a really big deal then you can always buy a dedicated Echo Flex that you use for this (all of £10, so it will hardly break the bank).
So how do you make these calls from Apilio? That, at least, is easy as there is a direct webhook interface for Voice Monkey. See https://voicemonkey.io/docs, but basically you just make a webhook call from Apilio with the appropriate parameters set up. The good thing about doing this via Apilio is that you can easily set up a logicblock that includes two webhook calls, the first to set ‘Nest to Heat’ (or ‘Nest to Eco’), followed by the ‘Reset Volume’ call that is delayed by 5-10 seconds.
Hope this is useful for you all