Request: Custom attributes for Schlage locks in RM 4.0

Are they any updates on support for this functionality?
Determine if Lock Unlocked “Physical” or “Digital” I would like RM to know if my August lock was unlocked "digital" or "physical".

I have August auto-unlock when I arrive home (August feature) or via HomeKit. It would be nice to have it automatically run the "Home mode" when it was unlock "digital" but not physical.

Sounds like they don't plan to implement this. Below is a post with a solution to make this work. A few posts down is a Yale version of the app.

2 Likes

Thanks for sharing this. I never programmed in Groovy before but after looking at the code I think I just need to modify the "evt.descriptionText.endsWith" & "evt.type" statement to match the August lock reply.

Here are the changes I made; I haven't tested this yet (will post an update after I do). But basically this is what I want the code to do (If lock is locked turn on the virtual switch. If lock is unlocked digital turn off the the virtual switch).

 definition(
    name: "August Lock Events",
    namespace: "rvrolyk",
    author: "Russ Vrolyk",
    description: "Tracks if August Lock was unlocked digitally. Modified by K-MTG",
    category: "Convenience",
	iconUrl: "",
    iconX2Url: "",
    iconX3Url: "")


def lock = [
    name: "lock",
    type: "capability.lock",
    title: "Lock",
    description: "Select the lock to monitor.",
    required: true,
    multiple: false
]

def virtualLockedSwitch = [
    name: "virtualLockedSwitch",
    type: "capability.switch",
    title: "Virtual Lock Switch",
    description: "Virtual switch that should be turned on when lock is locked and off only when digitally unlocked.",
    required: true,
    multiple: false
]


def enableLogging = [
    name:				"enableLogging",
    type:				"bool",
    title:				"Enable debug Logging?",
    defaultValue:		false,
    required:			true
]

preferences {
	page(name: "mainPage", title: "<b>Lock to monitor:</b>", install: true, uninstall: true) {
		section("") {
			input lock
			input virtualLockedSwitch
			label title: "Assign an app name", required: false
		}
		section ("<b>Advanced Settings</b>") {
			input enableLogging
		}
	}
}

def installed() {
	log.info "Installed with settings: ${settings}"
	initialize()
}

def updated() {
	log.info "Updated with settings: ${settings}"
	unsubscribe()
	initialize()
}

def initialize() {
    log "Lock status: ${lock.displayName} " + lockStatus()
	subscribe(lock, "lock.locked", lockHandler)
	subscribe(lock, "lock.unlocked", unlockHandler)
}

def lockStatus() {
	return lock.currentValue("lock")
}

def lockHandler(evt) {
	virtualLockedSwitch.on()
	log "${lock.displayName} was locked"
}

def unlockHandler(evt) {
	log("Unlock event: ${evt.name} : ${evt.descriptionText}")
	if (evt.type == 'digital' && evt.descriptionText.endsWith('is unlocked [digital]')) {
		log "${lock.displayName} was unlocked inside"
		virtualLockedSwitch.off()
	} else {
		log "${lock.displayName} was unlocked"
	}
}


def log(msg) {
    if (enableLogging) {
        log.debug msg
    }
}

If someone can confirm the changes I made won't preform an unexpected action that would be much appreciated!

1 Like

Btw is their sample code on how to get the current mode and change mode on a UserApp? Might as well have it change the mode directly instead of having RM act on the virtual switch.

Very useful to know, actually.

A "keypad" lock means the device was locked from the outside.

A "physical thumb" lock is most likely from the inside (and, since we're writing our own "rules" to automate things, it's very easy to make that assumption).

So, "keypad lock" means you just left--and should do an "Arm Away".

A "Thumb knob" turn lock means you're in the house and either shouldn't do anything--or should lock "stay" (if all the doors in the house are locked).

That makes for some very helpful automated routines--and a whole lot more straightforward than kludging together a variety of motion sensors and building a full-blow AI engine to determine where the person is. :slight_smile:

1 Like

@kamransiddiqi1998 Have you try out your groovy scripts? I'm also looking for an app to differentiate the lockingEventMethod between physical or digital.

Yup. It works!

1 Like

What device type is required for the Virtual Lock Switch? I set up a virtual lock type but not shown up. Only bulb, outlet and switch types are listed. Would be good to amend it to include lock type, since it is technically representing a "lock". Sharing my thoughts.

I have copied your scripts and made minor tweak to try it on my Schlage Lock but still not working. I tried your original codes and it didn't work, as the Description Texts in the event log are different to the text you have.

Here's the Events from the Lock
Name | Value | Unit | Description Text | Source | Type

And the modified scripts

definition(
    name: "Digital Locking",
    namespace: "rvrolyk",
    author: "Russ Vrolyk",
    description: "Tracks if Lock was unlocked digitally. Modified by K-MTG",
    category: "Convenience",
	iconUrl: "",
    iconX2Url: "",
    iconX3Url: "")

def lock = [
    name: "lock",
    type: "capability.lock",
    title: "Lock",
    description: "Select the lock to monitor.",
    required: true,
    multiple: false
]

def virtualLockedSwitch = [
    name: "virtualLockedSwitch",
    type: "capability.switch",
    title: "Virtual Lock Switch",
    description: "Virtual switch that should be turned on when lock is locked and off only when digitally unlocked.",
    required: true,
    multiple: false
]

def enableLogging = [
    name:				"enableLogging",
    type:				"bool",
    title:				"Enable debug Logging?",
    defaultValue:		false,
    required:			true
]

preferences {
	page(name: "mainPage", title: "<b>Lock to monitor:</b>", install: true, uninstall: true) {
		section("") {
			input lock
			input virtualLockedSwitch
			label title: "Assign an app name", required: false
		}
		section ("<b>Advanced Settings</b>") {
			input enableLogging
		}
	}
}

def installed() {
	log.info "Installed with settings: ${settings}"
	initialize()
}

def updated() {
	log.info "Updated with settings: ${settings}"
	unsubscribe()
	initialize()
}

def initialize() {
    log "Lock status: ${lock.displayName} " + lockStatus()
	subscribe(lock, "lock.locked", lockHandler)
	subscribe(lock, "lock.unlocked", unlockHandler)
}

def lockStatus() {
	return lock.currentValue("lock")
}

def lockHandler(evt) {
	virtualLockedSwitch.on()
	log "${lock.displayName} was locked"
}

def unlockHandler(evt) {
	log("Unlock event: ${evt.name} : ${evt.descriptionText}")
	if (evt.type == 'digital') {
		log "${lock.displayName} was unlocked outside digitally"
		virtualLockedSwitch.off()
	} else {
		log "${lock.displayName} was unlocked inside physically"
	}
}

def log(msg) {
    if (enableLogging) {
        log.debug msg
    }
}

@taysnet

Try this:

 definition(
    name: "August Lock Events",
    namespace: "rvrolyk",
    author: "Russ Vrolyk",
    description: "Tracks if August Lock was unlocked digitally. Modified by K-MTG",
    category: "Convenience",
    iconUrl: "",
    iconX2Url: "",
    iconX3Url: "")


def lock = [
    name: "lock",
    type: "capability.lock",
    title: "Lock",
    description: "Select the lock to monitor.",
    required: true,
    multiple: false
]

def virtualLockedSwitch = [
    name: "virtualLockedSwitch",
    type: "capability.switch",
    title: "Virtual Lock Switch",
    description: "Virtual switch that should be turned on when lock is locked and off only when digitally unlocked.",
    required: true,
    multiple: false
]


def enableLogging = [
    name:                "enableLogging",
    type:                "bool",
    title:                "Enable debug Logging?",
    defaultValue:        false,
    required:            true
]

preferences {
    page(name: "mainPage", title: "<b>Lock to monitor:</b>", install: true, uninstall: true) {
        section("") {
            input lock
            input virtualLockedSwitch
            label title: "Assign an app name", required: false
        }
        section ("<b>Advanced Settings</b>") {
            input enableLogging
        }
    }
}

def installed() {
    log.info "Installed with settings: ${settings}"
    initialize()
}

def updated() {
    log.info "Updated with settings: ${settings}"
    unsubscribe()
    initialize()
}

def initialize() {
    log "Lock status: ${lock.displayName} " + lockStatus()
    subscribe(lock, "lock.locked", lockHandler)
    subscribe(lock, "lock.unlocked", unlockHandler)
}

def lockStatus() {
    return lock.currentValue("lock")
}

def lockHandler(evt) {
    virtualLockedSwitch.off()
    log "${lock.displayName} was locked"
}

def unlockHandler(evt) {
    log("Unlock event: ${evt.name} : ${evt.descriptionText}")
    if (evt.type == 'digital' && evt.descriptionText.endsWith('[digital]')) {
        log "${lock.displayName} was unlocked inside"
        virtualLockedSwitch.on()
    } else {
        log "${lock.displayName} was unlocked"
    }
}


def log(msg) {
    if (enableLogging) {
        log.debug msg
    }
}
1 Like

I did but the [digital] in my lock event is NOT triggered from using the keypad.

What does it say instead?

[Digital] in my lock means when the lock/unlock action is triggered from an app, such as from Hubitat or SmartThings hub.
[Physical] means lock/unlock using either the knob on the inside or the keypad. The lock/unlock event description include whether the event is physical by knob or physical by keypad.

Thanks for this - I was able to tweak this to use for my Schlage BE469 as well and tweaked it to focus on the lock button from the keypad and is working flawlessly so far! Thank you, thank you!!

@bertabcd1234 & @thebearmay Thanks for helping direct me to this solution from my post

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.