Reset counter not working


#1

1) Give a description of the problem

I want to create a While statement that verifies if the a motion sensor was triggered during a count-down and therefore reset the count-down.

2) What is the expected behaviour?
Count-down should be reset and start over.

3) What is happening/not happening?
Count-down not happening, virtual motion sensor is following the real motion-sensor.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)


#2

When you use a condition like

if Unknown Device 18 motion is active

as you do on line 36, the piston first looks at the event it is processing.

To get that far in your piston the event must be a Unknown Device 18 motion event with the value active. So the condition on line 36 will always be true.

The current value of the Unknown Device 18 motion may actually be inactive but because the piston is running an event that says it is active that is what matters. If it were any other event apart from the Unknown Device 18 motion the actual current value would be used.


#3

I dont know if I quite follow your explanation. Lrt me try to get more clear on what I have (I changed the piston a little)

I have a motion sensor that triggers and resets itself in 10 seconds. However I would like to make it last as much as possible depending on my “home automation mode”, So the intention would be:

  • the motion sensor is triggered -> that triggers a virtual device (I changed this to a switch)
  • I will use this switch to trigger other functions/routines
  • there is a time countdown after the motion is triggered - if the motion activates again the countdown is reset
  • the countdown reset will only stop if there is no motion within the countdown period.

With that new piston above I was able to do that but even I “reset” the timer it always turn OFF and then ON again my virtual switch. it is fast like 50ms but it happens.