Newbie help - auto lock


#1

Trying to create my first basic piston. It is a simple piston locking the door if the door sensor is closed and it’s been unlocked for 2 min.

My issue is, this only seems to trigger after testing ~20 percent of the time. The times it triggers it works fine but the other time cant trace what might be different.

Any help appreciated


#2

There’s been some issues with ST’s reliability lately so it might not be a good time to troubleshoot that. It might be the cause of the spotty performance.


#3

One tip: You might want to switch your trigger and condition around:

if front door sensor stays closed for 2 minutes
    and
   Schlage Touchscreen Deadbolt Door Lock is unlocked
 then
    lock
endif

The reason for this is that as you have it written, if someone leaves the door open for two minutes, then the lock will never lock because the lock unlocked for two m minutes will have already happened.


#4

You may need to think about when you want the piston to run.

As ‘stays’ is classed as a trigger, the piston has subscribed to the door lock and will fire whenever the door is locked or unlocked (the lightning bolt symbol shows you the lines where there are subscriptions).

To cut a long story short, once it fires it will check if the door is unlocked and stays that way for a further two minutes, and at that point it will check if the door is closed and go on to lock the door if it is.

Is that really what you want? @guxdude has offered an alternative where it is the door being opened or closed that fires the piston and if the door is closed and stays that way for two minutes, then the door is locked if necessary. That makes more sense to me, but then it isn’t my door.


#5

I have two schlage locks and yes as other said, it can be not so reliable (St hub issues etc)
I’d highly recommend add another piston or two for safety check.

I have a piston controls the lock - just like yours - but another two piston checks after to see if it was really locked. (by using global variables)