1) Give a description of the problem
I’m trying to use either “Lock stays away from locked” or “Lock stays any of unlocked, unknown” for 30 seconds to trigger an error message texted to my phone (via tmomail.net email). Unfortunately, I don’t seem to have a full understanding of the way the Stays trigger operates since both of those options seem to always send the email. The idea is to only send the email if the lock completely fails to lock, but don’t send an email if it locks but is then immediately unlocked manually.
2) What is the expected behaviour?
I expect the lock to be locked after the door is unlocked and closed for 30 seconds, which works. I then expect the stays away from trigger to wait 30 seconds, and if the lock isn’t locked within that time period then a text message is sent.
3) What is happening/not happening?
The trigger waits 30 seconds as expected, but then at the end of the wait it always evaluates as true, even though the lock was successfully locked and it’s current state is equal to the “stays away from” condition. I am able to force it to work by putting a wait 30 after the lock command with TCP set to never, but I still fail to understand why the “stays away from” command is not being evaluated in an intuitive manner.
4)
5) Attach logs after turning logging level to Full
1/17/2021, 6:13:09 PM +34ms
+3ms ╔Received event [Redacted’s House].wc_async_reply = sendEmail with a delay of 1ms, canQueue: true, calledMyself: false
+26ms ║RunTime initialize > 25 LockT > 1ms > rtDT > 1ms > pistonT > 0ms (first state access 23 5 20)
+29ms ║Runtime (6948 bytes) successfully initialized in 1ms (v0.3.110.20201015_HE)
+35ms ║╔Execution stage started
+49ms ║╚Execution stage complete. (13ms)
+74ms ╚Event processed successfully (72ms)
1/17/2021, 6:13:07 PM +961ms
+5ms ╔Received event [Redacted’s House].time = 1610935988361 with a delay of -400ms, canQueue: true, calledMyself: false
+30ms ║RunTime initialize > 29 LockT > 1ms > rtDT > 1ms > pistonT > 0ms (first state access 27 6 23)
+32ms ║Runtime (6942 bytes) successfully initialized in 1ms (v0.3.110.20201015_HE)
+36ms ║Synchronizing scheduled event, waiting for 365ms
+408ms ║╔Execution stage started
+432ms ║║Cancelling condition #15’s schedules…
+434ms ║║Condition #15 evaluated true (2ms)
+436ms ║║Cancelling condition #14’s schedules…
+438ms ║║Condition group #14 evaluated true (state changed) (7ms)
+440ms ║║Cancelling statement #24’s schedules…
+449ms ║║Executed virtual command sendEmail (2ms)
+451ms ║║Requesting a wake up for Sun, Jan 17 2021 @ 6:13:32 PM PST (in 24s)
+461ms ║╚Execution stage complete. (54ms)
+502ms ║Setting up scheduled job for Sun, Jan 17 2021 @ 6:13:32 PM PST (in 24s)
+504ms ╚Event processed successfully (502ms)
1/17/2021, 6:12:40 PM +829ms
+3ms ╔Received event [Front Door Lock].lock = locked with a delay of 44ms, canQueue: true, calledMyself: false
+25ms ║RunTime initialize > 23 LockT > 2ms > rtDT > 1ms > pistonT > 0ms (first state access 20 5 18)
+27ms ║Runtime (6926 bytes) successfully initialized in 1ms (v0.3.110.20201015_HE)
+28ms ║╔Execution stage started
+40ms ║║Comparison (enum) closed is (string) closed = true (3ms)
+42ms ║║Condition #3 evaluated true (9ms)
+50ms ║║Comparison (enum) locked is (string) unlocked = false (1ms)
+52ms ║║Cancelling condition #21’s schedules…
+53ms ║║Condition #21 evaluated false (9ms)
+55ms ║║Cancelling condition #2’s schedules…
+56ms ║║Condition group #2 evaluated false (state changed) (23ms)
+58ms ║║Cancelling condition #1’s schedules…
+59ms ║║Condition group #1 evaluated false (state changed) (27ms)
+65ms ║╚Execution stage complete. (37ms)
+121ms ║Setting up scheduled job for Sun, Jan 17 2021 @ 6:13:08 PM PST (in 27s)
+123ms ╚Event processed successfully (122ms)
1/17/2021, 6:12:38 PM +244ms
+3ms ╔Received event [Redacted’s House].time = 1610935958119 with a delay of 125ms, canQueue: true, calledMyself: false
+65ms ║RunTime initialize > 64 LockT > 1ms > rtDT > 2ms > pistonT > 1ms (first state access 61 4 60)
+67ms ║Runtime (6929 bytes) successfully initialized in 2ms (v0.3.110.20201015_HE)
+72ms ║╔Execution stage started
+84ms ║║Cancelling statement #5’s schedules…
+100ms ║║Executed physical command [Front Door Lock].lock() (11ms)
+102ms ║║Executed [Front Door Lock].lock (13ms)
+112ms ║║Comparison (enum) unlocked stays_away_from (string) locked = true (1ms)
+117ms ║║Adding a timed trigger schedule for condition 15
+119ms ║║Condition #15 evaluated false (15ms)
+121ms ║║Condition group #14 evaluated false (state did not change) (16ms)
+128ms ║╚Execution stage complete. (55ms)
+162ms ║Setting up scheduled job for Sun, Jan 17 2021 @ 6:13:08 PM PST (in 30s)
+164ms ╚Event processed successfully (163ms)
1/17/2021, 6:12:07 PM +976ms
+4ms ╔Received event [Front Door Lock].lock = unlocked with a delay of 69ms, canQueue: true, calledMyself: false
+73ms ║RunTime initialize > 72 LockT > 3ms > rtDT > 53ms > pistonT > 52ms (first state access 16 7 65)
+77ms ║Runtime (6865 bytes) successfully initialized in 53ms (v0.3.110.20201015_HE)
+80ms ║╔Execution stage started
+96ms ║║Comparison (enum) closed is (string) closed = true (2ms)
+99ms ║║Condition #3 evaluated true (11ms)
+110ms ║║Comparison (enum) unlocked is (string) unlocked = true (4ms)
+112ms ║║Cancelling condition #21’s schedules…
+114ms ║║Condition #21 evaluated true (13ms)
+117ms ║║Cancelling condition #2’s schedules…
+119ms ║║Condition group #2 evaluated true (state changed) (32ms)
+121ms ║║Cancelling condition #1’s schedules…
+124ms ║║Condition group #1 evaluated true (state changed) (38ms)
+127ms ║║Cancelling statement #22’s schedules…
+136ms ║║Executed virtual command wait (1ms)
+142ms ║║Requesting a wake up for Sun, Jan 17 2021 @ 6:12:38 PM PST (in 30s)
+161ms ║╚Execution stage complete. (81ms)
+258ms ║Setting up scheduled job for Sun, Jan 17 2021 @ 6:12:38 PM PST (in 30s)
+260ms ╚Event processed successfully (260ms)