node-RED for connecting Amazon Echo-devices to openHAB

And how can I make it activate at startup in case of a reboot ?

If you kept the Item names, nothing should have changed, it should work as before.
If you did not use that before, you will find examples in the Amazon Echo Control Binding docs.

I am using text files, that would look like this for routines:

Item:

String Alexa_startRoutine {channel="mqtt..."} //your node-red routine channel

Sitemap:


Selection item=Alexa_startRoutine mappings=["NameOfRoutine"="SitemapEntryForRoutine", "NameOfAnotherRoutine"="SitemapEntryForAnotherRoutine"]

The speak and volume functions work fine, but I’m having a bit of trouble with how to execute a routine or send a text command (to start a radio, for example).
Is there something I’ve missed?

This is the message I get in the debugger after sending the name of an existing routine.

A quick note on the use of “Lastvoicecommand”, sometimes the keyword “alexa” is also returned in the item.

I’ve switched to the sonos-plus palette which is working great and gives me what i was looking for → send notifications to the sonos speakers

New Version is out (see first post). @Dom76 @martin1338

  • Routines are working now
  • lastVoiceCommand ist beautified (removed "alexa ")

Please feedback if errors occur (or if it’s working nicely :slight_smile: )
Thanks @binderth , @sihui for the support :clap:

3 Likes

Ok :+1: , I’ll test all that tomorrow.

Update on the new version:

-Speak > still works
-Set Volume > still works
-Set Speak volume > still works
-Announcement > no longer works and returns an error
-Run Routine > no longer works and returns an error
-LastVoiceCommand > no longer works
With the previous version:

-Announcement worked but always launched the first sentence sent.

-Run Routine worked but always launched the first requested routine.

-LastVoiceCommand worked but sometimes also returned the keyword “alexa”.

That’s all for the updates.

Sorry, but after several tests on all my Echo devices, I can confirm that “LastVoiceCommand” works much more erratically than in the previous version.

Regarding “TextCommade” announcements, I no longer get an error, but it still doesn’t work.

Run Routine , It works, I wasn’t using the correct name. My mistake.

Hi,

I’m using the first version and it works very well!!

Thank you very, very much!

:clap: :clap:

thanks for sharing, @Larsen !

For me lastVoiceCommand and speak still work like a charm.

Regarding “routine” it’s not working. There is no error shown, but my Echo Show 2 just is doing nothing.

For reference and analysis, this is the debug output:

→ all IDs lgtm but nothing happens on the Echo.

But now, after your input and impulses I extended your Dynamic Router with 2 more cases to execute my Alexa Routines. My config looks like this:

And the output after execution is as follows (just one command, the debug after 8 sec is coming from Alexa itself (in the debug you can see what my alexa routine is actually '“Öffne my page…”

so for me, everything is working. Thanks a lot. If i can help anyone in any way regarding more details, let me know

For me the “routines” work. It might be a problem with the spaces in the names of echo devices. The spaces in mqtt topics at least look strange to me. Node-RED is known to have problems with that (but I didn’t test it). Try an echo without spaces. It doesn’t matter which one you choose anyway.
I updated “announce” so that it works now too.

1 Like

Hi,

I’m not able to setup the steps - getlastvoicecommand and output to mqtt - can you share the settings of the function and the mqtt parameter please.

many thanks

Christian

When I send a command with “announcement”, my Echo device does the same thing as when I send a command via “Speak” but doesn’t execute anything. What is the correct usage method?

Sorry, but I don’t understand exactly what you’re missing. The whole process is very well explained in Larsen’s first post.

Well, that’s just what an Alexa-announcement is: The same as speak but with a nice ding-dong at the beginning.

1 Like

Ok, I understand better now.

Actually, what I’d like to be able to use is the “TextCommand” function, which simulates a voice request by sending text. I used it, in particular, to launch various radio stations and then return to the home screen of the Echo Show.
Is it possible to do this? And if so, how?

possible, of course. Just check the code in the applestrudel-node in github.
But it’s not worth the effort as the Amazon binding is on it’s way…

Good news.

For my own knowledge, could you guide me on how to integrate “textCommand” into Node-RED?