[Moved] Detecting lock unlocks/user codes

I want to change the trigger on my “Welcome Home” Reactor from “changing the House Mode from any to Home” to “entering a PIN code on my Schlage Z-Wave Locks”.

Currently entering a valid PIN Code on any of the locks will trigger the Vera to go into Home Mode via several scenes and the House Mode Plugin. This change to Home mode in turn is what triggers the Reactor we’ve been working on to turn on the lights (or not based on the other test conditions we’ve been struggling to get correct).

To simplify things I think having this all in one reactor is the way to go. For the locks I see the following for sl_UserCode currently.

How do I incorporate the locks into this reactor such that when a valid PIN Code is entered, the House Mode switches to Home and if the other conditions are met the lights turn on?

I have submitted device data for Front Door Lock (#418) for evaluation.

Please advise.

You’ll need to do two things when working with the locks:

  1. As you can see, the sl_UserCode value is not just a simple value, so you are going to need to use the “contains” operator to match a string that’s in the variable’s value. This will get you the match to a particular user/code.
  2. Lock variables are a bit special (some of them, anyway). If the same person unlocks the door two times in a row, the value of sl_UserCode doesn’t change. So, how do you detect the second unlocking? You need to add (in an AND group together with the condition from #1 above) a “updates” operator on sl_UserCode. This will provide a brief pulse true when the lock re-writes the variable, even if it writes it with the same value. Because you put it into an AND group with the contains condition, the AND group itself will therefore pulse true when the lock is unlocked by the matching user. You’ll need to create one such group with those two conditions on sl_UserCode for each user you want to detect.

Note: do not use the backslashes shown in the match string… the status display is quoting the string for display, but you don’t enter it that way. Just enter (for example) userid="3". Also the delay reset on the updates condition is just to stretch the pulse so its more visible on the status display when you’re watching it–it has no operational significance.

Okay… That’ll take a bit of time to digest. I’m at work so not a whole lot of time but I’ll toy around with it. Thanks!

Hi Patrick,

That explains why my Reactor is not working. I have Yale locks and I am not seeing updates as an option when I select sl_UserCode.


@RogerO, you’ll need to update to stable branch release 3.3 (development) to get the “updates” operator you need to fix that. Instructions can be found in this post (scene controllers and locks have this issue in common): Reactor Sensor for LightWave Scene Selector - #15 by rigpapa - Reactor - Ezlo Community

It would seem that the Hot Fix I got yesterday does not include this? I’m not seeing “Updates” either.

Works now, thanks.

I know you have the right version because the Logic Summary you posted shows it. Look again. It’s in there (as a Device State condition operator–last one).

I’m not seeing it? Am I looking in the correct location?

That’s the variable dropdown list. Select sl_UserCode from that list. Then select “updates” from the next menu to the right–the operators–where it currently shows “changes” in your screen shot.

Am I being dense again? I don’t see it.

Your UI is showing 3.2 in this screen shot; it should say 3.3develop-19178. Did you (a) upload ALL source files from the stable branch, and (b) hard-refresh your browser?

I believe I did but I’ll try again. Thanks!

That was it. Not sure what happened but it now shows Reactor ver 3.3develop-19178 and the “Updates” Option is there.

And BINGO now your first reply makes much more sense! I’ll get to it over the weekend.

@rigpapa Just a head’s up… I haven’t found the time yet to work on this… When I do, I’ll report back my findings.