Piston doesn't recognize door already locked


#1

1) Give a description of the problem
Simple Lock piston to lock the front door when away

2) What is the expected behavior?
Lock front door when present sensor is away and lock is not locked

3) What is happening/not happening?
Present sensors work find but, When leaving if I don’t lock the front door, it will lock correctly when the present sensor show away. However if I lock the front door and leave, when the present sensor shows away, then the door unlocks

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(2/7/2018, 1:20:40 PM +693ms
+2ms ╔Received event [Eric].presence = present with a delay of 68ms
+135ms ║RunTime Analysis CS > 23ms > PS > 39ms > PE > 73ms > CE
+137ms ║Runtime (38053 bytes) successfully initialized in 39ms (v0.2.102.20180116) (135ms)
+138ms ║╔Execution stage started
+152ms ║║Comparison (enum) not present is (string) not present = true (1ms)
+155ms ║║Comparison (enum) present is (string) not present = false (1ms)
+156ms ║║Cancelling condition #8’s schedules…
+157ms ║║Condition #8 evaluated false (13ms)
+158ms ║║Condition group #1 evaluated false (state did not change) (15ms)
+167ms ║║Comparison (enum) present changes_to (string) present = true (1ms)
+169ms ║║Cancelling condition #5’s schedules…
+170ms ║║Condition #5 evaluated true (9ms)
+170ms ║║Cancelling condition #2’s schedules…
+171ms ║║Condition group #2 evaluated true (state changed) (11ms)
+174ms ║║Cancelling statement #3’s schedules…
+2313ms ║║Executed physical command [Front Door Lock].unlock() (2136ms)
+2314ms ║║Executed [Front Door Lock].unlock (2137ms)
+2336ms ║║Executed virtual command [Front Door Lock].setAlarmSystemStatus (18ms)
+2339ms ║╚Execution stage complete. (2201ms)
+2340ms ╚Event processed successfully (2340ms))

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Can you paste logs from a time you’re leaving and it unlocks the door? The log you posted is from when you arrived home and it unlocked the door for you. Can’t really troubleshoot anything there - and the piston looks to be written correct at first glance.


#3

oops sorry, here is the rest

2/7/2018, 12:55:30 PM +479ms
+1ms ╔Received event [Eric].presence = not present with a delay of 92ms
+133ms ║RunTime Analysis CS > 23ms > PS > 38ms > PE > 73ms > CE
+135ms ║Runtime (38055 bytes) successfully initialized in 38ms (v0.2.102.20180116) (133ms)
+136ms ║╔Execution stage started
+151ms ║║Comparison (enum) not present is (string) not present = true (2ms)
+153ms ║║Comparison (enum) not present is (string) not present = true (2ms)
+154ms ║║Cancelling condition #8’s schedules…
+155ms ║║Condition #8 evaluated true (13ms)
+164ms ║║Comparison (enum) locked is_not (string) locked = false (2ms)
+165ms ║║Cancelling condition #11’s schedules…
+166ms ║║Condition #11 evaluated false (10ms)
+167ms ║║Condition group #1 evaluated false (state did not change) (25ms)
+176ms ║║Comparison (enum) not present changes_to (string) present = false (1ms)
+177ms ║║Condition #5 evaluated false (8ms)
+178ms ║║Condition group #2 evaluated false (state did not change) (9ms)
+181ms ║╚Execution stage complete. (45ms)
+182ms ╚Event processed successfully (182ms)


#4

Thanks!

According to this one, no action was taken with the door lock because it was already locked. What makes you think the door is being unlocked by the piston? It is showing unlocked in SmartThings?


#5

Just a guess here… you are manually locking the door, then leaving.
Your presence sensor still shows as ‘present’ because it reports every 30 seconds, and from the moment you’ve locked the door and started to walk away the sensor is telling ST you are present - because you’ve not gotten far enough away for ST to no longer receive the signal. So it says “presence sensor is present, and the rule stipulates that if either presence sensor is present the door needs to be unlocked”… and it unlocks the door according to that rule!

I’ll look at this later when I get home.


#6

His 2nd IF statement is “changes to present” so it would evaluate false once he has been home more than 10 seconds or so.


#7

Ok here is a full log of me leaving and locking the door, I then get notified that it is unlocked. I starting to think Glen_King might be right with the present sensor, but if he is then why when the door is locked at 8:30pm for the night with another piston, that this doesn’t unlock the door also, as we are both home

.+1ms ╔Received event [Eric].presence = present with a delay of 57ms
+80ms ║RunTime Analysis CS > 17ms > PS > 37ms > PE > 26ms > CE
+82ms ║Runtime (38052 bytes) successfully initialized in 37ms (v0.2.102.20180116) (80ms)
+83ms ║╔Execution stage started
+98ms ║║Comparison (enum) not present is (string) not present = true (1ms)
+100ms ║║Comparison (enum) present is (string) not present = false (2ms)
+101ms ║║Cancelling condition #8’s schedules…
+102ms ║║Condition #8 evaluated false (14ms)
+103ms ║║Condition group #1 evaluated false (state did not change) (15ms)
+112ms ║║Comparison (enum) present changes_to (string) present = true (1ms)
+113ms ║║Cancelling condition #5’s schedules…
+114ms ║║Condition #5 evaluated true (9ms)
+115ms ║║Cancelling condition #2’s schedules…
+116ms ║║Condition group #2 evaluated true (state changed) (11ms)
+118ms ║║Cancelling statement #3’s schedules…
+125ms ║║Skipped execution of physical command [Front Door Lock].unlock([]) because it would make no change to the device. (3ms)
+126ms ║║Executed [Front Door Lock].unlock (4ms)
+137ms ║║Executed virtual command [Front Door Lock].setAlarmSystemStatus (9ms)
+140ms ║╚Execution stage complete. (57ms)
+141ms ╚Event processed successfully (141ms)
2/7/2018, 3:31:25 PM +403ms
+2ms ╔Received event [Eric].presence = not present with a delay of 62ms
+90ms ║RunTime Analysis CS > 19ms > PS > 41ms > PE > 29ms > CE
+92ms ║Runtime (38051 bytes) successfully initialized in 41ms (v0.2.102.20180116) (89ms)
+93ms ║╔Execution stage started
+107ms ║║Comparison (enum) not present is (string) not present = true (1ms)
+109ms ║║Comparison (enum) not present is (string) not present = true (1ms)
+111ms ║║Cancelling condition #8’s schedules…
+112ms ║║Condition #8 evaluated true (13ms)
+121ms ║║Comparison (enum) locked is_not (string) locked = false (2ms)
+122ms ║║Condition #11 evaluated false (10ms)
+123ms ║║Condition group #1 evaluated false (state did not change) (25ms)
+132ms ║║Comparison (enum) not present changes_to (string) present = false (1ms)
+134ms ║║Cancelling condition #5’s schedules…
+134ms ║║Condition #5 evaluated false (9ms)
+135ms ║║Cancelling condition #2’s schedules…
+136ms ║║Condition group #2 evaluated false (state changed) (11ms)
+139ms ║╚Execution stage complete. (46ms)
+140ms ╚Event processed successfully (140ms)


#8

Ahh, you are right. Missed that detail.

Would be interesting to see the event logs for the individual devices, and see what they are doing at those moments.


#9

I’m not sure what the timestamp is on the first event in the log - it was clipped off.

But at any rate, that time it shows you arriving home so it would have unlocked the door but it was already unlocked. No action taken by the piston, but it evaluated correctly for how it’s written.

At 3:31 when it shows you leaving, it shows the door is locked already so no action is taken again. Nothing in the logs shows the door being unlocked by either event.

Is this lock controlled by any other pistons? Can you view it on SmartThings and post a screenshot of its events?


#10

Well I think I found it when you wanted to see the event logs for individual devices. It looks as though my other piston is unlocking it.

Date Source Type Name Value User Displayed Text
2018-02-07 3:31:30.731 PM CST
14 minutes ago DEVICE lock unlocked Front Door Lock lock is unlocked
2018-02-07 3:31:25.651 PM CST
14 minutes ago APP_COMMAND unlock Auto Lock Front Door at Night sent unlock command to Front Door Lock

I guess I’ll need to change the else statement.
Thanks guys this was driving me nuts.


#11

Thanks Glen_King for wanting to look at the device log, that showed the problem. I hadn’t thought of looking there. I changed the other piston and it seems to be working now.
Thank-you michicago for taking the time to look at it also.