Node Red Alexa Remote2

To give this set of nodes their full title, the offering is known as node-red-contrib-alexa-remote2 and has VERY recently been updated.  For those of us who’ve been struggling controlling our home devices with various custom packages recently, the best option over the past few weeks seems to be node-red-contrib-amazon-echo - it works well – I’ve blogged about it and so have others, but it always helps to check out alternatives.

And along comes THIS – read the link I just gave you. I’m still struggling figuring out what exactly to do with is – here’s where I’m up to – everything seems to work – as in – I’m not getting errors. Read this blog to avoid the timewasting I did this morning. If you;’re ahead of me, please DO comment or email and let’s make this blog entry an informative took instead of a puzzle.

Ok, so, prerequisites, you should have a device/gadget running a recent Node-Red, let’s say a Raspberry Pi 2 or 3 or 4. You should have an Amazon Alexa device – I have a DOT version 3.

You might want to turn things on and off as a starter… I do that all the time but I’ve not gotten that far with node-red-contrib-amazon-remote2.

Using the Node-Red”Manage Palette” command (top right) install node-red-contrib-alexa-remote2.

Done. Now you have to configure it. That info is here: https://flows.nodered.org/node/node-red-contrib-alexa-remote2.

As the gave me trouble for a few minutes – I’ll give you an EXACT example. Drag an “Alexa Routine” 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 and have already played with devices. maybe real ones?

tmpB3AFSo, in this “account” dialog box, is a field for an optional name – I didn’t give it a name. Next is a dropdown box called “Account”. I created a new “account” called “test2”. In there is an “auth method” 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. I chose (at random) 3457. I left the “file path” blank as it is optional. “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.

imageI 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. Above, I put in the internal IP address of the PI was working on… so now, in my PC, in my CHROME Browser I could enter “192.168.1.19:3457” – 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:

image

I went back to Node-Red and back in “Edit Alexa Routine Node” dialog with my “test2” account, I entered the recommended text “Hello world”… and in devices, I  selected my existing real DOT called “office dot”.

image

And that is where I am up to – totally LOST. No errors – the nodes say “ready” as you can see.

image

I picked the “echo forward node for no good reason – as I was looking for a “devices” node to create a new dummy device who’s output I could connect to a REAL device to turn it on – i.e. one of my ESP8266 boards I control by MQTT protocol. No such luck.

I was expecting some kind of node so  I could create a “virtual” device called, say “fred” and turn it on and off, the output of which I could feed via, say, MQTT to some real device. I’m sure you must be able to do this – but I’m not at that point yet. Over to readers. I’m sure it is obvious?

Facebooktwitterpinterestlinkedin

19 thoughts on “Node Red Alexa Remote2

  1. I read your blogs avidly and this one really got my attention, i have had a short play with this on my own setup this morning. Im am very excited about that this node can do!!. it appears to be able to open up the whole system at lot more than previous nodes. In the short time i had, i was able to connect to my Mihome alarm sensor and send verbal notifications to any echo device plus, a text notification to my phone. i used routines on the alexa app and set up a trigger word, using the on device activity node for feedback im able to filter out that trigger word to activate my devices. im no expert here, but i hope that helps.

    1. So, making as few assumptions as possible do you want to show us exactly what you did? Rightt now I’m clueless as to how to proceed. Meanwhile of course I have node-red-contrib-amazon-echo telling a device “fred” to turn on and off – (simply by adding a device node eith the name “fred” and telling amazon to search for devices). The 1.0 outputs from the device node then go on via a simple function node to actaully turn something physical on and of etc. All of that (apart from colour, now sorted) was dead easy but I’m not quite picking up on what to do with this remote2 app (I don’t have any REAL Alexa compatible gadgets here – I just then go on to control them with MQTT – hence the mind-set..

  2. Ok, so I went to the examples page for the node and put the first one – a test jason flow called alexa speak. I put in the account I set up… on my phone the dahboard page came up, no issues – then I selected my office DOT – and in the other field put the text “hello how are you”. In Node Red that cause an “error: input response failed”. Back to square one?

  3. Here’s a sample flow that works for me. The inject is just sedning the default timestamp. The only config I did on the Routine node is to add “This is a test” to the “Text” field and select my config in the “Account field”.

    Once you deploy you should see a blue icon under the Routine node showing it’s connected. If not, you still have work to do. Oh, and it should show a list of available devices in the configuration page for the Routine node.

    You may have to initialize if this is the first time. I did that a few days ago and am now trying to remember how. I know it’s an inject node and an Alexa Init node but there was more to it. I went ahead and added my refresh cookie sequence to the flow below. That should keep it initialized once you get it started. Let me know if you need more help on it and I’m happy to try. I’ve learned so much from you I’d love to give back.

    [
    {
    “id”: “c8594bdc.1ed9d8”,
    “type”: “tab”,
    “label”: “Alexa Init”,
    “disabled”: false,
    “info”: “”
    },
    {
    “id”: “2f8ed8a3.db9a68”,
    “type”: “alexa-remote-init”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “account”: “a30831e3.1d09”,
    “option”: “refresh”,
    “x”: 280,
    “y”: 340,
    “wires”: [
    [
    “8d990367.02bd3”
    ]
    ]
    },
    {
    “id”: “115fefb1.f4dc”,
    “type”: “inject”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “topic”: “”,
    “payload”: “alexa”,
    “payloadType”: “flow”,
    “repeat”: “”,
    “crontab”: “00 12 * * 3,4,0”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 110,
    “y”: 340,
    “wires”: [
    [
    “2f8ed8a3.db9a68”
    ]
    ]
    },
    {
    “id”: “8d990367.02bd3”,
    “type”: “change”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “rules”: [
    {
    “t”: “set”,
    “p”: “alexa”,
    “pt”: “flow”,
    “to”: “payload”,
    “tot”: “msg”
    }
    ],
    “action”: “”,
    “property”: “”,
    “from”: “”,
    “to”: “”,
    “reg”: false,
    “x”: 480,
    “y”: 340,
    “wires”: [
    [
    “349f952d.0689fa”
    ]
    ]
    },
    {
    “id”: “349f952d.0689fa”,
    “type”: “debug”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “active”: false,
    “tosidebar”: true,
    “console”: false,
    “tostatus”: false,
    “complete”: “false”,
    “x”: 680,
    “y”: 340,
    “wires”: []
    },
    {
    “id”: “acc03fc2.39c2a”,
    “type”: “inject”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “topic”: “”,
    “payload”: “”,
    “payloadType”: “date”,
    “repeat”: “”,
    “crontab”: “”,
    “once”: false,
    “onceDelay”: 0.1,
    “x”: 160,
    “y”: 220,
    “wires”: [
    [
    “3ff3c45d.20249c”
    ]
    ]
    },
    {
    “id”: “3ff3c45d.20249c”,
    “type”: “alexa-remote-routine”,
    “z”: “c8594bdc.1ed9d8”,
    “name”: “”,
    “account”: “a30831e3.1d09”,
    “routineNode”: {
    “type”: “speak”,
    “payload”: {
    “type”: “regular”,
    “text”: {
    “type”: “str”,
    “value”: “this is a test”
    },
    “devices”: [
    “G090LF1073171DAP”
    ]
    }
    },
    “x”: 400,
    “y”: 140,
    “wires”: [
    []
    ]
    },
    {
    “id”: “a30831e3.1d09”,
    “type”: “alexa-remote-account”,
    “z”: “”,
    “name”: “Home”,
    “authMethod”: “proxy”,
    “proxyOwnIp”: “192.168.254.15”,
    “proxyPort”: “3456”,
    “cookieFile”: “”,
    “refreshInterval”: “3”,
    “alexaServiceHost”: “pitangui.amazon.com”,
    “amazonPage”: “amazon.com”,
    “acceptLanguage”: “en-US”,
    “userAgent”: “”,
    “useWsMqtt”: “on”,
    “autoInit”: “on”
    }
    ]

    1. Hi Terry – after changing the account to mine – and visiting my alexa account, all came up ready…. but on pressing that inject node – I got “Error: Response: input failed” again in the first node. Not having much luck here.

      1. I remember something similar to that when I tried “Speak at volume” instead of “Speak”. Don’t know what it means though or how else to sort it out unfortunately 🙁

  4. This nodes collection is great. I just want to share a use I made of it.

    I have some difficulties making my 13 years old doughter get up in the morning. She hears alexa’s alarm, but once stopped she continues sleeping. To avoid that, what I did was this:

    At 1:00 AM I get the list of alarms she has set on her Echo Dot and for the first one I add three voice messages she hears, two, four and five minutes after the alarm sounds. The messages tell her something like: two minutes later: “It’s time to get up”, four minutes later: “Come on I you are hearing this message it’s to late, get up now” and five minutes later: ” Come on , get up immediatelly. Your dad is comming”. I use SSML to create some s between text. Each message has higher volume than previous.

    I use cronplus node to fire messages.

    If none of those messages work I have to get up to awake her ;).

  5. Was going to give this a go, but I can’t install any nodes, says there is a permission problem. Using a Mac OSX, searched the net and found giving permission to the /.node-red which I did and have previously. Not sure what else to do?

    2019-09-29T04:45:19.838Z [err] errno: -13,
    2019-09-29T04:45:19.838Z [err] npm
    2019-09-29T04:45:19.838Z [err] ERR! code: ‘EACCES’,
    2019-09-29T04:45:19.838Z [err] npm ERR!
    2019-09-29T04:45:19.838Z [err] syscall: ‘mkdir’,
    2019-09-29T04:45:19.838Z [err] npm
    2019-09-29T04:45:19.838Z [err] ERR! path: ‘/Users/scott/.npm/_cacache/index-v5/b2/d6’ }
    2019-09-29T04:45:19.839Z [err] npm ERR!
    2019-09-29T04:45:19.839Z [err] npm ERR! The operation was rejected by your operating system.
    2019-09-29T04:45:19.839Z [err] npm ERR! It is likely you do not have the permissions to access this file as the current user
    2019-09-29T04:45:19.839Z [err] npm ERR!
    2019-09-29T04:45:19.839Z [err] npm
    2019-09-29T04:45:19.839Z [err] ERR! If you believe this might be a permissions issue, please double-check the
    2019-09-29T04:45:19.839Z [err] npm ERR! permissions of the file and its containing directories, or try running
    2019-09-29T04:45:19.839Z [err] npm ERR!
    2019-09-29T04:45:19.839Z [err] the command again as root/Administrator (though this is not recommended).
    2019-09-29T04:45:19.855Z [err]
    2019-09-29T04:45:19.855Z [err] npm ERR! A complete log of this run can be found in:
    2019-09-29T04:45:19.855Z [err] npm
    2019-09-29T04:45:19.855Z [err] ERR! /Users/scott/.npm/_logs/2019-09-29T04_45_19_840Z-debug.log
    2019-09-29T04:45:19.861Z rc=243

  6. Some of the built in help in the collection of remote2 nodes is not very helpful. The IP address configured is actually the IP of the broker which may or may not be the machine node-red is running on. My goal is to use Alexa to query devices such as what is the humidity and temperature outside? (from my MQTT weather station) or is the garage door closed? and Alexa would answer appropriately. I found a forum with an excellent example for configuring remote2 to have Alexa speak the text contained in an MQTT payload. The example is at https://forums.homeseer.com/forum/homeseer-products-services/cloud-service-integrations/alexa-smart-home-skill/1320858-alexa-tts-that-works-better-imho-than-the-solution-for-home-assistant

    1. Got it working. Just had to do port forward on the container.
      It was quite quick then I expected to get Hello World working.

      I would say add the name of the file (security consideration). This stores the credentials so that every time you deploy, you do not have to go authenticate again.

  7. I’m able to get the green “ready” on the AlexaRoutine node after using my server’s URL to retrieve the cookie. The problem I’m having (and had in earlier V3 releases) is that my AlexaRoutine node doesn’t allow me to change to a value other than “Speak” (there’s a dropdown, but when another value is selected, it doesn’t “stick”) AND I’m missing all the widgets below the Speak dropdown.

    Any suggestions?

    Node v10.15.3
    node-red-contrib-alexa-remote2 v3.2.8
    Node_RED v0.16.2.

      1. Yeah… I was afraid you might start with that. OK… I’ll give it an upgrade and then see where it takes me. Thanks, Peter.

        1. Be careful – updating to 0.20 is easy – avoid 1.00 as there was an issue with msg cloning – 1.01 is good so far but MAY require the odd node install – see node-red site and do an RPI-CLONE or similar first….

        2. Yep… I lost my UI along the way (restored my server to localhost) but it fixed the AlexaRoutine. And as a bonus, it compelled me to make the move up to v1.0.1 — so thanks, Peter 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.