Released: Openhab2 Amazon Echo Control Binding (controlling alexa from openhab2)

Tags: #<Tag:0x00007f014825c0d8> #<Tag:0x00007f014825dd98> #<Tag:0x00007f014825bd90>

(Michael Geramb) #1416

Information Request:

  1. Please give me feedback on which amazon domain the SSML works with the binding (Because the call in the alexa app was introduced in weeks after, so maybe it works not on all domains yet) is the only one tested.

  2. It would be nice if one with a lot of echos test, if a SSML call have the same problems for many multiple calls at the same time as it was the case for plain text.

Thank you for testing!

(Oliver) #1417

Thank you for integrating the timer and alarm channels. I don’t want to be impertinent, but I miss one thing. The Music Alarm. So, if you are woken up with music. Unfortunately, this is not intercepted by the Next Alarm Channel.

(CM6.5 H102) #1418

Here’s another reference for using SSML with short example audio clips. Also look toward the bottom for the speechcon’s, select your region, and you will get a list of all with example audio. The first in the list is “abracadabra” maybe the kids will like it.:laughing:

How to use example:

    Here is an example of a speechcon. 
    <say-as interpret-as="interjection">abracadabra!</say-as>.

    I think were gonna have fun with this. 
    <say-as interpret-as="interjection">bada bing bada boom!</say-as>.

Great work @michi

    I think this is 
    <say-as interpret-as="interjection">dynomite!</say-as>, thanks Michael.

(omatzyo) #1419

Hi @michi, the SSML is fantastic! I’ve been hoping you would add this feature since I heard of it.

I tested with my group of 12 echos (in the US) and see the same issue that we’ve been having with plain text. The following message repeats several times corresponding to random devices that don’t play after any given command.

2019-01-12 09:07:34.554 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@1ff50d0': POST url '' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url '' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommandWithVolume( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.sendAnnouncement( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech( ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand( ~[?:?]
	at sun.reflect.GeneratedMethodAccessor27086.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
	at java.lang.reflect.Method.invoke( ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect( [102:org.eclipse.smarthome.core:]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke( [102:org.eclipse.smarthome.core:]
	at com.sun.proxy.$Proxy194.handleCommand(Unknown Source) [265:org.openhab.binding.amazonechocontrol:2.5.0.Beta_02]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand( [109:org.eclipse.smarthome.core.thing:]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem( [109:org.eclipse.smarthome.core.thing:]
	at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
	at java.lang.reflect.Method.invoke( ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect( [102:org.eclipse.smarthome.core:]
	at [102:org.eclipse.smarthome.core:]
	at [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
	at java.util.concurrent.ThreadPoolExecutor$ [?:?]
	at [?:?]

This is an interesting little quirk… On the Echo show it displays the text command:

This does not happen with the plain text.

(Mr. Wiseman) #1420

I keep seeing discussions about calling a bunch of echo’s at once with the same message. I haven’t figure out how to do this w/o writing a rule that has 1 echo - one after another - saying the same thing.

Can you provide a rule example that calls all 12 echo’s at the same time to send the same message? I also have 12 echo’s (US) and I’m very interested in this rule.

Best, Jay

(Michael Geramb) #1421

Thank you for the information, I think I have to implement a queue for this. But it’s a lot of work, so do not await in the next days.

This is a simple issue. I have to remove the xml tokens for the display json element.

(Michael Geramb) #1422

@jwiseman: It would be nice, If you could test one more thing, the new api calls needs the customerId in two places and I’am not sure if they are both the account customer id or device customer id. Could you test an SSML text with one of your echos with the other owner?

(Michael Geramb) #1423

Oh, thank you for this hint, I have not seen yet, that there is another alarmType for this. I will provide an additional channel for this is the next version.

(Tobias) #1424

Dear Alexa experts,

I need a short hint how do decide between items I want to expose to Amazon Eche and those I only need on my OH server.

Could you please quickly check All items with tag are exposed to Google Assistant and Amazon Echo? and give an advice? Thank you!

Edit: Resolved in that discussion - thanks!

(Mr. Wiseman) #1425

It worked! The Echo Dot is under my account; not my wife’s which is what OH runs under.

				Thread::sleep(2000)  // 2 second wait
	      	Echo_Jay_TTS.sendCommand('<speak>Excuse me Jay,<break time="3s"/> I detect <emphasis level="strong">your phone</emphasis>,<break time="3s"/> so you must be home now.</speak>')
				Thread::sleep(2000)  // 2 second wait

Best, Jay

(Mr. Wiseman) #1426

nextAlarm option showing UNDEF in HabPanel

I’ve implemented the nextAlarm option in order to tell the kids that an alarm is NOT set on their Echo’s when they go to bed Sun - Thur @ 8:35 pm.

The issue I can’t seem to resolve is; it’s showing UNDEF in HabPanel when one isn’t set. Is there anyway to show something like “Not Set” or “01/01/2000” vs. UNDEF?

I don’t think a MAP file will work because when one is set; the transformation wouldn’t work with the date/time value, am I thinking correctly on this?

The nextAlarm is a DateTime variable (read only) so I’m not sure how to do this?

Best, Jay

(Michael) #1427

It doesn´t matter as the mapping wouldn´t be used if there´s a “correct” value.
It would create an log entry that says cannot transform 01/01/2000 with

(omatzyo) #1428

It’s nothing complicated. I have all of the TTS items in a group in the items file.

Group Alexa_TTS_Alerts (Amazon_Echos)

String echo_office_TTS "Text to Speech"  (Alexa_TTS_Alerts) {channel="amazonechocontrol:account_info:textToSpeech"}
String echo_familyroom_TTS "Text to Speech"  (Alexa_TTS_Alerts){channel="amazonechocontrol:account_info:textToSpeech"}
String echo_playroom_TTS "Text to Speech"  (Alexa_TTS_Alerts){channel="amazonechocontrol:account_info:textToSpeech"}

You can call them with either:



Alexa_TTS_Alerts.members.forEach[ item |

(Mr. Wiseman) #1429

Thank you! It worked and I learned more about mapping :wink:

Best, Jay

(Matthieu Lauzon) #1430

I do not see the new channel . I on beta 2 and snapshot 1500 of openhab 2.5

(Oliver) #1431

Steps for update from previous version (If you want use the new channels):

  1. Remove discovered echo devices from your inbox
  2. Remove all your existing echo things (If you have created them in PaperUI)
  3. Replace now the binding jar
  4. Create your things to get the new channels
  5. In PaperUI some channels are only shown if the “show more” (top right corner) option in the thing page is activated

(Michael Geramb) #1432

Please check out my latest beta 2.5 (3). There is a new channel for the music alarm.

(Michael Geramb) #1433

Beta 2.5 (3) Released

  • New channel for music alarm added
  • Small bugfixes

Download the latest beta from the top most posting.

(Matthieu Lauzon) #1434


I had to do thoses steps two times in a row…lol. When i just finished to set my things on beta 2… beta3 just showed up haha.

All is working good.

(Matthieu Lauzon) #1435


I think iI did not see it.

But, is the web page api give access to write or delete an alarm?