That’s node-red-contrib-alexa-applestrudel etc. – but the title was getting too long:-). This article is about Alexa-related “nodes” for Node-Red.
To give this set of eight nodes (seven visible) their full title, the original offering was known as node-red-contrib-alexa-remote2 and when I first wrote this blog entry in September 2019. The package had just been updated and was looking very promising. For those of us who’ve been struggling adapting Amazon Alexa to our Node-Red-based home devices with various custom nodes over the months and years, the best option for a while back in 2019 seemed to be node-red-contrib-amazon-echo – it worked well – I’ve blogged about it and so have others, but it always helps to check out alternatives. Now I use node-red-contrib-virtual-smarthome which is a single, easy to use node but I want more…
And along comes node-red-contrib-alexa-remote2 – last updated mid-2020 to get Alexa to say what you want – like a Tannoy I guess. A quick check of the ISSUES section of the GITHUB page for that project however will tell you that the author has gone AWOL.
I then moved to the compatible FORK of that project, a version called node-red-contrib-alexa-cakebaked that actually works in 2021 – well, it did until the June 7, 2021 update but read to the end), I’m slowly figuring out what exactly to do with is – here’s where I’m up to – everything I’ve tried seems to work but I have a long way to go. If you’re ahead of me, please DO comment or email and let’s make this blog entry an informative tool instead of a partly-solved puzzle.
Ok, so, prerequisites, you should have a recent Node-Red installation, on, let’s say on a Raspberry Pi 3 or 4 . You should have an Amazon Alexa device – I have various DOT version 3 devices and an Echo Show (one will do of course).
Using the Node-Red ”Manage Palette” command (3 horizontal lines – top right of the main node-red browser screen) I installed node-red-contrib-alexa-remote-cakebaked.
Now for some configuring:
I’ll give you an EXACT example: From the selection of new nodes drag an “Alexa Routine” node onto a nice new test flow (page) in Node-Red. In the right side of the “Alexa Routine” node’s “account” field, create a new account… that is a brand new setup, the only thing that will be real here is your Amazon account – more on that soon. I’m assuming you have an Amazon account for your Echo/Alexa and have already played with devices. maybe real ones?
There is a dropdown box called “Account”. I created a new “account” not bothering with a name. In there is an “Auth Method” field and I left that at the default “proxy”. Then there is a field for “This IP”. It defaults to localhost which would be fine if your PI had a browser, mine doesn’t. I changed that to “192.168.1.19” – the local address of my PI. Next is “Port” – which defaults to port 3456. Next is the “file path” which is option but if you don’t want hassle every time you restart Node-Red I suggest doing as I did and providing as path and filename for a new file that can be written to. I set the “refresh” field to 0 and “Auto init” and “Events” I left alone.
“Service host” I set to the UK-recommendation “alexa.amazon.co.uk” and “Page” to the UK recommendation “amazon.co.uk”. I set the “language” field to the UK-recommendation “en-UK”. I left the optional “User agent” blank.
I closed that lot and I noted something about putting the IP number and port into a browser – it didn’t say WHERE (i.e. on the Pi or a PC etc) so this is where I save you time maybe? My PI has no screen attached. So in the above, I put in the internal IP address of the RPi I was working on… so now, in my PC, in my CHROME Browser I could enter “192.168.1.19:3456” – Bingo.
On my PC in the browser, using the above link, I entered my real Amazon account and password and this dialog closed leaving a page in the browser saying this:
The “File Path” field above is to store the account info to save re-entering every time. I went back to Node-Red and back in “Edit Alexa Routine Node” dialog with my new “account”, I selected “speak” and “announcement” and entered a text reminder for some pills I take on a daily basis. In devices, I selected “Everywhere” – I could have selected one particular Alexa but I chose the lot.
By adding a normal INJECT node to the input, I set a schedule, once a day at 10am, to trigger this message and sure enough, my Alexas now speak that message once a day to remind me to take the pills.
And that is where I am up to.. No errors – the nodes say “ready” as you can see.
The only other node I’ve tried is the “alexa event” node set to that same account and “device activity” and I have that output going to a debug node…. So for example if I ask Alexa to tell the time, I see the full transcipt of that operation including my input.
All of this of course is just a tiny, tiny part of what these nodes are intended to do but that’s as far as I’ve gotten up to now. Next I want to create my own commands to a dummy device of my choosing, but no idea how to do that as yet. More as I figure things out and/or get helpful feedback in here.
Reader Tom Redmond pointed out another compatible node-set – same again but ending Applestrudel – I’ve not tried this as my Cakebaked install was working just fine – but at the time of this paragraph (June 12, 2021) the Applestrudel version was last updated 4 days ago. THEN I found out that Cakebaked was updated 5 days ago. Nothing like a spot of competition to keep things moving… thanks to both of these guys for their efforts – which brings me to my tests…
<speak> <lang xml:lang="es-ES"> <amazon:emotion name="excited" intensity="high"> Hola Maureen, </amazon:emotion> Buenos dias </lang> </speak>
You can probably figure out that the above fun test is supposed to say “Hola Maureen, Buenos dias” (or “Hello Maureen, good day” to my wife – that’s about the limit of my Spanish). I just checked – it sounds like “Olive Oil, Buenos dias”. Still, the idea is sound – for those struggling to do more than simple text (no I’m not a whiz at this) the node can handle Amazon’s “SSML”option giving you way more control over the sound, as for example making Alexa actually sound interested in what she’s saying.
SO – I upgraded my Cakebaked to the new version and guess what – it stopped working..
Let the race to the top begin…
SO – I followed the installation instructions HERE for Applestrudel – now WHERE did I get the idea it is called “apfelstrudel”?
Anyway – the Github Applestrudel instructions say:
node-red admin remove node-red-contrib-alexa-remote2 node-red admin remove node-red-contrib-alexa-cakebaked node-red admin install node-red-contrib-alexa-remote2-applestrudel
And at least for me that’s WRONG – for each line above, I get:
Not logged in. Use 'login' to log in. login: Cannot possibly work without effective root
And of course I NEVER install node-red nodes like that – so as user “pi” I went to my /home/pi/.node-red folder as usual and:
npm remove node-red-contrib-alexa-remote npm remove node-red-contrib-alexa-cakebaked npm install node-red-contrib-alexa-remote2-applestrudel
I then restarted Node Red with:
and guess what… back in business with my dodgy Spanish!! That’s IT – that’s ALL I did to change over, no reboots, no changing credentials etc., EASY but for how long will it last? I also dropped an issue to the Cakebaked guy (Jens A.) – for Applestrudel (Bernd Bindreiter) I could not find any “issues” section… but as it works….
By the time you read this I could be back to Cakebaked or ANOTHER fix – who knows!