Need advice on using Echo with motion sensor


1) Give a description of the problem
Need a wait period, not sure where to put it.

2) What is the expected behaviour?
Ideally, Echo reports motion, then there is a cool off period of 2 minutes before Motion is reported again.

3) What is happening/not happening?
As it is, motion is reported every time Motion Sensor is activated. It’s in my garage. Our freezer is behind the Sensor’s location, so I get multiple reports when 1 is enough.

4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
5/21/2020, 5:01:17 PM +515ms
+0ms ╔Received event [227].test = 1590094877514 with a delay of 1ms
+69ms ║RunTime Analysis CS > 21ms > PS > 27ms > PE > 20ms > CE
+71ms ║Runtime (37332 bytes) successfully initialized in 27ms (v0.3.110.20191009) (70ms)
+72ms ║╔Execution stage started
+86ms ║║Comparison (time) 61277591 is_between (time) 26100000 … (time) 82800000 = true (8ms)
+88ms ║║Time restriction check passed
+89ms ║║Condition #2 evaluated true (13ms)
+96ms ║║Condition #7 evaluated false (6ms)
+97ms ║║Condition group #1 evaluated false (state did not change) (21ms)
+101ms ║╚Execution stage complete. (30ms)
+102ms ╚Event processed successfull


What happens after motion is reported?
(lights on? sound alert? etc?)
What would you like to accomplish?


That’s all. Echo announces Motion has been Detected in the Garage. I have lights come on, but those are on a separate Piston which is working fine.


I want it to announce motion once, and wait about 2 minutes before announcing again (if motion is detected again). The.way my garage is set up, I get more than 1 announcement within a minute or so of original motion detection.


I think there are a couple of ways to do that. You can put a wait after the message, but you will need to have the Task Cancellation Policy set to Never cancel task. If not then the trigger will halt the wait and it will give you the message again.

Another way would be to use a date/time variable. Set it to $now when the message is spoken. You would then put an additional IF around the message command.

If $now after addminutes(yourvarible,2) then

[edit]Actually the TCP does not work as I thought it did. So probably using the variable method is best. Something like this


I’ll give it a try. Thanks!


one other way would be using a global variable and a second piston.
This longer way is not needed for your purpose but it’s good to know the possibilities.

Piston 1 -

IF global variable MOTIONGARAGE changes to TRUE
Wait 2 minutes 

Piston 2 -

IF motion changes to ACTIVE
IF global variable MOTIONGARAGE is TRUE
Do this do that


Have to say, this is a damn good community. I appreciate the help.


No luck, no announcement at all.


The piston I posted works. So maybe start with that. And then add your additional stuff to figure out where your problem is.

Maybe post a copy of what you have.


Using your Piston, still nothing. No Detection Announced.

Logs are from physical test of the Piston.


What I want to happen is exactly this:
Motion is Detected > Announce Motion Detected > Wait 2 minutes before Announcing Motion is Detected again.

In other words, 2 minute cooldown on repeating motion is detected again, IF motion is detected again within the 2 minute cooldown period.


I have edited all of your pictures @001jeff so they now reside here on the forums.
(instead of using an outside site)

For future reference, you can upload pics here using this button:



Thanks, I’m trying to figure it out still.


You probably have to initialize the MessageSent variable. I probably should have mentioned that.

Before you run it, just edit the variable in the variable section beside the log section. Just click on the edit(pencil) next to the MessageSent variable and set it to your current time.

You could create code to initialize it if it’s null but once you run it once then your good.


It’s getting to be over my head. I don’t see a pencil symbol on my edit screen…

Screenshot Motion Detected Piston


Apologies, tried to load picture as you described, it wouldn’t go to my gallery.


Its not actually in the edit screen it’s in the screen where you test the piston, look at your logs, etc. If you click the area pointed to, you can change the value of the variable.


Aaah, ok.


I’ve been busy, haven’t had time to follow up. Iet still doesn’t work as I want it to… getting multiple announcements with no two minute wait.