Need advice on using Echo with motion sensor


#1

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


#2

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


#3

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.


#4

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.


#5

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


#6

I’ll give it a try. Thanks!


#7

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
Then
Wait 2 minutes 
Set variable MOTIONGARAGE to FALSE

Piston 2 -

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

#8

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


#9

No luck, no announcement at all.


#10

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.


#11

Using your Piston, still nothing. No Detection Announced.

Logs are from physical test of the Piston.


#12

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.


#14

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:

pic


#15

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


#16

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.


#18

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

Screenshot Motion Detected Piston https://imgur.com/gallery/K34hOoB


#19

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


#20

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.


#21

Aaah, ok.


#22

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.