Simple motion trigger not working


#1

I migrated a trigger from the old CoRe and it’s not working as expected…

Basically, I have a motion sensor and a plug. I want the plug to turn on 30 minutes after the motion sensor detected motion, BUT if there is movement in that 30 minute timeframe then the 30 minute timer needs to reset and start counting down again.

I tried turning of the cancellation policy entirely and this finally allows the app to trigger, BUT it doesn’t trigger a reset if motion is detected in the 30 minute window. I feel like this shouldn’t be that complex, but it’s not working how I would expect it to work. Any ideas of how to get this to work?

Here’s a snapshot of what I’m currently trying… this doesn’t trigger at all.

In CoRe, I originally set it up as “if motion sensor is active” then “wait 30 minutes and turn on plug”. This worked perfectly, but for some reason doesn’t work the same in WebCore.


#2

Is nor motion sensor going to inactive in 10sec? Can you turn on full logs and post the log

Right now the light will only go on if the motion sensor is not active 10s after it was active which seems odd to me


#3

Try:

On events from motion sensor’s motion
Wait 30 minutes
do stuff

To create an ‘on event’ statement you first need to turn on advanced statements via the piston options.


#4

Couldn’t it be as simple as…

If motion sensor 1’s motion changes to active
wait 30 minutes
do stuff

Each time the motion detector senses new motion, the piston would start over and wait 30 minutes until it turns on the outlet.


#5

No, because changes to active only stays true for 10 seconds, so the ‘wait’ also gets cancelled after 10 seconds.

You could of course set the ‘wait’ to never cancel… but keep it simple.


#6

Makes sense!


#7

Hmm, this is probably exactly the piece of the puzzle I am missing. If the action triggers and motion is detected again during, say a 30 minute wait, will it reset the event to wait for another 30 minutes?


#8

That was what I tried originally but unfortunately it doesn’t work… It simply never fires the event… If I set the cancellation policy to never then it does fire but it won’t reset if motion is detected.


#9

Yes, that is the default for the task cancellation / task execution settings.