I have 14 Yale Assure Levers paired with a number of Hubitats. I would like to be able to trigger actions via Rule Machine when a particular lock code NUMBER is entered on the keypad. Whether in Rule Machine, Notifications, the Lock Code Manager app, or anywhere else I've looked, I can't seem to find a way to trigger anything off the lock code NUMBER (easy to trigger something from a particular lock code NAME).
Is there a modified Z-wave driver or any other means of having the lock report the actual lock code number as opposed to the lock code name?
Thanks in advance!
Z-Wave locks don't report the actual code used, just the code position, so there isn't an easy way to do this. But if you defined lock codes from the hub somehow (from the device detail page or Lock Code Manager, for example -- they ultimately do the same thing on the device), you'll at least have that information on the hub. (This is as opposed to setting it on the lock itself, which most, probably all, also allow; I'm not sure if you're supposed to be able to fetch the actual code from the lock on demand this way, but I can't say it's ever worked for the factory default codes for me, and it is not part of the data from regular operation regardless.)
Most apps assume you'd want the code name, so while the data is again there if you set it from the hub, most apps won't make it easy to use (assuming it is even there). But a code is necessarily tied to a position and typically a name. Is there a reason you don't want to use this information instead or that you can't specifically set the name and code to something that would work for your purposes or use a fixed/known position? If you explain more about what you're trying to do, someone may have more specific suggestions.
Otherwise, you're going to need a custom app or something that responds to the code position, fetches code information from the current attributes of the device (again, it should at least be available if you used the hub to set it -- you'll see it under "Current States" on the device detail page), matches the two up, and then does whatever in response to that. Without a custom app, an RM rule can probably get you close; it doesn't have formal JSON parsing, but if you avoid funny characters in code names, basic text parsing can probably get you there. A webCoRE piston might do more, though I've never tried anything like this there.
A custom driver is not the approach I would take given the above information about how the locks actually work, though technically you could also do this match-up there instead of an app and send a custom event that way -- but, being a custom event, you'd still need a rule, custom app, or other solution to get where you're going.
Thank you very much for this reply. I was afraid that the lock simply doesn't report the code number and only the code name. I guess the solution would be to create a new rule that triggers anytime the lock is unlocked. The Yale will report the name of the lock code. This could then trigger a "getCodes" query on the lock, where the lock code numbers would be listed along with the lock code name. I'd then have to do a query on the hub for the particular lock code name that was first reported, matching that up with the lock code number. Then if the query returned a particular lock code number, I would finally have the trigger event that I wanted, i.e. a particular lock code number being used.
Wow does that sound inefficient! Any other thoughts on streamlining that process are certianly appreciated!
Do you mean the actual code position?, or the pin code itself...
The code position as occupied on the lock as well as all PIN codes associated with those positions are queried and stored in the lock codes event when the lock is joined. The common name is created by Hubitat manually via the driver.
So depending on which one you want to use maybe just set the name in the driver or LCM to that value.
3 Likes
Why not just set the name to also be the code?
Thank you all for your input! I came up with a simple solution in Rule Machine that works just fine. See below.
For context, for each of my Airbnb units I've created a virtual dimmer which I use to control all sorts of different functions/events for a guest stay; I call it the guest module. When the guest module for a particular unit is set to 25, that triggers all of the procedures to get a unit ready for check in, such as setting the lights to a particular level, activating door codes, and displaying the guest's name on a tablet mounted in the wall in the entry, as one example. The guest's name is stored as a variable on the hub, with a separate variable for each unit. Here's the rule I put together to automate the process when the guest actually arrives and checks in, which switches the virtual dimmer (guest module) to level 26. That triggers all sorrts of other events, such as sending the guest a welcome text message, alerting me that the guest has checked in, turning on power in the unit for the mini fridge, etc.
Thank you again for your input!
1 Like
I know your dimmer solution is already working for you, but you should check out the modes feature, then you could have names for each level instead of just numbers.
1 Like
Wouldn't that be less efficient though? Right now if I add a brand new Airbnb unit that I'm managing, I just create a single virtual dimmer for that unit and I'm basically done with the implementation.
1 Like