1) Give a description of the problem
have a motion sensor that turns on a virtual switch - I want it to wait X amount of time, and if it hasn’t detected more motion (i.e. motion=inactive), then turn off that virtual switch
2) What is the expected behaviour?
- Motion Sensor detects motion & turns on Contact Sensor
- wait X amount of time (30 seconds in my sample, but 20 mins in real life)
3a) if the motion sensor was not triggered again, turn off the Contact Sensor
3b) if the motion sensor was triggered again in the X window, restart the timer
3) What is happening/not happening?
- Motion Sensor detects motion & turns on Contact Sensor
- Motion Sensor stops detecting motion inside the X amount of time (so <30 secs in my example)
- Piston runs through because it is subscribed to the Motion Sensor, but cancels the pending timer task
- because the timer task is cancelled, the Contact Sensor never gets turned off
I have tried changing the “Task Execution Policy” (and currently have it set to ‘never cancel’, though that does not seem to be affecting this issue), and I think this is probably something small, but I can’t seem to figure it out!
Thank you in advance for any help - love this forum!
**4) Post a Green Snapshot of the piston![image|45x37]![image|690x361]
5) Attach logs after turning logging level to Full
8/10/2020, 12:03:47 AM +577ms
+99ms ╔Stopping piston…
+260ms ╚Piston successfully stopped (161ms)
8/10/2020, 12:03:43 AM +971ms
+0ms ╔Received event [9011Florian].time = 1597043006397 with a delay of 17574ms
+226ms ║RunTime Analysis CS > 16ms > PS > 199ms > PE > 11ms > CE
+228ms ║Runtime (37862 bytes) successfully initialized in 199ms (v0.3.110.20191009) (227ms)
+229ms ║╔Execution stage started
+230ms ║╚Execution stage complete. (1ms)
+231ms ╚Event processed successfully (231ms)
8/10/2020, 12:03:02 AM +52ms
+2ms ╔Received event [Microwave].motion = inactive with a delay of 91ms
+90ms ║RunTime Analysis CS > 19ms > PS > 59ms > PE > 12ms > CE
+92ms ║Runtime (37847 bytes) successfully initialized in 59ms (v0.3.110.20191009) (90ms)
+93ms ║╔Execution stage started
+100ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+101ms ║║Cancelling condition #2’s schedules…
+102ms ║║Condition #2 evaluated false (5ms)
+103ms ║║Cancelling condition #1’s schedules…
+103ms ║║Condition group #1 evaluated false (state changed) (6ms)
+105ms ║╚Execution stage complete. (12ms)
+106ms ╚Event processed successfully (106ms)
8/10/2020, 12:02:56 AM +82ms
+1ms ╔Received event [Microwave].motion = active with a delay of 111ms
+109ms ║RunTime Analysis CS > 23ms > PS > 70ms > PE > 17ms > CE
+111ms ║Runtime (37849 bytes) successfully initialized in 70ms (v0.3.110.20191009) (109ms)
+112ms ║╔Execution stage started
+119ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+120ms ║║Cancelling condition #2’s schedules…
+121ms ║║Condition #2 evaluated true (5ms)
+122ms ║║Cancelling condition #1’s schedules…
+123ms ║║Condition group #1 evaluated true (state changed) (7ms)
+125ms ║║Cancelling statement #3’s schedules…
+130ms ║║Calculating (string) Turning on pause due to motion at + (string) Mon, Aug 10 2020 @ 12:02:56 AM MST >> (string) Turning on pause due to motion at Mon, Aug 10 2020 @ 12:02:56 AM MST
+134ms ║║Executed virtual command [PauseOfficeLight].setState (1ms)
+310ms ║║Executed physical command [null].on() (173ms)
+310ms ║║Executed [PauseOfficeLight].on (175ms)
+314ms ║║Executed virtual command [PauseOfficeLight].wait (0ms)
+315ms ║║Requesting a wake up for Mon, Aug 10 2020 @ 12:03:26 AM MST (in 30.0s)
+319ms ║╚Execution stage complete. (206ms)
+320ms ║Setting up scheduled job for Mon, Aug 10 2020 @ 12:03:26 AM MST (in 29.996s)
+326ms ╚Event processed successfully (326ms)
8/10/2020, 12:02:43 AM +686ms
+1ms ╔Starting piston… (v0.3.110.20191009)
+888ms ║╔Subscribing to devices…
+893ms ║║Subscribing to Microwave.motion…
+1108ms ║║Subscribing to PauseOfficeLight…
+1109ms ║╚Finished subscribing (229ms)
+1143ms ╚Piston successfully started (1143ms)