Re-locking a door if still unlocked after 30 minutes

I have a scene that set a command to lock the door 30 minutes after the event “door unlocked” is received.

It works well. Simple scene: one event (“A door is opened or closed” with mode “Opened”), one command( #39 _Kwikset Door Lock Unchanged – After 30 minutes: Lock), but I noticed that the “relock” command will alway be sent even if the door is already “relocked” ( I can ear the actuator); therefore it uses batteries for nothing).

What can be done to just sent the “lock” command if the door is still unlocked ? Another scene to cancel the first one (how do we do that?) when an event reports that the door is locked ? Other suggestions ?

Thanks

wait a minute, so the door is already re-locked? and then you hear the actuator kicking in again? do you know if its the lock itself that is doing it? My locks will re-lock if I open them (from the outside).

They really need an option in Vera, “If Unlocked Button is Pressed” - not just opened/closed and not just the lock button being pressed. I understand what you’re getting at with what you are trying to do. I wouldn’t want my locks to remain open either if someone inside unlocked them.

I think the reason that this might be happening for you is because its basically a timed event, 30 minutes pass and Vera tells the lock to re-lock, it doesn’t know its state as there is no conditional present. So this means that Vera will send the lock command even if its already locked. There isn’t anything stipulating to only lock the lock if its unlocked.

The only option that I can think of to use with what Vera offers is “A Pin Code is Entered”, however that’s only from the outside and it won’t work if someone presses the unlock button from the inside. Perhaps, someone can hook you up with some Lua code for a scene that can poll the status of the lock and if the lock is unlocked and it has been 30 minutes then a re-lock command is sent. I’m not that great with Lua or I’d try to hook you up. I’m still learning myself. :confused: lol.

This could be used to check Door Status:

function checkdoorstatus()
if( luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”,54)==“0” ) then
luup.log(“Sensor Not Tripped, ending scene”)
stilltripped = “0”
else
luup.log(“Sensor is still tripped!”)
stilltripped = “1”
end
end

luup.call_timer(“checkdoorstatus”, 1, “30m”, “”, “”)

if (stilltripped == “0”) then
return false
end

…you learn fast iflyM3.

I think it is going to work if I do it the way you propose, but I would like to work on an event based strategy (instead of timed one) because the device is battery operated.

In fact, it would be perfect if I could keep the actual scene and add another event driven scene that would just delete the “timer” set by the other scene when it received a “lock event”.

Is it possible ?

When setting up a scene, there is an advanced tab.

In that tab, it is possible to say that “scene is active” and one choice “when all devices in the scene are properly set” and then another field “Pick a device”, and another one “or add a delay of:”.

Someone can explain it ?

Thanks

ok: http://docs2.mios.com/doc.php?language=1&page=advanced_scenes&version=1&skin=mios&firmware=1.1.1047&platform=2&manual=1

Understood, for what is explained. Quite powerful tool, but not clear how I can check the status of a door-lock. I can “Get status”, but don’t know how to test it.

@iflyM3, I noticed that no one added to you LUA code… Has someone developed a LUA snippet that will assess the status of a Kwikset lock, if locked leave alone, if not after X minutes issue a lock command. thanxs in advance Mike

@huogas did you ever get your original problem resolved? looking at the @iflyM3 example IMHO I don’t think it will work for kwikset locks to find the status I believe the following statement is needed;

[ul][li]if( luup.variable_get(“urn:micasaverde-com:serviceId:DoorLockSensor1”,“Status”,27)[/ul]