node-RED for connecting Amazon Echo-devices to openHAB

Thanks, am now connected and in “ready” state. My mistake was that i reloaded configurations but it requires to re-run the command “docker-compose up”.

Next hurdle to overcome: get this message but where can i see/find the 5 devices which have obviously been detected?

18 Nov 09:10:43 - [info] Starting flows

18 Nov 09:10:43 - [info] Started flows

18 Nov 09:10:43 - [info] [alexa-remote-account:Amazon DE Account] intialising "Amazon DE Account" with the PROXY method and saved data...

18 Nov 09:10:43 - [info] [mqtt-broker:MQTT 192.168.1.137] Connected to broker: nodered-alexa@mqtt://192.168.1.137:1883

18 Nov 09:10:52 - [warn] [function:Filter + Store Echo IDs] Saved echo map with 5 entries

Found the required messages for better understanding within the Node-RED debug log. It works out know :smiley: . Many thanks to @sihui and @binderth !!! And i apologize again for questions which are probably strange for you experts.

2 Likes

Hi Larsen,

Thanks for sharing this. In general it works for me, but when I use the mqtt part I’m facing an issue with the interface between the “dynamic router” and the “Speak (tts)”-Routine. Not sure how to setup this node. Always receiving an error message (see below…)
To get more information I’ve placed an additional debug node behind the router… Maybe you can give me a hint?

The way node-red works (and I guess the dev of the node node-red-contrib-alexa-remote2-applestrudel did also) is, that you can inject variables to nodes, which then “auto fill” so to speak the node and it then can do, what it’s meant to do.
What you are doing is to pre-fill the node with already preset information (speak - regular - devices) all of that information is coming through the “msg”-object.

you have to delete the node and drag a new “Alexa Routine” one in its place. Leave it as is and only pick your amazon-account (Alexa Account) above and fill in a name (Speak TTS as ist was?), then try again.

Hi Binderth,

thanks for your quick replay, but that doesn’t “say” nothing at my device. If I got you right, I need a blank Alexa Routine with blank information fields. So I did, but after execution the “regular” and the topmost of my devices goes to the Devices-Field, but no sound indeed! The debug has no error message. If I fill the Text-Field with a different string, this will be spoken….
If I have oll fields empty on this node, the error will tell me: “no device”.
BR

H.

It’s hard to tell as you did not give much information on your setup. Both are external programs which needs to be installed in your environment.

If you are using openHABian:
install Eclipse Mosquitto from the menu
install Node-Red from the menü
then proceed as already mentioned above

If you are not using openHABian, follow the links in this post to setup Mosquitto and Node-Red for your environment.

Node-Red acts as a kind of “Binding”, Mosquitto connects that “Binding” to openHAB.

My setup is with OpenHABian, Eclips Mosquitto and Node-Red installed by config menu.
As already mentioned the Alexa Routine is working in general when injecting a string (e.g. msg.topic “sample text”) and populating the Node-Fields of Alexa Routine manually (regular, msg.topic, device)

But its not working with the mqtt-part even wenn the “Debug MQTT Raw”-Node and my “debug 1”-Node are showing korrekt information

that’s strange and yes, the developer of that node did it so, that if you paste the node via the palette it gets prefilled. I have no idea how to delete that (which larsen obviously managed to! :wink: ). But if you chose “custom” it should work.

your debug console shows the msg.payload for the “Speak TTS”-node has not the correct structure. I suggest you delete your flow and re-import the one from larsen in the very first post again. Then type in your IP and FilePath and start over again. In your editing stuff (mostly the Dynamic Router (global.echos) node) there was some mismatch happening.

thanks, the custom works perfectly. Will try to investigate why the Speak TTS doesn’t. I’ve reimported the flow this morning, already, but maybe I’ve not doing it in a correct way (I recall some messages I didn’t understand

This was working earlier but now Amazon is sending me a 2FA code which, after I enter it, takes me to a 404 messahe

I guess you are talking about the openHAB Amazon Echo Control Binding.
This thread is for a workaround, the Node-Red implementation of the Amazon account.

No, the Node-Red workround. It’s stopped doing it now (after logged into Amazon directly to check whether 2FA was turned on - it wasn’t)

Strange…
It’s working, but I did not a new authorization request recently.

I looked into it and it’s a little bit more complicated: The routines can only be called by ID. This means the names and IDs have to be stored in a global so that the mapping can be done when called. It’s probably the same as with die device IDs. Reading the IDs is done with the alexa-remot-other node with get automation routines. Something like that. But not today. Or maybe somebody wants do give it a try? If you think you’re not skilled in Node-RED? Me neither :wink:

I use Openhabian and Mosquito is already installed and used within OpenHAB with various MQTT applications.

I installed Node-Red but now I’m lost.

I don’t understand exactly what needs to be done.

After you did import the flow like described above double click both settings and adapt that to your environment:

That’s great! It works with all Echo devices.

I’m getting all the “LastVoice commands”.

Regarding “TextCommands”, how do I send them and trigger an existing Alexa routine?

1 Like