Lights not respecting timer based on door open


#1

1) Give a description of the problem
Piston not respecting timer

2) What is the expected behavior?
When door sensor changes to open, lights turn on, wait 10 minutes, then turn off

3) What is happening/not happening?
Lights turn on, but do not turn off after 10 minutes

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
8:59:44 PM: info ╔ Event processed successfully (203ms)
8:59:44 PM: debug ║║ Cancelling condition #1’s schedules…
8:59:44 PM: debug ║║ Condition #6 evaluated true (28ms)
8:59:44 PM: debug ║║ Cancelling condition #7’s schedules…
8:59:44 PM: debug ║║ Comparison (enum) closed changes_to (string) open = false (0ms)
8:59:44 PM: debug ║║ Comparison (time) 75584800 is_between (datetime) 1508712420000 … (datetime) 1508671740000 = true (5ms)
8:59:44 PM: debug ║║ Time restriction check passed
8:59:44 PM: trace ║╚ Execution stage started
8:59:44 PM: trace ║ Runtime (37130 bytes) successfully initialized in 79ms (v0.2.0fa.20171011) (147ms)
8:59:44 PM: debug ║ RunTime Analysis CS > 28ms > PS > 79ms > PE > 27ms > CE
8:59:44 PM: info ╚ Received event [Front Door].contact = closed with a delay of 915ms
8:59:40 PM: trace ║║ Requesting a wake up for Sun, Oct 22 2017 @ 9:09:40 PM EDT (in 600.0s)
8:59:40 PM: debug ║║ Cancelling statement #2’s schedules…
8:59:40 PM: trace ║║ Executed [Front Porch Light].on (18ms)
8:59:40 PM: debug ║║ Condition group #1 evaluated true (state changed) (38ms)
8:59:40 PM: debug ║║ Condition #7 evaluated true (7ms)
8:59:40 PM: debug ║║ Executed physical command [Front Porch Light].on() (16ms)
8:59:40 PM: debug ║║ Cancelling condition #7’s schedules…
8:59:40 PM: debug ║║ Executed physical command [Front (South) Flood Light].on() (20ms)
8:59:40 PM: debug ║║ Comparison (enum) open changes_to (string) open = true (1ms)
8:59:40 PM: debug ║║ Cancelling condition #1’s schedules…
8:59:40 PM: debug ║║ Condition #6 evaluated true (27ms)
8:59:40 PM: debug ║║ Time restriction check passed
8:59:40 PM: debug ║║ Comparison (time) 75580894 is_between (datetime) 1508712420000 … (datetime) 1508671740000 = true (6ms)
8:59:40 PM: trace ║╚ Execution stage started
8:59:40 PM: trace ║ Runtime (37134 bytes) successfully initialized in 50ms (v0.2.0fa.20171011) (89ms)
8:59:40 PM: debug ║ RunTime Analysis CS > 12ms > PS > 50ms > PE > 20ms > CE
8:59:40 PM: info ╚ Received event [Front Door].contact = open with a delay of 330ms

I have a similar piston with the same basic structure for when presence sensors are changed to present and it works as expected, so I’m not sure what went wrong here.


#2

Its being canceled, because the condition that caused the wait changed… It took a while to understand this myself.

In short, the If Condition says if the contact is ‘open’, when it changes to ‘closed’ any pending tasks are canceled. You can change this by clicking on the “with” and clicking the advanced options (the gear) and changing the “Task Cancellation Policy” to Never.

All of this is because the default for “Task Cancellation Policy” is [as follows from the wiki] (This is the default option and will cancel any pending tasks if the parent condition’s state changes. If the tasks are not executed as part of an IF statement, then this option is the same as Never cancel tasks)


#3

Wow! NEVER would have seen that one. Thanks, I’ve made the change and will report back.


#4

That did the job, thank you!