Release Candidate and Support: Amazon Echo Control Binding

Thanks.
I just tried it and obviously alexa concatinates the phrase in the App and the TTS command.

my experience is Alexa’s command is played first and then whatever you respond with on TTS is done afterwards. Depending on the amount of time OH takes to process the rule this could be a really short gap but so far I have not seen the two interfere.

So I agree its a concatenation, which works well.

Thanks for your quick response.
Your example was very helpful for flawless integration!

This works via the log file, but not the voice command


17:14:46.474 [INFO ] [.smarthome.model.script.Garage_Status] - Garage Status Rul                                                                                        e has been triggered using Echo: Echo_MusicRoom_LastVoiceCommand
17:14:46.489 [WARN ] [arthome.model.script.actions.BusEvent] - Item 'Echo_Echo_T                                                                                        TS' does not exist.
17:14:46.498 [INFO ] [.smarthome.model.script.Garage_Status] - Message : The Gar                                                                                        age is not open

ITEMS:


// Commands
String Echo_Garage_TTS                   "Text to Speech"                        (gAllEchoDots) {channel="amazonechocontrol:echo:119d23d8:H:textToSpeech"}
String Echo_Garage_LastVoiceCommand      "Last Voice Command"                    (gAllEchoDots) {channel="amazonechocontrol:echo:119d23d8:Gxxxx94xxxH:lastVoiceCommand"}
String Echo_Garage_Remind                "Remind"                                (gAllEchoDots) {channel="amazonechocontrol:echo:119d23d8:G0xxx4:remind"}
String Echo_Garage_PlayAlarmSound        "Play Alarm Sound"                      (gAllEchoDots) {channel="amazonechocontrol:echo:119d23d8:xxxx:playAlarmSound"}
String Echo_Garage_StartRoutine  

It looks like you need to adjust the section that determines the name of the Echo TTS channel from the triggeringItem.name

In my case my naming convention is:
X_Echo_Channel
where X is a short form of the room that the echo is installed.

Your convention appears to be Echo_Y_Channel
Where Y is the long name of the location the echo is installed.

therefore looking at my rule that works out the correct TTS channel to use you will need to adapt it to match your naming convention.

something like(not tested):

	// get the room of the echo device                              
	val sourceRoom = triggeringItem.name.split("_").get(1)
	// use the room prefix to specify the actual device TTS for the returned response.
	val _TTS = "Echo_"+sourceRoom+"_TTS"

I hope that gets you in the right direction.

Paul

1 Like

You got it! That fixed it, thanks Paul

This could be a solution then to verbalise notifications using Alexa I think, as posted in the Design Pattern - Design Pattern: Working with Groups in Rules

Great Binding. One thing I`am really missing is the possibility to get alarm informations. I’àm switching on the coffee maker or some hue lights by rules before my alarm rings in the morning.

Would be great if the trigger of those actions could be the alarm of alexa .

Regards Rainer

I recently got an Ecobee Switch+. Its’ a switch that includes Amazon Alexa in it.
I check the Amazon Echo control page for the binding.

It shows Under Type:
THIRD_PARTY_AVS_MEDIA_DISPLAY

State: Not Defined.

Can support be added by 3rd Party Amazon Devices?

Your latest beta is working great!

Hello, I get the following picture when setting up AmazonEchoControl when I click on Login. What can I do there?
tmp and cache already deleted, no change.

yes many thanks that worked now

Just FYI, My net seems to have gone down last night and as a result the echo control binding was spamming errors & warnings like crazy, over 1000 failed connection attemtps and related log messages for about 2 hours straight.

2018-12-06 03:15:01.294 [WARN ] [mazonechocontrol.internal.Connection] - Request to url 'https://alexa.amazon.de/api/device-notification-state' fails with unkown error
java.net.UnknownHostException: alexa.amazon.de

2018-12-06 03:15:01.598 [WARN ] [mazonechocontrol.internal.Connection] - Request to url 'https://alexa.amazon.de/api/ascending-alarm' fails with unkown error
java.net.UnknownHostException: alexa.amazon.de

2018-12-06 03:15:01.694 [INFO ] [mazonechocontrol.internal.Connection] - Error getting device notification states {}
java.net.UnknownHostException: alexa.amazon.de

2018-12-06 03:15:01.772 [WARN ] [mazonechocontrol.internal.Connection] - Request to url 'https://alexa.amazon.de/api/bluetooth?cached=true' fails with unkown error
java.net.UnknownHostException: alexa.amazon.de

etc…
Memory usage went through the roof as well, see

The yellow block is the 2 hours worth of warning spam, during which the OH2 memory consumption climbed up to 900MB (from around 600MB, which is normal for my RasPi 3B+) Any chance of getting the requests a bit under control if there is no working internet connection?

Please define it as echo thing and give me feedback which channels are workung

1 Like

Is it possible to add the “DontDisturb”&“Disturb” commands somewhere in this binding?
Maybe with the “startCommand” channeltype?

How do you add the latest version after the .jar is downloaded? Thanks in advance

Hi,

I downloaded the latest Beta (org.openhab.binding.amazonechocontrol_2.4.0.201812011454.jar) and installed it. Now the amazon-Login-Screen appears when I go to amazonechocontrol. Unfortunately it comes up with an error after I log in. The link looks like (I modified some values - e. g. my token):

https://www.amazon.com/ap/maplanding?openid.assoc_handle=amzn_dp_project_dee_ios
&aToken=xxx
&openid.claimed_id=https%3A%2F%2Fwww.amazon.com%2Fap%2Fid%2Famzn1.account.xxx
&openid.identity=https%3A%2F%2Fwww.amazon.com%2Fap%2Fid%2Famzn1.account.xxx
&openid.mode=id_res
&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.op_endpoint=https%3A%2F%2Fwww.amazon.com%2Fap%2Fsignin
&openid.response_nonce=2018-12-07T06%3A52%xxx
&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fap%2Fmaplanding
&openid.signed=assoc_handle%2CaToken%2Cclaimed_id%2Cidentity%2Cmode%2Cns%2Cop_endpoint%2Cresponse_nonce%2Creturn_to%2Cns.pape%2Cpape.auth_policies%2Cpape.auth_time%2Coa2.access_token%2Coa2.token_type%2Coa2.scope%2Ccaptcha_verified%2Csigned
&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0
&openid.pape.auth_policies=http%3A%2F%2Fschemas.openid.net%2Fpape%2Fpolicies%2F2007%2F06%2Fnone
&openid.pape.auth_time=2018-12-07T06%3A52%3A27Z
&openid.sig=xxx
&serial=
&openid.oa2.access_token=xxxx
&openid.oa2.token_type=bearer
&openid.ns.oa2=http%3A%2F%2Fwww.amazon.com%2Fap%2Fext%2Foauth%2F2
&openid.oa2.scope=device_auth_access
&captcha_verified=1&

The page is saying:

Looking for Something?
We’re sorry. The Web address you entered is not a functioning page on our site

Any idea?

Regards,
Flip

PS: I’m located in DE but the link above shows amazon.com

Hi Paul,

just put the .jar-file in the addons-folder ( you can find an overview of the file structure here: https://www.openhab.org/docs/installation/linux.html#file-locations ). Then I changed the owner (chown openhab:openhab xxx.jar) and set rights to rw/rw/r (chmod 664 xxx.jar). Afterwards I restarted openhab. Please not that the Binding will not appear in Addons-section of Paper-UI. But if you look into the Bindings, you can see it.

If you wanna be sure, you can check console:

openhab-cli console
(default password is habopen)

bundle:list -s

and watch out for the Active Binding.

Regards,
Flip

@michi

Can Echo be an audio sink (so I can use playSound)?

No, only the predefined alarm sounds can be played.

That part is ok, the app login goes always to amazon.com. It seem that for some users the proxy server of the binding can not replace all urls and so it ends on the amazon server. Could you make the login again and save the html-pages of all login steps. If the url in the browser switch from your openhab to amazon, I would need the page before (Please remove private informations or sent it as PN).