More Alexa Marvels

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!!!


32 thoughts on “More Alexa Marvels

  1. It’s definitely the right one. Every other option works fine, except that one – it insists on outputting a ‘current temperature request’, despite the correct ‘utterance’.

  2. Good to have you back Pete…

    Not wishing to hijack the topic, but hoping to tap into the vast experience and knowledge here. Several people have referred to “node-red-contrib-alexa-home-skill” – has anyone else had a problem with the ‘GetTargetTemperatureRequest’?

    Using the recommended ‘sample utterance’ of “Alexa, what is the device name set to?”, the input node continually fails to output a ‘GetTargetTemperatureRequest’, instead, it outputs a ‘GetTemperatureReadingRequest’.

    I’ve tried talking to the author, via the Slack Community, but he insists it works fine for him.

    It’s not Alexa misinterpreting what I’m saying – the app shows ‘Alexa heard’ as being exactly what I intended to say (e.g. “Alexa, what is bedroom one set to?”).

    Does anyone have any ideas?

      1. Thanks Steve

        It’s definitely checked, but I’ll try your suggestion of deleting and reinitialising when I get home.

        1. One other possible way a fault can occur is to make sure the account you are interrogating with node red and setup on the device page is actually the account being picked up by Alexa when you ask her to discover devices. I have two accounts with the Alexa Home Skill and other devices coming from HAbridge among others, and I have had some glitches when similarly named devices are discovered by Alexa at cross purposes to what I intended.

          1. Right…
            Got home, deleted the device on the setup page.
            Deleted the input node in Node-RED
            Asked Alexa to discover devices
            Recreated the device and saved it
            Opened it and checked that all the correct boxes were ticked
            Waited a while and asked Alexa to discover devices
            Recreated and connected the node in Node-RED
            Refreshed the device list, saved the node, deployed the flow
            Asked Alexa to discover devices
            Asked Alexa for bedroom one on/off/set temp/up/down/get temp – all good
            Asked Alexa “what is bedroom one set to?” and she replied with “Bedroom one temperature is nineteen degrees” – wrong answer
            The node continues to output:
            topic: “”
            name: “Bedroom One”
            _messageId: “4af3fa17-d72c-4c71-a3a9-f756ddfb3d3b”
            _applianceId: “20753”
            _confId: “6a3ab558.26c8dc”
            command: “GetTemperatureReadingRequest”
            extraInfo: object
            _msgid: “b72ba47b.621708”

            Have I missed anything???

            1. I changed the name to lower case everywhere and it now works!!!


              Thanks folks

  3. hello Pete

    nice to see you starting to get into things again. Just take your time. It took me 3 months to be able to walk more than 30 mins.
    I was having problems with node-red-contrib-alexa-local. I had over 30 switches.
    The problems increased with the ammount of switches To make matters worse my sons wife is Italian, we live in Germany and my son has a slight German accent.. I am a Scot so perhaps I have an accent to. Anyway I was just in the process of showing Alexa the exit door, when I spotted a rewrite of the node :
    node-red-contrib-alexa-home 0.3.4 which is the
    Rewrite of node-red-contrib-alexa-local to use a defined port range and also minimize the number of open ports – just 1 bridge is used for every 25 devices. Maybe everyone has updated to already, but if not I suggest you try it. From being
    at least 50% failure on the green ‘sh….t’ she has for the last hours been 100% right on the ‘green shed’

  4. Good morning!

    Inspired by your great blog, I tried the cool local Alexa-node. At first glance everything worked perfectly. But then I came across a problem.

    Obviously, Alexa sends depending on the status Alexa assumes for the addressed node. I have described this in detail as an issue here:

    Is the problem known or is it a problem at all, or is the problem in this case sitting in front of the screen?



    1. Okay. As mentioned by tomsk31 on Git-Hub, I was right. The node returns static values. I’ll have a further look to the source to change this behaviour, unless the developer himself will care about this issue.

      1. And finally, torinnguyen replied that it was his intention to always return the default values to Alexa. This has to do with the functionality of the node and seems to be necessary.
        In this case, I will not follow it up, because I don’t really need the Alexa app anyway, as long as the voice prompts do what they are supposed to.

  5. No if we could just get Alexa to recognize the “OPEN” and CLOSE” keywords with this. I am thinking garage doors, or blinds/shutters, or heck, even doors. I am sure it could be done, but way above my coding skills at the moment.

  6. Wow – this is a deal breaker!
    I didn’t want to flash my sonoff devices until I could be sure that I could still control them using Echo without too much hassle!
    Now I can really plough on with a node-red/sonoff/esp8266 strategy.

  7. Everything was working great but at some point today my echos can no longer discover my devices using this node anymore.
    I’ve restarted node red, had Alexa forget my 5 devices, rebooted, etc.
    But no joy.
    Anyone else seen this behavior? Hopefully it’s just temporary.
    As an aside, the esp devices I’ve been controlling with this are:
    12v pwm controlled bedside reading lamp. It was simple to get the dimming to work.
    4 120v SSR controlled power outlets.

    Previously I controlled all these devices using an iPod app using the NetIO tool.
    BTW – that control still works Ok.

  8. I stopped using ha-bridge in favor of this node. 300+ MB freed from Raspberry Pi 3.

    I am using it to control X10 lights and turn on/off TVs using IR leds controlled by ESP8266. Other TV command using my own Alexa skill.

    Thank you.

    I also saw node-red-contrib-wemo-emulator. Works good too.

    1. Hi Juan, what do you use as the X10 interface. I use Heyu with Firecracker but am looking for something I can use on an esp8266.
      I too have started using this node instead of HA-Bridge. Good find Peter!

      1. I use a program I wrote in C language, communicating with CM11A Serial Computer Interface. Initially it was used just to receive motion sensors information and send SMS to my cellular phone. Later, I added functionality to turn devices (Lamps, wall switches, and appliance modules) on/off/dim from Node-red. Communication between Node-red and my program is using UDP.

        Good idea about using ESP8266 to interface with CM11A. Communication between Node-red and ESP8266 could be MQTT for flexibility. The only issue here is that CM11A uses RS232 interface not TTL.

        I think you can still use firecracker with ESP8266 (A lever converter 3.3 5V will be required) since Firecracker uses Microchip micro controller which is 12 volts tolerant (RS232 levels) but in fact works at 5 volts. You could give it a try. Do a google search for CM11A protocol.

        1. Thanks Juan, I may give that a try. I’m currently using RF to control Magicfly/Etekcity wireless outlets with Node Red and ESP8266/RF433. I’m hoping to use a similar setup with X10 transceivers and motion detectors. X10’s 310 MHz frequency has been a bit of a challenge.

  9. See updated blog – new developments including the ability to preset the percentage/brilliance value – which is really essential if you want things to turn on at a predetermined level and not 100%… or if you have external timers which might adjust settings outside of verbal control. This is coming along nicely.

    1. But hang fire as I didn’t get expected results… awaiting feedback. This is what I get – anyone experimenting may want to check

      Turn it on – value goes to 100, inject 45, nothing happens. Turn it off – the output value goes to 0. Turn it on – the value goes to 100.

      Surely that is not right – if you set a brilliance for a lamp – and turn it off – you’d expect it to go back to where it was when you turn it back on? Similarly heating – you’d not expect the heating to go to 100 when you turn it on.

      But this….

      Alexa – increase the temperature of big boy..

      That turned it ON at 100.

      Set input to 45 (inject input).

      Alexa – decrease the temperature of big boy…

      That set the value to 24

      That’s REALLY not right…

      I’ve put the above into GIT – awaiting feedback.

  10. I once again would recommend the Node Red Alexa Home Skill Bridge which is documented at They have recently updated it further so that now not only can you do the usual on/off/dim/unlock etc, you can query Alexa for the current thermostat setting and current temperature, you can also setup custom ranges and responses so that for instance you can get Alexa to respond “I can only set the thermostat to between 15 and 30 degrees” if you exceed the chosen range. But most recently they have added colour bulbs so you can request a colour or colour temperature and alexa will return a hue, saturation and brightness. Works very well, has been very reliable and is installed in seconds.

    1. Hi Steve

      I just went to the site and noted..

      Due to a failure on the 4th October all updates to the devices or new accounts created between 29th Septeber and 4th October have been lost. I appologies and I’m working to make sure it can’t happen again

      I’ve had a look here and indeed it does look flexible – but in terms of ease of setup – we’re not quite in the same ballpark there.

      I’ll give it a go.. Also presumably this only applies to US and UK readers – there are a lot of Europeans in here.

    2. Good morning Steve – I just took a look here and things are worse than I suggested… look at the fine print and some of the commands only work (according to Amazon) in the USA and that includes setting the colour – really the one reason that might’ve pushed some of us in the direction of that Node. Given the international nature of audiences to blogs like this – I really can’t suggest going down that route right now. Perhaps when Amazon get their act together and remember that there is a big world out there.

      1. The listed restrictions to the US are out of date and unless Berkshire has become the 51st state of the union recently I can vouch that all facilities work well in the UK. I can’t speak for Germany which is I believe the only other officially supported territory outside the US. But as you say given that Amazon have restricted availability of the Echo range both geographically and linguistically it does make any discussion re Alexa somewhat parochial.

        1. Hi Steve – well – UK is one up – and one I obviously favour – but of course I’m also aware that regular readers and contributors to this blog come from Italy, Germany and other European countries. Still – worth a play for those of us who are in the privileged countries. That loss of information announced the other day worried me a little and makes me wonder how resilient the server is on that this all sits on – we’re used to big companies having systems over multiple continents and if they go bust someone else takes over – but what happens when servers are owned by an individual, costing them money – and they lose interest. I guess that’s why I favour hosting my own logging graphics using Grafana – I log information for years and don’t want to find that the service is no longer available. And so it is here with this skill. Do we know how that service is hosted?

  11. Peter, if you are using Sonoff devices you can configure them to emulate a single Wemo device or a Hue Bridge. Alexa will then detect them directly and you can still control them over MQTT too.

    Agree that this Node is showing a lot of promise. I did try the early version and yes, it did crash node red.

    1. Hi Garry – yes I use the Sonoff devices all the time – and their ability to do this themselves is fairly new – but custom software has been around for a long time for these to do that.

      Personally I like to keep it all in one place where I can visually do updates…. and so until we get to the point where we can easily talk both ways to Alexa – preferably with all the faff of SSL connections etc etc – then this new node is looking good…

      Now the author is aware of the crash thing – it seems ok once set up anyway he’s looking at that and we’ve just exchanged communication about increase and decrease – I’ve suggested he could simply output + or minus instead of an absolute value as in Node-Red we’re probably passing the output of that node to our own function node ANYWAY which means we then get to decide for ourselves what increase/decrease to apply… I’m encouraged at the quick rate of return of communications which leads me to think this node could be a little winner real soon! The other point of course is that even people who use Sonoffs – use other stuff as well which might not be Alexa-aware – and this is an easy way to add them into the mix. My priority with devices is that they talk MQTT as I use that as my preferred means of talking to everything. Again, at the simplest level, MQTT is trivial to use.

      1. Hi Pete, totally agree, an exciting development. MQTT is also the only way that makes sense for me too. Using this node also allows the control of more than one device at a time too. I just tried the latest version and it hasn’t crashed node-red yet.

        I did go down the SSL route too, writing skills on the Alexa Dev platform. It’s been a very rewarding experience and does let you program some meaningful responses using Alexa, but just to turn on a lamp it is extreme overkill!

        Exciting times!

        1. We spent ages on that, Garry and I could have Alexa say whatever I wanted. We arranged things so that Alexa simply interpreted the spoken word and sent what it thought was said back to us. A simple parser then took care of that – I had two problems, Alexa would substitute any near enough valid word… so you can’t rely on it sending back “Turn the brown light on” – it could return “turn the round light on” or anything sounding the same. My other problem was – while seeing the benefit of SSL, I cannot for the life of me see the benefit of INSISTING on port 433 – which is what Amazon do – and my service provider in Spain reserves that port for debugging the WIMAX connectio – so no chance of having incoming 433 without a lot of faff – I’m really hoping that overall, ultimately Google get their finger out and give us a better solution – for now – this node is looking like a decent one way solution – that and of course, HA-Bridge which again I use with MQTT.

Comments are closed.