Code 0 refers to the Master Code hence passing that would create all kinds of other issues.
The DH does send the source of the event (lock or unlock) which can be used with SmartApps (CoRE, WebCoRE, User Management etc).
When you’re looking at the event,
name parameter will be lock or unlock
- There will be a
data parameter which contains the sub-parameter
type, this will reflect the source of the lock or unlock and could be manual, auto, keypad, bluetooth, rfid, remote etc
- If it’s an unlock event then the
data parameter will contains the sub-parameter
userCode (slot number)
So given the above, what you’re looking for in CoRE is to look for event
name lock and under the
data parameter you’ll look at the sub parameter
type and look for keypad, which is your external lock (aka Schlage Lock and Leave or Yale One Touch Lock).
EDIT: You can use the
$args variable in WebCoRE
[$args.usedCode] and data variable in CoRE
[data.usedCode] to get access to that information from the lock event. See https://community.webcore.co/t/finding-event-data-on-an-if-trigger/5855/9