Don't do action if same device triggered it within the last 10 minutes


#1

1) Give a description of the problem
I have this piston that uses echo speaks to make a voice announcement when certain contacts are opened. It works great with one minor annoyance: If the same door gets opened repeatedly, hearing the announcements again and again gets tiresome.

2) What is the expected behavior?
I would like some advice as to how I could essentially say “If the same device has triggered an announcement more than once within the last ten minutes, don’t do the announcement.”

3) What is happening/not happening?

**4) Post a Green Snapshot of the piston


#2

I would try two different approach to this…

1 - Using a timer.
2 - Using a variable

#1
After speak text add WAIT 10 minutes and ADD NEVEr CANCEL TASK in WITH (line 29)

#2
It’s almost same as #1 but you can change the variable anytime you want and get different results…
IF any sensors changes to OPEN
…save matching devices
AND
IF @devicestatus = TRUE
then
SPEAK TEXT

The speak text will work ONLY if the variable is true…


#3

I’m looking at the variable method.However, I still want announcements for other devices’ open events that might happen during another device’s timeout period. So I’m wondering if there’s a way to maybe timestamp when an annoucement is made for a certain device and then not do the action if the last announcement for that device was within the last X minutes? I don’t know if that makes sense or not…


#4

I believe it’s possible but you have to start recording every device separately (I am not a coder) so if there is a neat shortcut I am not aware of it.