Release Candidate and Support: Amazon Echo Control Binding

UPDATE:
Have downloaded and placed the beta 2.5 (3) into the addons folder and now the issue does not exist.

1 Like

I would set alarms directly from homeseer (mqtt )( i use homeseer ).

  1. ex: I have two echo in my living room:

if an alarm is set to LVecho2 then copy the alarm to LVecho1 , then delete the alarm on lvecho2.

  1. if my phone is not detected on the wifi ( on a morning day) set an alarm on the echo to wakemeup

  2. if an alarm had been set and i am already outside the house, then delete the alarm .

  3. every tuesday night set an alarm on a echo to wake me up at 8 am wednesday morning. If there is no school tomorow delete the alarm.

the list could go on…

I’m facing the same issue, unistalled the Amazon Echon Control binding as when this happens Habpanel stalls for a while. Will try a current beta of the binding over the weekend and feedback here.

Did you get the audio-tag (with the Amazon Sound Library) to work?

<audio src='soundbank://soundlibrary...

Unfortunately no.
Alexa just skips the part and it happens nothing.

nextReminder - logic recommendations needed

One of my wife’s complaints about setting a reminder on an Echo is that you have to be by that Echo when the reminder is played back. That rarely happens, so we don’t use that function.

My idea is to check for nextReminder’s across all the Echo’s and then play the reminder at that time using a group TTS across ALL the Echo’s.

How would I execute the group TTS based on that reminder(s) set time? Set a CRON task somehow in a rule? Continue to looping until that time occurs, etc?

I think this would be a very helpful rule for a bunch of people on this thread.

Here’s what I got so far to determine nextReminders set.

Group:DateTime:OR(UNDEF,NULL) Alexa_Reminder "State [%s]"
rule "Checking for Echo Reminders via Group"
    when
		Member of Alexa_Reminder received update or
		Member of Alexa_Reminder changed	
	then

		if (triggeringItem.state != UNDEF && triggeringItem.state != NULL && triggeringItem.state !== null) {

			logInfo("Echo", "Found An Echo Reminder On " + triggeringItem + " Set For " + triggeringItem.state)
		}
end

Which produced this output:

2019-01-19 14:39:57.079 [INFO ] [.eclipse.smarthome.model.script.Echo] - Found An Echo Reminder On Echo_Jay_nextReminder (Type=DateTimeItem, State=2019-01-19T14:41:00.000-0600, Label=Next Reminder, Category=clock, Groups=[Alexa_Reminder]) Set For 2019-01-19T14:41:00.000-0600
2019-01-19 14:39:57.092 [INFO ] [.eclipse.smarthome.model.script.Echo] - Found An Echo Reminder On Echo_Jay_nextReminder (Type=DateTimeItem, State=2019-01-19T14:41:00.000-0600, Label=Next Reminder, Category=clock, Groups=[Alexa_Reminder]) Set For 2019-01-19T14:41:00.000-0600

LMK your ideas?

Best, Jay

Hi,
the SSML support for TTS works with a simple sentence.
Is it possible with a variable too?
My code looks like:

Echo_Kueche_TTS.sendCommand('<speak>Das Telefon klingelt,<break time="1s"/>.</speak>' + CallerName2 + 'ruft an')

in this case CallerName2 is a variable from the Fritzbox.
The echo reads “speak” and “break time” instead of doing a pause of 1 second.

For the moment i realize it with:

...
Echo_Kueche_TTS.sendCommand('<speak>Das Telefon klingelt,<break time="600ms"/> es ruft.</speak>')
timeralexa2 = createTimer(now.plusSeconds(5)) [|
Echo_Kueche_TTS.sendCommand(CallerName2 + "an")
]
....

This works, but i want to simplify the rule and the time to the second TTS (CallerName2 + “an”) is somtimes a little bit longer or shorter.

Any idea to get it to work with one sentence?

Best regards
Michael

I haven’t played with SSML yet, but I don’t see why something like this wouldn’t work…

Echo_Kueche_TTS.sendCommand('<speak>Das Telefon klingelt,<break time="1s"/>. ' + CallerName2 + ' ruft an</speak>')

thank you very much for your help Scott, it’s working now!

2 Likes

Is it somehow possible to show a message on Echo Show/Echo Spot using this? I do not want it to say anything, just show a little message (for example if the phone is ringing show who is calling but don’t actually say it).

Here’s what I came up with and thank you @5iver for the help on the timer creation line! There are few issues with this example (code scaling for lots of echo’s, my bad use of lengthy timers, etc.) I’m open to code streamlining . . .

Items:

String      Echo_Jay_TTS                   "Text to Speech"                  			 (Alexa_TTS_Alerts)                  { channel="amazonechocontrol:echo:account1:echojay:textToSpeech" }
DateTime	Echo_Jay_nextReminder	       "Next Reminder [MAP(alexaalarm.map):%s]"				<clock>		(Alexa_Reminder) { channel="amazonechocontrol:echo:account1:echojay:nextReminder" }

Variables in Rules:

var String			reminder_Jay = null							// Alexa Last Heard Reminder
var Timer			reminder_Jay_tAlive = null					// Alexa Timer

Rule:

rule "Checking for Echo Reminders via Group and Speaking them across all Echos"
    when
		Member of Alexa_Reminder received update
	then

		// Echo reminders via voice should be said in this format below
		// Echo, remind me of X <pause> 3:20 (must say reminder first, then pause, then you will be prompted for a time)

		if (triggeringItem.state != UNDEF && triggeringItem.state != NULL && triggeringItem.state !== null) {

			logInfo("Echo", "Found An Echo Reminder On --> " + triggeringItem.name + " <-- Is Set For --> " + triggeringItem.state)
			
			if (reminder_Jay_tAlive === null && triggeringItem.name == 'Echo_Jay_nextReminder') {
				
				reminder_Jay = Echo_Jay_LastVoiceCommand.state.toString
				logInfo("Echo", "Echo Reminder On --> " + triggeringItem.name + " <-- Set For --> " + triggeringItem.state + " <-- With This Reminder --> " + reminder_Jay)

				reminder_Jay_tAlive = createTimer(new DateTime(triggeringItem.state.toString)) [ |
    				reminder_Jay_tAlive.cancel()
						Thread::sleep(2000)   // 2 second wait
					reminder_Jay_tAlive = null
					Alexa_TTS_Alerts.sendCommand(reminder_Jay)			// TTS to a group of Echos
						Thread::sleep(22000)							// 22 second wait to insure all 11 Echos spoke
					logInfo("Echo", "-----------------------------------------------------------------------------")
					logInfo("Echo", "** Echo Reminder Spoken Around House Was --> " + reminder_Jay)
					logInfo("Echo", "-----------------------------------------------------------------------------")

				]
				
			} else if (reminder_Jay_tAlive !== null && triggeringItem.name == 'Echo_Jay_nextReminder' && triggeringItem.state == UNDEF){
			
				// Cancel the reminder timer since the reminder was cancelled via voice

				logInfo("Echo", "Echo Reminder Cancelled via Voice On --> " + triggeringItem.name)
				reminder_Jay_tAlive.cancel()
					Thread::sleep(2000) 	// 2 second wait
				reminder_Jay_tAlive = null
			}		
		}
end

Best, Jay

Not yet, but I will check this possibility, I expext that it will work, for the ssml support The json have different entries for the display and the spoken text. Currently I use both with the same value. But I will need a beta tester :wink: for this, I do not own such a device.

Yeah no Problem, I can test that on an Echo Show and on an Echo Spot (I want to use it anyways, so testing it is basically configuring the setup I need anyways :smiley: )

Guys,

I don’t know why, but when I try to use SSML I hear also all tags :frowning:
eg:

Echo_Living_Room_TTS.sendCommand('<speak>Bentornato a casa, Andrea</speak>')

I hear “speak bentornato a casa, Andreaspeak” :smiley: :smiley: :smiley:

Any suggestion? What I’m missing?

thanks
Andrea

I expect that you missed to install the beta version from the top most posting if this thread. The current release does nit support SSML.

1 Like

the beta version is not merged with the latest version of OH?

edit: uops … right …
What I need to do exactly? copy the beta (3) in /usr/share/openhab2/addons and that’s it? or I need to install the previous version installed via PaperUI?

openhabian here

thanks
Andrea

Hi There,

I am just trying to use the command “startRoutine”. I have created a rule but actualy I have no idea how to identify the Routine to be started. What identifier to use?. I have arount 7 or 8 routines created in my echo plus what name, command text or whatever need to write in the rule?. An example woudl be highly appreciated.

when
Channel “astro:sun:local:set#end” triggered END
then
“Echo_Living_Room_StartRoutine”.sendCommand(…???)
end

Thanks in advance!

Mariano

It looks like there is a bug in the documentation, but the example (scroll down in the docs) shows this as a String item. I’ve submitted a change for this.

Just send the name of the routine as a string, without the command word, to activate the routine.

1 Like

then, I must write the text vocie I use to activate the Routine (in theexample below case is in german):

when
Channel “astro:sun:local:set#end” triggered END
then
“Echo_Living_Room_StartRoutine”.sendCommand(“Lichts an”)
end

And the item shoud be:

String Echo_Living_Room_StartRoutine “Start Routine” {channel=“amazonechocontrol:echo:account1:echo1:startRoutine”}

I’ve never used it… but that LGTM! Temporarily add add a System started trigger to test (will trigger when rule file is saved).

1 Like