Door Auto Lock will not run by itself


#1

I’m trying to get my front door to lock if it’s been shut for longer than X minutes. To me this should be a simple task but it doesn’t want to run. I have a feeling it’s around my time settings. Figured it would be easy to see the last time it was changed, if longer than 5 mins lock the door.

When I click test it seems to run but doesn’t want to run on its own.

I’m sure I’m missing something simple but not sure as this is really my first go with WebCore.

Logs

9/3/2017, 4:33:00 PM +60ms
+0ms ╔Starting piston… (v0.2.0e5.20170812)
+168ms ║╔Subscribing to devices…
+176ms ║║Subscribing to Front Door.lock…
+187ms ║║Subscribing to Front Door Sensor.contact…
+237ms ║╚Finished subscribing (74ms)
+261ms ║Comparison (enum) unlocked is (string) unlocked = true (1ms)
+269ms ║Comparison (enum) closed is (string) closed = true (1ms)
+342ms ║Comparison (enum) closed did_not_change = true (66ms)
+353ms ╚Piston successfully started (353ms)
9/3/2017, 4:26:17 PM +927ms
+0ms ╔Starting piston… (v0.2.0e5.20170812)
+111ms ║╔Subscribing to devices…
+116ms ║║Subscribing to Front Door.lock…
+126ms ║║Subscribing to Front Door Sensor.contact…
+161ms ║╚Finished subscribing (53ms)
+180ms ║Comparison (enum) unlocked is (string) unlocked = true (1ms)
+187ms ║Comparison (enum) closed is (string) closed = true (1ms)
+236ms ║Comparison (enum) closed did_not_change = true (45ms)
+237ms ║Cancelling condition #8’s schedules…
+237ms ║Cancelling condition #6’s schedules…
+238ms ║Cancelling condition #1’s schedules…
+248ms ╚Piston successfully started (248ms)

Thanks in advance!


#2

You need to rework you IF statements. Change to the following:
If contact sensor 2 stays closed for 1 minute And Lock 1's lock is unlocked
Also no need to add groups


#3

Awesome! That did it!


#4

How ever it seems to not want to run / or check running. Is there something I need to setup to have this run (check) every few mins?


#5

Here’s how I wrote mine. It works.

//
/* Lock Schlage after 2 minutes if door is closed */
/
/

execute
if
(
Front Door Iris Sensor’s contact is closed
and
Front Door Lock’s lock is any of unknown, unlocked, or unlocked with timeout
)
then
Wait 120 seconds;
with
Front Door Lock
do
Lock;
end with;
end if;
end execute;

Take the ‘wait’ statement out of your ‘if’ conditions, and make it an action.


#6

If you want it to check every few minutes then add a timer into the mix just make sure the door is still closed


#7

Can you elaborate on what “unknown” and “unlocked with timeout” are for? I am trying to handle the case where the lock has trouble locking and it has to try more than once. I was using Steve Club’s Autolock smartapp but am trying to move that same functionality (with a few more options) to webcore.


#8

Those exist as valid lock conditions in webcore. As they all represent something other than ‘locked’ and my goal is to get the door to lock after two minutes if the contact sensor is closed, I included them in the possible conditions.

I’d hate to have the piston fail to fire because the lock is in ‘unknown’ state or something.


#9

I was pointed to ST docs in another thread, and it turns out there is a meager description of the statuses:

http://docs.smartthings.com/en/latest/capabilities-reference.html#lock

Lock
Allow for the control of a lock device
Preferences Reference
capability.lock
Attributes
lock: ENUM
The state of the lock device
locked
The device is locked
unknown
The state of the device is unknown
unlocked
The device is unlocked
unlocked with timeout
The device is unlocked with a timeout
Commands
lock()
Lock the device
unlock()
Unlock the device

Not very useful… Why even bother adding it to the documentation as is?


#10

Because if you do not account for all those possible states, you might miss something in your programming.

I’m guessing that webcore is using regex for its lock states. ‘locked’ and “the device is locked” have only one representation in the webcore options: locked. Likewise with ‘unknown’ and ‘unlocked’ and ‘timeout’. But you’d have to account for all of them. A system that does not have all represented would easily fail.


#11

I totally agree with you and will definitely follow your lead. My comment was related to ST’s documentation defining “unlocked with timeout” as “The device is unlocked with a timeout”. Nowhere does it say what can cause a timeout… is it a communication issue? Is it when the door is jammed and the locking times out?

OP - Sorry I did not mean to derail your thread.


#12

There’s no way for Lock State to know what causes comm issues; you’d have to look at the comm handler status for that.

I suppose a piston could be written that would, upon an ‘unknown’ lock state, look at the comm statuses and perhaps return something useful.


#13

It seems to be working now, I also liked the idea of using all the possible states besides “locked” to make sure it fires. I had a contractor working in the house yesterday and could see that the piston was working and locking the door after the requested time. Will monitor it for the time being.

I’m using the Sensative Strips for the door, WOW are they small and seem to work great!


#14

I have also found that my door lock would sometimes report ‘unknown’ so I put this in the bottom of my piston for checking…


#15

A followup: the Lock Manager smart app provides a “lock jammed” PUSH notification if the lock gets jammed.

Oh, and I’m deleting the schedule from Lock Manager and relying entirely on the “every second Thursday” mode piston. Reasoning: a) less complex, therefore less that can go wrong. B) if I ever need to adjust that day on the fly, all I have to do is change the mode… instead of changing both the mode AND the lock Manager schedule.


#16

hello,
I do need help for lock jammed SMS notification, I couldn’t find the right Value to make work, I’m using Rboy Lock manager


thank you


#17

Try this way…

if
    Door Lock's lock is any of unknown or unlocked with timeout
    and
    Contact Sensor's contact is closed
then
    repeat
    do
        with
            Contact Sensor 2
        do
            Send SMS...
            Wait 5 minutes...
        end with;
    until
        Contact Sensor's lock is locked
    end repeat;
end if;

Edit: Here’s a snippet of how I have mine set up from a while back…


#18

thank you, ill try it


#19


that my final thanks for your help