Get Amazon echo announcements

Running my amazonechocontrol and am wondering, if you can get the announcement event from amazon, meaning I say to some device “Alexa Announcement” and dictate alexa the announcement.
I’d like to use the the following announcement event somehow, but it seems there’s no event in the binding, which I can use as a trigger trigger trigger, is there?

use the lastVoiceCommand channel

1 Like

If that’s updated, the announcement is already over. I’d like to just change the Channel and Volume of my Russound to dedicated zones, but perhaps i could use that anyways and make the announcement from the binding, it’s asynchronous then but still…

I setup an Alexa routine and a rule triggered on lastVoiceCommand to catch anything that starts with “alert” and then send it out as a notification. This goes out throughout the house as an annoucement through TTS on some UPnP WiFi speakers, and to the phone of anyone not at home.

1 Like

Hey Scott,

Can you paste your OH rule to look for “alert”? I use the last voice command a lot but haven’t seen the word “alert”. I’m assuming I need to turn on Guard with in Alexa also?

Best, Jay

Thing is, if I use “announcement” (in German “Ankündigung” or “Durchsage”), I usualle only get my “command” back but not the actual words I’d like to use. I get that only, if I don’t wait for Alexa to ask, what the announcement ist.

Example 1:

  • I activate the anncouncement: “Alexa - annoucement”
  • Alexa asks: “What is the announcement”
  • I tell her, what I’d like to have: “Supper’s ready, come down already!”

This one leads to only this: the Text isn’t in there, just the "durchsage" - german for "announcement"

2020-11-02 19:50:33.436 [vent.ItemStateChangedEvent] - Echo_Schlafen_LastVoiceCommand changed from  to alexa durchsage

Example 2:

  • I activate the anncouncement including the text: “Alexa - annoucement Supper’s ready, come down already!”

this leads then to:

2020-11-02 19:51:13.612 [vent.ItemStateChangedEvent] - Echo_Schlafen_LastVoiceCommand changed from alexa durchsage to alexa durchsage essen ist fertig bitte runterkommen

So your rule has to be looking for your keyword and you have to use the text in one go (which sometimes leads to me trying multiple times, as the first example works in most cases, as the second does not)

I should probably combine it with this… Alexa Speak and Respond — openHAB Helper Libraries documentation.

@rule("Alert: Voice command alert")
@when("Item VoiceCommand received command")
def voice_command_alert(event):
    voice_command_alert.log.debug("VoiceCommand received: '{}'".format(event.itemCommand))
    split_alert = event.itemCommand.toString().split(" ")
    if split_alert[0].lower() == "alert":
        content = " ".join(split_alert[1:])
        if content:
            events.sendCommand("Audio_Notification", content)