Amazon Echo SmartJ Binding Last Voice Command not working anymore

Thank you very much!
The Binding works, but is still slow to update. When you change settings or update, e.g. DND mode or lastvoicecommand, the binding takes about 15 seconds and does not update immediately. Is it possible to make this work like it did before?
And the NotifyNowPlayingUpdated channel throws errors, see the email.

No, we don’t receive “activity ended” anymore, Amazon removed that event. We now try to guess from the beginning of the activity when it’ll end and request the activity afterwards.

In the account thing is a new configuration option for that time. The default is 10s, which may be too long for you. Lowering that time improves the response time but you might miss events that have very long questions or answers.

1 Like

First of all, thanks a lot for all your work.

I used this feature as a trigger for many many rules and am really wondering how this could be realized otherwise with a decent reaction time? Even going down to 5 seconds (which presumably would cause some trouble as described) would still be an awkward delay, e.g. when you want to switch on the TV?

Does anyone have any thoughts on that?

First of all - thanks a lot for your awesome work. LastVoiceCommand works for me, with the delay described.

I did not figure out how to change the JSON 3rd party marketplace URL, I downloaded manually the kar file from the link in the JSON. Maybe someone can point me to the proper way for this step.

You can find it in the setting. This is the link (with your IP): http://OPENHAB:8080/settings/services/org.openhab.jsonaddonservice
just paste “https://download.smarthomej.org/addons.json|https://download.smarthomej.org/addons-beta.json” there and enable “Non-stable add-ons” (didn’t work without it for me).
Then you will finde the beta binding in the binding search.

2 Likes

For stuff like turning on the TV I use an alexa defined ( in the Alexa app ) routine that triggers an openhab rule. This works I would say fast. You can define routines in the Alexa app while LastVoiceCommand was/is nice to trigger the same rules/commands together with room awareness while I think you would require several Alexa defined routines to achieve the same ( if possible ).
You also could write you own “skill” defining your own intends and actions to be executed.
I have a self hosted ( on Pi ) skill written in python. Something like “alexa start jarvis and switch to channel 2”. “alexa start jarvis and ask what is currently running on TV”. In the background then http is being used to either switch the channel or check the what currently is active on the receiver ( either a recorded show that is being running or the current show that is received in live stream ).

1 Like

Thanks @J-N-K for your work.
I have just installed your beta binding and it works.
Just one thing, like others I still have a strong delay in detection, even if I set “Activity Request Delay” to 5 sec I have almost 7-8 sec delay.
I use this feature essentialy to localize my echo devices in house (so I just say “echo light” or “echo shutter” or echo whatever to have action in the right room).
If there is another way to do this or to speed up detection, it would be welcome !
(I did not achieve to find “deviceID” or anything that can help to localize elsewehere in alexa API/requests)
Thanks

It takes about a second to do the request, so that makes an extra second. Plus the time for the processing of the push message and the delay between start and push message makes the 7-8 seconds if you set it to 5 seconds. I’m not aware of any good solution for that. Since IFTTT also removed this functionality, I believe there is no good replacement for what we had before.

I assume most of us need a dummy-Alexa-routine anyway in order to prevent Alexa from answering with an error message (like “i don’t know how to
”).

So we could use this routine to trigger the openhab-binding, like in the workaround: A virtual switch that’s triggered by Alexa.

That would avoid the delays.
@J-N-K : Wouldn’t it be possible to provide the selection of a trigger item in the configuration-menu of the Alexa-bridge-thing? If the user selects a trigger item then the binding is activated by the trigger.

Or could you tell me which is now the URL to get the json? Then I could fix the workaround.

I have implemented a channel for that. But due to an unresolved bug in openhab-core (Fix thing upgrades for bridges by J-N-K · Pull Request #3858 · openhab/openhab-core · GitHub) I can’t deploy it.

Ok, I have disabled automatic updates and made the account thing extensible. You can manually add a channel of type refreshActivity. Please make sure that the channel-id is also refreshActivity, otherwise it’ll not work. The channel is write-only, sending ON or OFF (works both) to that channel refreshes the activity history immediately. The automatic refresh is still I place, but it should not result in duplicate events in the lastVoiceCommand/lastSpokenText channels, because the events are tracked.

2 Likes

Hi @J-N-K
Your work is excellent, I reinstalled and test your new binding, flawless feature !
Now I can have instant update of Las Voice Command without any delay.
Great job !
One question : in my code I implement a loop in case of failure, is it safe to call “refreshActivity” every 500ms for 10 seconds for example ? (each time I receive an alexa command, not so frequent) Or even less ?
Many thanks

@J-N-K : really great and much appreciated how much effort you put in that binding.:pray:

I would not recommend making too many requests in a short time. I vaguely remember Amazon blocking devices for that. But nobody knows what is acceptable and what is too much.

Thats a good solution, thanks!
But for me it doen’t work at the moment and I am not sure, what I did wrong.
I created the Channel according to your guide with the Item:
Switch Amazon_Refresh_Activity “Amazon Refresh activity” {channel=“amazonechocontrol:account:echo:refreshActivity”, alexa=“Switch”}

When I trigger the Item with Alexavoice the Log says: Item ‘Amazon_Refresh_Activity’ received command ON, but the Items is not updated and the state doen’t change. It should change even though it is write only, shouldn’t it?
The activity is not updated either.
Any ideas?

The channel is on the account thing, is your account named „echo“?

Yes the Channel ist on the account thing (named Amazon Konto). There was a pre configured channel (from you i guess) and I just named the ID “refreshActivity”.
Account “Amazon Konto” (amazonechocontrol:account:echo )

The state of the refreshActivity channel should not change. The lastvoicecommand will only update if there is a new value within now-120s to now+30s (+30s is to make sure the server‘s time is not differing from the local time and we miss something).

Not sure if i understand oder set this up this correctly.
So the Items is supposed to stay NULL even when received command?
I set up an alexa-routine that when I say “light on” the routine sends command ON to the refreshActivity-Channel. Then the lastvoicecommand should be triggered and the light turns on in the room that the echo is spoken to (filters lastvoicecommand = “light on” and triggers the right light).
The last part works like before with a big delay.
Is that the way the new change is intended to work with much less delay?

It works for me too. Actually 10 seconds is a bit long but it’s better than nothing.
THANKS