How to create scene that disables specific pin codes

Does anyone know how to create a scene that will disable or lock out specific pin codes from being able to unlock a Schlage lock? For instance, I would like to activate a scene (Lockout Bart) that makes Bart’s code invalid and therefore unable to unlock the door. When I disable this scene, I want Bart’s code to work again.

Is this possible?

I have not scene a case like this. Not sure if this is at all possible as once the pin is added to the lock, It would need to be removed to not allow access. The only thing I can think of is to create a scene with a combination of lua/luup code to have functions to create a pin code and delete a pin code from the lock. Have it check against say a virtual switch. Obviously this is not for the beginner.

  • Garrett

There are Lock Actions that are available from the Advanced tab for a Scene.
The actions are:


However I can’t find any description of the arguments for these actions …
Maybe you can ask MCV and then post the results here.
Vera probably calls these actions from JavaScript … so you may be able to reverse engineer the meanings of the arguments.

I was thinking that the solution would involve some LUA code (which I am just now learning); however, wouldn’t it be possible to leave the pin code intact while altering when it is valid?

I believe there is a setting for whether a pin is valid or not. I’m hoping that’s the solution because I would love an option like this as well. A simple mechanism which allows a code to be turned on and off, but not removed. Sometimes I have friends pick something up from my house but would want their code to be active at all times.

I’m going to continue to research the code aspect, but all help would be greatly appreciated.

EDIT: as Richard just pointed out, there are options. It’s just a matter of figuring out the proper code. Thanks!

Reading up on this site:

I am now doing some testing. It may be as simple as some crafty settings in the Advanced tab. I’ll let you know how my testing turns out.

EDIT: that failed horribly. I set the scene to change the validity date of the first (and only) pin code on my test lock. I set it to a date in the past, so that it would be “invalid”. My hope was that one scene could clear any validity checks and the other could enable a check that was only valid in the past. Values could be hard-coded and no fancy coding would be needed.

However, when the code ran, it removed the pin code I had set. I can potentially see why (now that the code is invalid, it removed it). However, that’s definitely not the behavior I expected. I think this may need to be a change request to MCV. Anyone think I’m off-base?

Had not seen that Wiki page before … Learn something new every day.

I know the door lock in question is schlage.

But I would like register with my yale touch screen the inclusion of pin codes is in vera, then exists a database to save this and the door lock at each entrance validates in vera if the code exists and is valid.

Maybe with this door lock is more easy runs a lua code to go in the database and set record like inactive or active.

Only thinking high and trying help.

Has anyone figured out how to make this work?

As Richard pointed out there are Actions in the Advanced tab, however the Action SetPin takes a third option called JSON which I’m not sure what it is expecting…

I cannot seem to get this scene to work and the ability to set/unset the pin dynamically was the main reason I purchased VeraLite and the Kwikset lock…

Any help would be appreciated!!

I finally got this to work tonight!!

I added the following to the LUUP section of SetPin in my scene:

“user_code” : {
“slot” : “3”, //slot to put pin in…use this for ClearPin as well!
“name” : “Tom”, //name of user for pin
“code” : “121212” //actual pin code

Hey Guys,

I am trying to run the following code to remove PINs on my Yale Keyless lock, but no luck at all. It SetPin works absolutely fine, but not Clear one.

Any ideas anyone?

luup.call_action(‘urn:micasaverde-com:serviceId:DoorLock1’, ‘ClearPin’, {UserCode=‘1’})