Author Topic: How to create scene that disables specific pin codes  (Read 3180 times)

Offline mofonics

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
How to create scene that disables specific pin codes
« on: May 06, 2013, 12:07:52 pm »

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?

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: How to create scene that disables specific pin codes
« Reply #1 on: May 06, 2013, 12:58:29 pm »
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

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +763/-142
Re: How to create scene that disables specific pin codes
« Reply #2 on: May 06, 2013, 02:45:23 pm »
There are Lock Actions that are available from the Advanced tab for a Scene.
The actions are:
  • SetPin
  • ClearPin
  • SetPinValidityDate
  • SetPinValidityWeekly
  • ClearPinValidity
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.

Offline i814u2

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: How to create scene that disables specific pin codes
« Reply #3 on: May 06, 2013, 02:46:09 pm »
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!

Offline i814u2

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: How to create scene that disables specific pin codes
« Reply #4 on: May 06, 2013, 02:59:28 pm »
Reading up on this site:
http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#DoorLock1

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?
« Last Edit: May 06, 2013, 03:03:04 pm by i814u2 »

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +763/-142
Re: How to create scene that disables specific pin codes
« Reply #5 on: May 06, 2013, 08:44:38 pm »
Had not seen that Wiki page before ... Learn something new every day.

Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: How to create scene that disables specific pin codes
« Reply #6 on: May 06, 2013, 09:31:36 pm »
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.
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline scampa123

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: How to create scene that disables specific pin codes
« Reply #7 on: July 08, 2013, 05:28:11 pm »
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!!


Offline scampa123

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: How to create scene that disables specific pin codes
« Reply #8 on: July 08, 2013, 09:16:06 pm »
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
    }
}

Offline kun2342

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: How to create scene that disables specific pin codes
« Reply #9 on: July 18, 2018, 07:08:00 am »
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'})