Schlage Lock - Activate Scene when locking door externally?

I could use some help in having my “leave home” scene activate when I leave my house and press the schlage button and turn my deadbolt handle. I thought attaching some commands to the “Lock button is pressed” would do it but it’s not working.

Does anyone have appropriate luup code or some other tip to get this working (if possible)?

Right now I just have it set to when “A door is open or closed: closed”. But that’s annoying when I enter my home and lock the door behind me, it turns everything off in my home upon entry.

Any help would be greatly appreciated.


The new beta firmware has a “if lock button is pushed” choice so you will be able to do that soon and have it work only when you leave. Of course you would have to remember if someone is home and you are leavining you will leave them in darkness.

In my last house, I left the light on for 3 minutes after someone used the door. That way the light didn’t stay on too long and no one was left in the dark. Just a thought until the new beta comes out.

I didn’t realize I have the beta because the “if lock button is pushed” option is showing up in my options. If I’m going to have to wait for vera to implement this further, I guess I shouldn’t hold my breath.

My hopes is that the “if lock button is pushed” feature starts to work, and I’ll be able to use it only when leaving my home. If anyone else is leaving my home I’ll just be locking the door from the inside when they leave. I do find a “leave home” scene quite useful though. If anyone else has a similar scene and special circumstances as to when they use it, I’d love to hear about.

For now I’ve been accessing vera via the ivera app and running the scene when I leave my home. It sucks though when I come home and realize I forgot to run the scene and see all my lights are on as well as the AC. It would be nice if it was automated.

What do you do when you are not leaving but want to lock the door while at home? Everything turns off and your left in the dark? I tried that for a while but changes it to a scene button at the front door. My scene turns off all inside lights, locks all doors, turns off the water supply, arms all motion and door/windows sensors, if it is dark out it will turn on the outside lights for 5 minutes. It doesn’t take long before it becomes a habit to press an button on exit. If for some reason I forget I can remotely activate the scene or even have this scene activate on a weekly timer.

We only use the Schlage button to lock the door when someone is home.
If the house is empty, we use a code labeled Arm Away to lock the door which arms my door / window sensors, and turns everything off.


I did something similar to what JimMac did.

I have a 5 button scene controller that controls lighting in my kitchen. The last (bottom) button is used to control a scene. The scene is a “leaving the house” scene. It turns all interior lights off, turns on the garage light for 10 minutes (then turns it back off), adjusts the temperature of the house, and locks all of the doors.

This setup has been in use for around a year, and has never caused me any issues.

[quote=“JOD, post:6, topic:167453”]We only use the Schlage button to lock the door when someone is home.
If the house is empty, we use a code labeled Arm Away to lock the door which arms my door / window sensors, and turns everything off.


That’s a good solution. It would be nice if you could just make a code that only allows the lock to lock and not open so you could just hit 1111 and lock it but maybe I’m asking too much.

@Reptile I was running the .1155 firmware so I didn’t know if the one you were running had “if lock button is pushed” or not. I thought maybe it didn’t because I figured you would have tried that first and let us know if it worked. I haven’t tested it on mine yet.

What if you had scene activated by a PIN that included all your turn on or turn off actions, but included an action of locking the lock? Would that do it for you?

That is what I have always done. I close the door and punch in my “leave home code”. The door locks itself back, the interior lights go off and if it is night the outdoor lights come on for a couple of minutes. The thermostat also goes to a lower heat and higher air conditioner setpoint.

How do you do to turn on the lights “IF” it is night?

Add the Lua statement to the ‘Luup’ tab of your scene.

If you want a more local control in determining a dark condition and you have a HSM-100 then add this to the Luup tab: (change the device numbers to your own)

local lul_light_level=luup.variable_get(“urn:micasaverde-com:serviceId:LightSensor1”,“CurrentLevel”,67)
if ( tonumber (lul_light_level) <10 ) then
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“RunScene”,{ SceneNum=“25” }, 0)
return false

Notice that I call another scene if it is dark, that allows me much more control over the logic condition. On my “Exit” scene I also toggle a Logic switch I call “Is the house occupied?” so the programmed timers for my internal and external lights can resume. If you have a logic switch added to your devices then add the line:
to the above Luup code as line 1 or 2.

Thank you guys for the replies. It is awesome to learn the infinite possibilities with this system.

… or install DAD ( and use Astronomical, Nautical or civil twilight:

local DAD_device_id = 16847

local civil_twilight_begin = luup.variable_get( 'urn:upnp-ap15e-com:serviceId:DAD1', 'CivilTwilightBegin', DAD_device_id )
local civil_twilight_end   = luup.variable_get( 'urn:upnp-ap15e-com:serviceId:DAD1', 'CivilTwilightEnd'  , DAD_device_id )

civil_twilight_begin = tonumber( civil_twilight_begin )
civil_twilight_end   = tonumber( civil_twilight_end   )

local now = os.time()

if ( civil_twilight_begin == nil ) or ( civil_twilight_end == nil )
  return luup.is_night()
  return ( now < civil_twilight_begin ) or ( now > civil_twilight_end )

… or add the Weather plugin ( and save energy if the moon is lit and the sky is clear:

Thanks Ap15e that’s what I forgot… the light from a full moon! Gotta love that. :smiley:
For a long time I didn’t have an Internet connection so I relied on my own sensors.

I have tried everything and it is clear that the “Lock button is pressed” event is not being triggered on the 1186 beta. Does anyone know when the “Lock Button is pressed” event will work on Schlage deadbolts? This is the ideal solution in my case, because I can test for the lock state within the luup code for the “lock button is pressed” event to ensure that the event only continues if the button is pressed AND the deadbolt is turned to the locked position (i.e. door was locked externally). In fact, this one of the main reasons why I recently added a Schlage deadbolt to my z-wave network.

As a work-around, does anyone know if you can query the deadbolt lock to see if the lock button was pressed recently? If so, then I could trigger on the “Door closed event” and then in the luup code for the event, compare the closed-event time to when the lock button was pressed and if they are time proximal, then the door was closed via the exterior.

I think lock button is pressed is only for the handle lock not the deadbolt. It has lock and unlock buttons on the inside.

Reiserx, unfortunately, I think you might be correct - I looked through the device files and there is a variable in the Services file called sl_LockButton that when I try to query using lua, it fails. I am certain of the syntax I am using to test it because I queried the PinCodes, Status and other variables successfully. If it is the case that neither an event is generated when the lock button is pressed or that you can’t even query that it was pressed, then that will be a huge disappointment because it means that there is essentially no way to detect that the lock was activated externally even though the external lock use case is, a) press lock button and b) turn deadbolt. The Kwikset deadbolt is looking better and better.

Does anyone know how I can get a definitive answer to whether the “Lock Button Pressed” event can or will be supported on the Schlage BE369 (e.g. Internet, MCV, etc.)?