Amazon Echo SmartJ Binding Last Voice Command not working anymore

mmh
I have amazonechocontrol:account:account in the Bridge Things file
Bridge amazonechocontrol:account:account1

and amazonSite=“amazon.de” to amazonSite=“amazon.com” and both went backwards then it worked again

Now the thing amazon account has a channel Refresh Activity you can trigger from a routine and then the answer will be much faster!

Sometime also happen to me… a restart of openhab fix it.
Maybe is related to the amzon server where i connect. (im in italy maybe amzon.it work less better than amazon.com

Can you please provide the rule syntax for this?

Best, Jay

For those that want a complete syntax solution to increase the speed in which Amazon responds, here’s what I did and it increased the response time from 30s w/o the rule to 8s now. I’m in the US and I’m NOT seeing the “too many requests” issue with a 11s refresh.

items:
Switch Amazon_Refresh 						"Amazon Account Refresh [%s]"																		[ "internal" ]   { channel="amazonechocontrol:account:account1:refreshActivity" }  

rules:
rule "Amazon Refresh Account"
	when
		Time cron "*/11 * * * * ?" 			// every 11 seconds
	then
	
		if (systemStarted.state != ON && gInternet.state == ON && Alexa_Status.state == 'ONLINE' && Home_Away.state == ON && UnifiPhones.state != OFF && OH_Uptime_HumanReadable.state != NULL && OH_Uptime_HumanReadable.state !== null && OH_Uptime_HumanReadable.state != UNDEF) {
		
			Amazon_Refresh.sendCommand(ON)
		}
end

Best, Jay

1 Like

I mean an alexa routine.
You have to connect this channel to a n item and expose the item to alexa:
for example in .item file: (if you use it)

Switch ECHO_REFRESH 	"Refresh Echo"	["Switchable"] {channel="amazonechocontrol:account:AlexaAccount:refreshActivity"}

so after a discovery on your alexa app you will find a new switch.
Now if I want to check if my cat went to the toilet.
i create a routine that answer with “Meaow” to the question “Alexa, did the cat went to toilet”
This to avoid that alexa answer to the the question with “I dont’ know” or whatever alexa answer when there is an unknow command.
Then i parse the “Last voice command” and i do what i want that openhab do on this situation.
Ad you saw there is a long delay.
If in the routine where Alexa answer “Meaow” you also press the new discovers switch “Refresh Echo” the answer should be faster!

2 Likes

Hi J-N-K do you have a paypal account or another way to offer you a beer?

1 Like

Applied the switch item workaround to kick the refresh of the LastVoiceCommand in the Alexa routines and now it feels like it’s as fast as before - nice job :D! Thanks again @J-N-K for all the hard work and hours you spent on this! I would be also interested in your paypal for spending a beer or coffee to you.

Thanks to @Lamerjack, the reboot did really bring back textToSpeech as before!

I totally understand that enforcing those channel name conventions on an already existing addon and so bringing pain to end-users should only be done with a good reason. And just “it looks nice” is not a justification IMHO to keep maintainers from updating their code for OH official release.
And this is now the Java Dev in me speaking here.

I agree that for a SmartHome system voice integration is the most important feature. I only use actual switches very rarley. Even if the switch is not far away I tend to even repeat (damn Alexa!) before pressing a button :). So maybe there could be some kind of re-discussion whether there could be an exception for that rule in favor to the end-users? Is there something we (end-users) could do to show the veto people that this is a real issue for us?

As I said in another thread: we are working on that.

2 Likes

this idea blow my mind! superquick and we don’t even spam any API with refresh rates etc. great!

How do you discover such OpenHAB device in Alexa? I’ve created the item in OpenHAB, but I’m now stuck trying to figure out how to proceed as Alexa (with OpenHAB skill installed) doesn’t find it.

UPDATE: The samples here were missing the alexa="Switch" property, so

Switch ECHO_REFRESH "Refresh Echo" ["Switchable"] {alexa="Switch", channel="amazonechocontrol:account:<amazonaccount>:refreshActivity"}

works fine.

Thank you so much @J-N-K for your work! :tada::balloon:

1 Like

Hm, anyone else seeing delays coming back since 1-2 days or is it just me?
Ranging from 2-5… sometimes above 5 seconds. The shadow item (refresh) is actually switching directly after the spoken word, but until the rule is hit it takes some time. Sometimes it takes only a second or so. I guess it’s the Alexa API being so unpredictable in terms of response times? Is there some debug I could enable to see if it’s the API or something else?

I have noticed in the U.S. that I was getting errors on my Alexa Routines, it was actually voicing it, I don’t have X skill to do something after executing an Alexa Routine which had no skills tied it anyway. It was weird but it eventually went away after a couple days.

Best, Jay

Amazon changed the way the history can be requested. Maybe it is related to that. The “old” way still works, but it could be that this introduces some delay.

Hey Jan,
are you saying they changed it again :)? Or are we talking about the changes you did on the separate version you provide? So I’m using the latter and currently unsure where the delay is located. Something we can influence or their API. But let’s see if others see similar things “coming back” (I’m in germany btw).

Just to doublecheck: the introduced refreshActivity channel is ok to receive “ON” all the time and does not need to be toggled, right? Currently I exposed a linked switch item exposed via Alexa for the refresh.

Yes, AGAIN.

And yes, no need to toggle.

I have also delays since several days.

I created a workaround for this using a dummy dimmer in my configuration file. I then have Alexa set the dimmer to a specific value, using a Alexa routing. Number 1 through 100 gives you lots of room for expansion.

I then created rules in openHAB to do specific actions given the dimmers command coming in with the given number.

Hope this helps some people

Yesterday text to speech stopped working (las voice command still working)
I just restarted openhab with sudo service openhab restart and text to speech come back to life.

can you explain “using a Alexa routing”?