Announcing/Reminder message on all Alexa Devices simultaneously - How?

Hi everyone,

what is the best way to Trigger an announce a message/send a reminder to all Alexa Devices ?

Is there a special solution to trigger it for all the devices or do I need to send the command to all the Alexa Devices one by one at the same time ?

You can have one group with all your Alexa device textToSpeech channel items and broadcast to all your devices by sending a command to that group.

Hi @jeshab,

I tried it as you suggested the last few days and I am getting this kind of errors each time. (I have an Alexa Device in 5 different rooms).

This only happens when I am trying to broadcast it to all of them. If I only broadcast it to one it works.

2022-04-20 21:30:06.969 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@9a561d': DELETE url 'https://alexa.amazon.de/api/notifications/A10A3356ASDFOX2NUBK-G070RR1074A56DS52403VT-019cas46cf7c-88a564sd0d-44a65sd6f4-a3asd655a-215ae8as5d6ae9000_REMINDER' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: DELETE url 'https://alexa.amazon.de/api/notifications/A10A3356ASDFOX2NUBK-G070RR1074A56DS52403VT-019cas46cf7c-88a564sd0d-44a65sd6f4-a3asd655a-215ae8as5d6ae9000_REMINDER' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.stopNotification(Connection.java:1955) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.stopCurrentNotification(EchoHandler.java:758) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:521) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7187.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-04-20 21:30:07.135 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@afad69': DELETE url 'https://alexa.amazon.de/api/notifications/A1NL4BVAS46LQ4L3N3-G00065ADJN0675120DRV-4421efsfd12363-bs12d3fb8a-45df3g125d-acca31d1-2f4s312f820a6cbd3_REMINDER' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: DELETE url 'https://alexa.amazon.de/api/notifications/A1NL4BVAS46LQ4L3N3-G00065ADJN0675120DRV-4421efsfd12363-bs12d3fb8a-45df3g125d-acca31d1-2f4s312f820a6cbd3_REMINDER' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.stopNotification(Connection.java:1955) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.stopCurrentNotification(EchoHandler.java:758) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:521) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7186.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-04-20 21:30:07.245 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@ee1555': DELETE url 'https://alexa.amazon.de/api/notifications/A32DOSD56FYMUN6DTXA-G090U506S6D54F83570KXQ-25cb5d64fg03b9-3e6w4rcbd-4frz56cf-bcvb65772-aa56dfg55ebcfbc5a_REMINDER' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: DELETE url 'https://alexa.amazon.de/api/notifications/A32DOSD56FYMUN6DTXA-G090U506S6D54F83570KXQ-25cb5d64fg03b9-3e6w4rcbd-4frz56cf-bcvb65772-aa56dfg55ebcfbc5a_REMINDER' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.stopNotification(Connection.java:1955) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.stopCurrentNotification(EchoHandler.java:758) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:521) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7178.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-04-20 21:30:07.254 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@123a605': DELETE url 'https://alexa.amazon.de/api/notifications/A1Z88NS4D56FGR2BK6A2-G09F45GH6146546945708MD-16csdf4517f03-b85g46hj85-48cv5bn6506-adfg5d24-878646fhe287e1b_REMINDER' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: DELETE url 'https://alexa.amazon.de/api/notifications/A1Z88NS4D56FGR2BK6A2-G09F45GH6146546945708MD-16csdf4517f03-b85g46hj85-48cv5bn6506-adfg5d24-878646fhe287e1b_REMINDER' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.stopNotification(Connection.java:1955) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.stopCurrentNotification(EchoHandler.java:758) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:521) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7176.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-04-20 21:30:07.261 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@753da4': DELETE url 'https://alexa.amazon.de/api/notifications/A3S545665D546FG46VAYF-G09045S4D56F6456950MTF-912645645+5d654655b-204465dfg588-445456dgf6be3-b3145d6g3-de4314d5fg5af645b_REMINDER' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: DELETE url 'https://alexa.amazon.de/api/notifications/A3S545665D546FG46VAYF-G09045S4D56F6456950MTF-912645645+5d654655b-204465dfg588-445456dgf6be3-b3145d6g3-de4314d5fg5af645b_REMINDER' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.stopNotification(Connection.java:1955) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.stopCurrentNotification(EchoHandler.java:758) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:521) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7184.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-04-20 21:30:08.446 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@1aefd32': PUT url 'https://alexa.amazon.de/api/notifications/createReminder' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: PUT url 'https://alexa.amazon.de/api/notifications/createReminder' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:691) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]5
	at org.openhab.binding.amazonechocontrol.internal.Connection.notification(Connection.java:1947) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:526) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor562.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy7182.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.GeneratedMethodAccessor565.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

I found that you can’t send a command to multiple devices simultaneously - some kind of rate limiting on Amazon’s end, I think.

So, as I’ve got a small, known set of announcements I want to make (I don’t dynamically create the text within openHAB) - I have created Routines on Alexa (using the Alexa app on my phone), where I specify the words I want announced, and from here can select which devices I want to announce it to.

Then, from openHAB, I simply call this Routine “from” one of my Alexa devices, by activating a “switch”:

Switch Announce_Dinner_On_Table     "Dinner On Table"  ["Switchable"] {expire="2s, state=OFF"} 

Which in turn, kicks off this Rule:

rule "Annouce Dinner On Table"
when 
    Item Announce_Dinner_On_Table received update
then 
    if (Announce_Dinner_On_Table.state == ON) {
        LoungeEchoDot_StartARoutine.sendCommand('dinner is on the table')
        executeCommandLine("/usr/bin/mpg123 /etc/openhab2/sounds/dinner-is-on-the-table.mp3")
        sendNotification("xxxxx@xxxxx.com", "Dinner is on the table")
    }
end

This also plays an mp3 through the sound output on my server, which is hooked up to a multi-room audio system in some of the rooms where I don’t have an Amazon device, and it also sends a notification through the openHAB Cloud to my account, which I have on my mobile phone, so I get notifications on my phone & watch wherever I am.

This way, I’m only sending a single command to Amazon, and I allow it to determine which device(s) to forward the notification to - and it’s a bit easier to modify that through the Alexa app than it is to change a Rule within openHAB.

How do you do that because when I am creating a routine I can only select one device where Alexa should say something to. Could you elaborate on that?

When adding a Routine, when coming to add an Action, I choose Messaging → Send Announcement, rather than the “Alexa Says” option. From here, you can choose All Devices, or a selection of 1->many specific devices.

1 Like

Will try that. Sadly it is only possible to send an announcement, a reminder would have been the perfect solution for me.

@jeshab Any ideas suggestions how to avoid this rate limiting? Maybe there just needs to be slightly more milliseconds between the requests.

The Announcement says exactly what you type in - no more, no less.

You can add the “I’m reminding you…” prefix if you wanted to :smiley:

This is in the realm of the Amazon Echo Control binding which is separate from the Alexa skill. I unfortunately can’t help much on the issue you are experiencing since it is related to the former.

As far as my experience at the user level, I tested with a small sentence on 3 devices without any issue. It is very possible that if the sentence is longer and more devices are part of the group that it could trigger this error.

If this is indeed a rate limit issue, another solution could be to use a proxy item and use a rule to cycle through the items part of your Alexa TTS group adding a delay after each command sent.

What is the best way to use a delay in an Openhab rule ?

A few years back I used thread sleep or something like that but I think that is not a good way to delay something

If you are talking about a fraction of a second, then a thread sleep is fine. The issue is when you want to delay for longer which should be considered as a schedule instead, that can be accomplish by setting a timer. You should be able to find rule example with createTimer definition on this forum.