1) Give a description of the problem
Timer within while loop is not being reset on motion activity.
2) What is the expected behavior?
What I want to have happen is the wait timer to expire after N (10 in this example) minutes of the garage door having been open while no motion activity happened. If there’s motion (in the garage), then reset the time to start over. Basically timeout should happen after 10 minutes with no motion and the door’s being left open.
3) What is happening/not happening?
Motion acttivity (which I have confirmed is being reported by the sensor in its event log) does not cause the wait timer to be reset. The log snippet I’ve posted shows the timer starting, and timer expiration – no other piston execution between that (when there was motion activity occurring).
I have read several related posts, and think I still don’t understand something about the piston execution basics. I think that motion sensor inactive event should cause the inner loop (where wait exists) to cease, and further “Inactivity” of the motion sensor cause that inner loop to be restarted.
I’ve only setup the first “if”, where contact changes to open as a trigger (garage door first opening should start the timeout check process)… maybe I also need to setup the later Motion Sensor “if” test conditions as another trigger – or explicitly subscribe to the motion sensor events under the settings cog?
Or, maybe I need to add an explicit “else” statement for the case of motion inactive in the inner if/then section (not logical this would be needed but whatever…)
TCP is left at default.
4) Post a Green Snapshot of the piston
(UPLOAD YOUR IMAGE HERE)
5) Attach any logs (From ST IDE and by turning logging level to Full)
10/3/2018, 8:43:53 AM +68ms
+2ms ╔Received event [HayekHome].time = 1538581434213 with a delay of -1146ms
+173ms ║Runtime (42730 bytes) successfully initialized in 119ms (v0.3.108.20180906) (169ms)
+175ms ║╔Execution stage started
+300ms ║║Executed virtual command sendPushNotification (92ms)
+314ms ║║timeout timer expired
+316ms ║║Executed virtual command log (3ms)
+325ms ║╚Execution stage complete. (151ms)
+327ms ╚Event processed successfully (327ms)
10/3/2018, 8:33:47 AM +257ms
+1ms ╔Received event [Garage Door - Ctr].contact = open with a delay of 259ms
+142ms ║Runtime (42735 bytes) successfully initialized in 91ms (v0.3.108.20180906) (140ms)
+143ms ║╔Execution stage started
+175ms ║║door opening detected
+176ms ║║Executed virtual command log (2ms)
+6939ms ║║about to start timeout timer wait
+6941ms ║║Executed virtual command log (3ms)
+6952ms ║║Executed virtual command wait (1ms)
+6955ms ║║Requesting a wake up for Wed, Oct 3 2018 @ 8:43:54 AM PDT (in 600.0s)
+6966ms ║╚Execution stage complete. (6823ms)
+6969ms ║Setting up scheduled job for Wed, Oct 3 2018 @ 8:43:54 AM PDT (in 599.988s)
+6981ms ╚Event processed successfully (6980ms)
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.