Trouble with Door Lock


#1

1) Give a description of the problem
I have a Yale doorlock that I’m trying to get setup to automatically lock based on certain conditions, but it sometimes locks when the door contact is open.

2) What is the expected behavior?
I would like for the door to automatically lock if 1) The door contact is closed 2) The door is unlocked and 3) Outside switch is turned off. I want a 3 minute delay for the door to lock if those conditions are met.

3) What is happening/not happening?
Sometimes as soon as the door is opened it will lock itself even though the door contact is open.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
`10/18/2017, 5:18:42 PM +444ms
+1ms ╔Received event [Front Door Lock].lock = locked with a delay of 604ms
+149ms ║RunTime Analysis CS > 15ms > PS > 41ms > PE > 93ms > CE
+158ms ║Runtime (37463 bytes) successfully initialized in 41ms (v0.2.0f9.20171007) (156ms)
+160ms ║╔Execution stage started
+176ms ║║Comparison (enum) open is (string) closed = false (2ms)
+178ms ║║Condition #6 evaluated false (12ms)
+179ms ║║Condition group #5 evaluated false (state did not change) (13ms)
+180ms ║║Condition group #1 evaluated false (state did not change) (15ms)
+182ms ║╚Execution stage complete. (23ms)
+191ms ╚Event processed successfully (191ms)

10/18/2017, 5:18:40 PM +36ms
+1ms ╔Received event [Front Door Lock].lock = unlocked with a delay of 491ms
+448ms ║RunTime Analysis CS > 20ms > PS > 306ms > PE > 122ms > CE
+461ms ║Piston waited at a semaphore for 257ms
+463ms ║Runtime (37534 bytes) successfully initialized in 306ms (v0.2.0f9.20171007) (461ms)
+464ms ║╔Execution stage started
+479ms ║║Comparison (enum) open is (string) closed = false (2ms)
+480ms ║║Condition #6 evaluated false (9ms)
+481ms ║║Condition group #5 evaluated false (state did not change) (11ms)
+482ms ║║Condition group #1 evaluated false (state did not change) (12ms)
+484ms ║╚Execution stage complete. (21ms)
+491ms ╚Event processed successfully (491ms)

10/18/2017, 5:18:40 PM +13ms
+1ms ╔Received event [Front Door].contact = open with a delay of 504ms
+139ms ║RunTime Analysis CS > 16ms > PS > 37ms > PE > 86ms > CE
+147ms ║Runtime (37460 bytes) successfully initialized in 37ms (v0.2.0f9.20171007) (144ms)
+147ms ║╔Execution stage started
+158ms ║║Comparison (enum) open is (string) closed = false (1ms)
+159ms ║║Cancelling condition #6’s schedules…
+160ms ║║Condition #6 evaluated false (6ms)
+160ms ║║Condition group #5 evaluated false (state did not change) (7ms)
+161ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+163ms ║╚Execution stage complete. (16ms)
+170ms ╚Event processed successfully (170ms)`

I’ve been struggling with this piston for a long time trying to make it work correctly, but it always seems like it will lock when the door is open at random times. I have done a lot of searching and reading about similar pistons but for some reason I can’t get this to work flawlessly. Thanks for any help!


#2

Give this a try. I don’t have a lock so that is why the xxxxxx


#3

Thanks for the response. I’ve updated the piston to replicate what you have. I’m not 100% sure, but I think I’ve had it set the same way before, but I’ll give it a shot again and update if I still get unexpected results.


#4

Ok, so I’ve had a few instances recently where the door locks when its opened. Here’s the log from a few minutes ago.

3/14/2018, 7:26:12 PM +853ms
+1ms ╔Received event [Front Door Lock].lock = locked with a delay of 101ms
+187ms ║RunTime Analysis CS > 19ms > PS > 81ms > PE > 87ms > CE
+189ms ║Runtime (37769 bytes) successfully initialized in 81ms (v0.3.000.20180224) (188ms)
+190ms ║╔Execution stage started
+201ms ║║Comparison (enum) open is (string) closed = false (1ms)
+202ms ║║Condition #12 evaluated false (8ms)
+203ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+205ms ║╚Execution stage complete. (14ms)
+206ms ╚Event processed successfully (205ms)
3/14/2018, 7:26:07 PM +690ms
+1ms ╔Received event [Front Door].contact = open with a delay of 742ms
+158ms ║RunTime Analysis CS > 19ms > PS > 44ms > PE > 95ms > CE
+160ms ║Runtime (37762 bytes) successfully initialized in 44ms (v0.3.000.20180224) (158ms)
+161ms ║╔Execution stage started
+169ms ║║Comparison (enum) open is (string) closed = false (1ms)
+171ms ║║Cancelling condition #12’s schedules…
+171ms ║║Condition #12 evaluated false (5ms)
+172ms ║║Cancelling condition #1’s schedules…
+173ms ║║Condition group #1 evaluated false (state changed) (7ms)
+175ms ║╚Execution stage complete. (14ms)
+176ms ╚Event processed successfully (176ms)
3/14/2018, 7:26:06 PM +385ms
+1ms ╔Received event [Front Door Lock].lock = unlocked with a delay of 120ms
+185ms ║RunTime Analysis CS > 32ms > PS > 42ms > PE > 112ms > CE
+188ms ║Runtime (37772 bytes) successfully initialized in 42ms (v0.3.000.20180224) (185ms)
+189ms ║╔Execution stage started
+201ms ║║Comparison (enum) closed is (string) closed = true (1ms)
+202ms ║║Condition #12 evaluated true (9ms)
+209ms ║║Comparison (enum) off is (string) off = true (1ms)
+211ms ║║Condition #13 evaluated true (8ms)
+216ms ║║Comparison (enum) unlocked is_any_of (string) unknown,unlocked,unlocked with timeout = true (1ms)
+217ms ║║Cancelling condition #14’s schedules…
+218ms ║║Condition #14 evaluated true (6ms)
+218ms ║║Cancelling condition #1’s schedules…
+219ms ║║Condition group #1 evaluated true (state changed) (26ms)
+221ms ║║Cancelling statement #9’s schedules…
+226ms ║║Executed virtual command [Front Door Lock].wait (1ms)
+227ms ║║Requesting a wake up for Wed, Mar 14 2018 @ 7:29:06 PM CDT (in 180.0s)
+231ms ║╚Execution stage complete. (43ms)
+233ms ║Setting up scheduled job for Wed, Mar 14 2018 @ 7:29:06 PM CDT (in 179.996s)
+241ms ╚Event processed successfully (241ms)