Echo Speak loop


#1

1) Give a description of the problem
Hi, I am trying to figure out if I can play my echo message on a loop. When someon rings the doorbell, I want echo to play a message. The message should play in a loop and end the earliest of 45 seconds or when the main door sensor opens.

2) What is the expected behavior?
As you can see, when someone presses the doorbell, the current piston only plays the message, but I would like to play it in a loop.

3) What is happening/not happening?
Working as written but I’m trying to write a loop, if possible

**4) Post a Green Snapshot of the piston!


#2

Perhaps the simplest might be to add a for loop and second trigger to cancel the loop. Say your message takes 3 seconds to play, you might have something like:

For ii=1 to 15 step 1
  With music players
    SpeakandRestore
    wait 3 seconds
  end with
end for
if door sensor changes to open
 cancel all tasks
end if

#3

I did something very similar in this piston, although it was related to door contact sensors and my SHM alarm. I ended up using a variable that I set to start the loop and clear when I want the loop to stop. It seems to work reliably.


#4

Thanks Bruce, I’ve been trying to figure out how to get the loop working with my Alexa. I found your piston and was able to modify it slightly for my needs. In my case I setup a routine in Alexa that says “Please disable the alarm” when someone comes through my Garage door. The piston opens a Simulated Contact sensor that Alexa watches and this triggers the announcement. I have Action Tiles on a wall mounted tablet where you must enter the pin and then disable the alarm. Because it’s a very anemic Tablet it was constantly killing Lannouncer in the background. So this allows Alexa to handle the announcement and the looping works perfectly. Anyway, thanks for taking the time to post!