Some of you may recall that in the dim and distant past, Aidan and I wrote a SKILL for Amazon’s Alexa – which let us do anything by simply passing the speech back to Node-Red… and we could sent text as speech to Alexa. Well, that relied on SSL port access and writing skills and… we’re still waiting for something easier and so without effort, that arbitrary response is still a little way off, but..
If you want REAL EASY - read on. (updated 13/10/2017)
So I’ve been using HA-Bridge alongside Node-Red and some MQTT to control devices around the house but today (and I mean TODAY) I have something easier.
Reader Antonio yesterday pointed me to a tweet by Nathan Chantrell who was writing about a new Node-Red node called npm install node-red-contrib-alexa-local
Well, I had to give it a go last night – failure – crashed my Node-Red and Alexa didn’t want to know about it. So started a series of communications with Torin Nguyen – the author of this node.
And I’m delighted to say I just got the latest version – 0.2.4 - and… it works!
This does NOT get any easier. Starting point here is a Raspberry Pi but basically, Node-Red on anything I guess.
I loaded up the node (as usual sitting in my /home/pi/.node-red directory and invoking the above chant).
I dropped two nodes onto the Node-Red desktop and gave them names “big boy” and “little boy”. I invoked the magic words to Alexa “Alexa, find devices” – and after the obligatory and INTENSELY ANNOYING advert for Philips crappy light bulbs, TWO new devices appeared on my network.
I kid you not – THAT easy. I had entered nothing more than names for these two nodes.
I said the following:
“Alexa, turn little boy on”
“Alexa, turn big boy off”
“Alexa set little boy temperature to 25”
and below – you will see the output sent to the debug window of Node-Red – note that I set the debug to show the WHOLE OBJECT, not just the payload. If you only want on and off - payload alone will do the job.
I should imagine the picture above paints 1000 words – 3 outputs with which you can do what you want. You could if you wish join a load of these to one function and extract “device_name” or send them off, each to their own function to do what you want – brightness and temperature both produce a change in “bri”
So on, off, set brightness to, set temperature to… all work.
Brightness up and down ALSO work but until recently there were some issues so you really DO need 0.2.7 version as a minimum. One issue was - what if for some reason the brilliance/temperature was adjusted externally - by a Node-Red timer for example - well, now there is an input to reprogram the value.. check out information here.
I still need some external logic for increments and decrements - and the fact that ON is 100% whereas to me, ON should be the last value you set!!! However all of that is do-able in Node-Red.. I look forward to the continued development of this interesting node!!!