Lock it at a specific time cannot disable notification

This app works great. But I have it set to not notify, yet i get a notification each time it locks my door. Anyone have this happen ?

By any chance, were you editing the app settings and got one of those red “unexpected error” banners? If so, try going into the SmartApp and hitting Done.

i’ve re done it a few times but will try again. thanks

EDIT: alas just went in and of course i’m logged out again! :S :S :S

No go. Still get notification.

Strange. I guess the next step should be to narrow down if it’s a SmartThings infrastructure problem or something going on with the app. Go into the IDE and check the status of the app. Specifically, what is listed in the Value column for phone, sendPush, and sendPushMessage?
(My Locations > List SmartApps, then click/tap the link for “Lock it at a specific time” (or whatever you’ve named it).

If it shows a value other than boolean “No” (0, No, false) or “”, then something is hosed up with the app. Did it ever work correctly for you? If so, then uninstall it and reinstall it. I also have a modified version of this app that only notifies on failure to lock, if that’s of interest to you.

thanks mate,

it has sendPushMessage enum No

So looks like an issue with smartthings?

i have reinstalled it a few times previously and that did nothign.

[quote=“joel_eggenhuize, post:6, topic:35436”]
So looks like an issue with smartthings? [/quote]
Yes, though I’ve never seen that particular failure.

Just for laughs, try my modified version and see if you have the same issue:

[code]/**

  • Lock It At a Specific Time
  • 2015-08-07: Only sendPush on failure

*/
definition(
name: “Lock It At a Specific Time”, namespace: “HDFLucky”, author: “Erik Thayer”,
description: “Ensure a door is locked at a specific time. Option to add door contact sensor to only lock if closed.”,
category: “Safety & Security”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png

preferences {
section(“At this time every day”) {
input “time”, “time”, title: “Time of Day”
}
section(“Make sure this is locked”) {
input “lock”,“capability.lock”
}
section("Make sure it’s closed first… ") {
input “contact”, “capability.contactSensor”, title: “Which contact sensor?”, required: false
}
section(“Failure Notifications”) {
input “sendPush”, “bool”, title: “Send push notification(s)?”, required: false
input “phone”, “phone”, title: “Send a text message (enter tel. #)?”, required: false
}
}

def installed() {
schedule(time, “setTimeCallback”)
}

def updated(settings) {
unschedule()
schedule(time, “setTimeCallback”)
}

def setTimeCallback() {
if (contact) {
doorOpenCheck()
} else {
lockMessage()
lock.lock()
}
}

def doorOpenCheck() {
def currentState = contact.contactState
if (currentState?.value == “open”) {
def msg = "${contact.displayName} is open. Scheduled lock failed."
log.info msg
if (sendPush) {
sendPush msg
}
if (phone) {
sendSms phone, msg
}
} else {
lockMessage()
lock.lock()
}
}

def lockMessage() {
def msg = "Locking ${lock.displayName} due to scheduled lock."
log.info msg
if (sendPush) {
sendNotificationEvent msg
}
}[/code]
With this code, enabling push only send notification on failure (though it sends to the Notifications feed in the mobile app on failure and success).

great thank you - will try it out

geting the following error with that code: startup failed: script14527304266151469794800.groovy: 14: expecting ‘)’, found ‘preferences’ @ line 14, column 1. preferences { ^ 1 error

Oops, sorry… copy/paste error. I was putting the links to the original icons back, and highlighted 2 characters too far before pasting, DOH!

[code]/**

  • Lock It At a Specific Time
  • 2015-08-07: Only sendPush on failure

*/
definition(
name: “Lock It At a Specific Time”, namespace: “HDFLucky”, author: “Erik Thayer”,
description: “Ensure a door is locked at a specific time. Option to add door contact sensor to only lock if closed.”,
category: “Safety & Security”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“At this time every day”) {
input “time”, “time”, title: “Time of Day”
}
section(“Make sure this is locked”) {
input “lock”,“capability.lock”
}
section("Make sure it’s closed first… ") {
input “contact”, “capability.contactSensor”, title: “Which contact sensor?”, required: false
}
section(“Failure Notifications”) {
input “sendPush”, “bool”, title: “Send push notification(s)?”, required: false
input “phone”, “phone”, title: “Send a text message (enter tel. #)?”, required: false
}
}
def installed() {
schedule(time, “setTimeCallback”)
}
def updated(settings) {
unschedule()
schedule(time, “setTimeCallback”)
}
def setTimeCallback() {
if (contact) {
doorOpenCheck()
} else {
lockMessage()
lock.lock()
}
}
def doorOpenCheck() {
def currentState = contact.contactState
if (currentState?.value == “open”) {
def msg = "${contact.displayName} is open. Scheduled lock failed."
log.info msg
if (sendPush) {
sendPush msg
}
if (phone) {
sendSms phone, msg
}
} else {
lockMessage()
lock.lock()
}
}
def lockMessage() {
def msg = "Locking ${lock.displayName} due to scheduled lock."
log.info msg
if (sendPush) {
sendNotificationEvent msg
}
}[/code]

1 Like

Thank You for the modified code! I too tried using the “Lock at a specific time” but I always got a notification late at night even though I had push notifications off. I’ll give this a try tonight.

My apologies for reanimating a six month old thread but I recently installed a new Schlage Connect deadbolt (which is working perfectly) and have run into this same issue with push notifications coming from this app even though they are allegedly disabled. Did anyone ever successfully test the updated code that was posted above? If so, that newer code been what I got when I installed the app this past Friday via the ST mobile app?

I’m having the same issue with this SmartApp on my newly purchased ST hub + Z-Wave lock. I receive a push notification on all my devices when the door is locked, even though I indicated that I didn’t want push notifications.

I’ve installed the custom SmartApp provided above to replace the one from the Marketplace and it removed the push notification, as promised.

@Mr_Lucky Are you the original author? I found the bug in the current marketplace version so I’d love to help you get it patched and updated in the marketplace.

1 Like

@ethayer It seems you’re the author of “Lock it at a specific time” that’s in the ST marketplace – I found the bug in the current marketplace version so I’d love to help you get it patched and updated in the marketplace.

2 Likes

Uh-oh. Yeah, I wrote this when I first got SmartThings. I’ll take a look at this this weekend.

This app is a little antiquated, as you can preform the same functionality now using automations. That being said, I wouldn’t mind looking at the bug.

I just read this thread. I didn’t know this discussion existed, and I see why someone may want to use this app instead of the automation stuff. I’ll include Mr_Lucky’s fix and perhaps update the code a little all-around.

Thanks for pinging me on this thread.

1 Like

@ethayer Thanks Erik! I think the only thing you need to change is add == “Yes” to your sendPush if statements. You used an ENUM for the sendPush input variable (whereas Mr_Lucky used a BOOL). But since you already have a lot of people using your version with their settings saved as an ENUM, you should probably preserve the ENUM and just update the two places that you check its value.

Enjoy your weekend!

I’ve been using this app for 2 years, I love it, like others the notifications drive me nuts. I have 6 locks. @ethayer please let us know when you get time to update. No rush, . Thank you for writing it.