Door (Un)Lock Triggers (v2)

UPDATED August 21st, 2015. The newer version is a bit more flexible. Note that the ability to react to specific types of door unlock (or lock) events is dependent on the device type used for the lock. Some device types send more information than others…

I wasn’t happy with ST’s selection of “things to make happen” when someone unlocks a door. So, I wrote my own. I originally never intended to share this (as it really didn’t seem worthy of being shared.) However, some folks wanted it, so I might as well make it available.

“Door Unlock Triggers” is available in the IDE “shared” templates, and also via this github link:

Door (Un)Lock Triggers (v2) is available via GitHub - both in my own forked repo, and in the community ST repo here:

This allows you to “react” to a door being unlocked (or locked) manually, from an unlock code, or when it’s unlocked from some other mechanism. (The unlock code must be passed from the device type, or the word “manually” in the unlock description for this to work properly.)

What can you do? Send a push notification (I use this to let me know when one of my children unlocks the door), close a door (I use to close my garage door), or turn on a light (which I only use for debugging, but others use it to light a room - perhaps in place of a contact sensor trigger.)

If people want, I can expand it to do other things (within reason.) As well, the functionality of turning on a switch can be used with virtual switches to do nearly anything with other smart apps.

*** THIS IS NO LONGER SUPPORTED. IF SOMEONE ELSE WANTS TO TAKE IT OVER, THEY ARE WELCOME TO. ***

Take care
Gary

5 Likes

FYI, this was updated to fix a tz variable bug when using nightOnly

Hey Gary,
I’m curious if your app still functions with ST? I installed the app but nothing happens when I unlock my door.

It works for me - when ST decides to function properly.

Updated everything. :wink: It’s really an entirely new smartapp that is much more flexible. What I use this for:

When one of my kids unlocks the door (using their door unlock code), send me a notification.

When I unlock the door with my door code AND my garage door is open, close my garage door.

Hi Gary-
Are Schlage Camelot Touchscreen deadbolts supported by your app? I have been looking for EXACTLY this so the wife never has to come home to a dark house at night.

Thanks!
-Jason

[quote=“jbrown, post:6, topic:11961”]
Are Schlage Camelot Touchscreen deadbolts supported by your app?
[/quote]To be honest, that’s all I ever used it with. For better (more) functionality, use it with the Schlage custom device type I’ve posted. That will allow triggers based on door lock codes used, if it was manually locked, etc.

I am still learning all of this, but i purchased the smartapp from rboy that does all the user code management, notifications by user code id etc and it said to use his device type called " Z-Wave Lock With Alarms". I also have yours installed since i was trying to originally figure out what the difference is between device types and smart apps since i found both code type here. Now I am getting more familiar with it, but am still not sure if i can can use more that 1 device type for a single device. My instinct is telling me know, because it appears that the smartapps rely on info that is setup and made available by the device type. Will the device type rboy work with your app or will your device type work with his user lock code management app?

thanks for the patience and replying back to me

1 device type for each physical device. So, if you have one Schlage lock on your z-wave network, you can only use a single device type for it. (If you had two locks, you could use different device types for each of them, however.)

[quote=“jbrown, post:8, topic:11961”]
Will the device type rboy work with your app or will your device type work with his user lock code management app?
[/quote]I don’t know the answers to these questions. I’ve never tried (and never intend to try) the code put out by @RBoy behind a paywall.

I don’t agree with charging for device types and smartapps based on code given to us for free. However, as long as he’s not violating any laws or licenses, it’s his right to do so. (The original code is Apache licensed, which does give him that right.) Anyway, because I don’t agree with it, I won’t contribute to it (and therefore can’t test it.)

On the other hand, being that you’ve already paid for the paywall, feel free to go ahead and test how things work together (or not.)

Take care
Gary

Paywall, I never heard that before :smile: I don’t mind giving back to the community thru donations or payments since I can code. I also try to offer up ideas to developers to enhance apps or new ones too.

I tried your app with the other device type and it works great! Thank you so much! That is exactly what I was looking for.

Another question if you don’t mind. If i add a custom device type or smartapp from code and the developer releases an update to the code is there a way to know there is an update if you aren’t following the thread or participating in it?

Thanks again, Gary!

Not that I’m aware of. Some developers store their code in github, so you could create a (free) github account and “subscribe” to the developer’s repo. I think that would send you an email message when the dev makes new commits (but I’m not entirely sure about that… it’s something I’ve never used.)

1 Like

Hi Gary-

Troubleshooting question for you. Recently, the trigger with the unlock has been working intermittently, with no discernible pattern. Is there a way to troubleshoot it when I seen that it doesn’t work? I am just having it turn on 2 ge in wall switch so we don’t enter a dark house.

I’ve seen similar things. Seems like ST issues to me (based on the fact that it’s irregular.)

Hi again @garyd9, I’ve been trying to figure out why your smartapp stopped working for me. I’ve been getting this error message in the app itself:

In the live log I see this:

SecurityException: Invoking class java.lang.Class.setDefault() is not allowed @ line 303

Any ideas how to fix this?

-J

It’s because ST decided one that to disable access to a specific function I was using, and gave nearly 0 notice to user-developers about the change. As a result of that and MANY other frustrations I’ve had with ST, I’ve decided to stop helping ST to be a better platform when all they do is spit on us (devs) in return.

You should probably use a different smartapp (or platform.) This smartapp is no longer supported.

Take care
Gary

*** THIS IS NO LONGER SUPPORTED. IF SOMEONE ELSE WANTS TO TAKE IT OVER, THEY ARE WELCOME TO. ***

Gary

Thanks for the reply Gary. Sorry to see you go. I’ve been seeing posts all over from you as I dig thru the forums. It sounds like it can be frustrating when dealing with a company like ST and an open source community. Thanks for always being willing to help me and I really hope you decide to come back to the community. Regardless of what ST does, there are SO many nice people on here and I know most of them really appreciate your hard work. If you do decide to come back I’d be happy to donate $ for all the time and effort you put into the apps and helping people.

Thanks again buddy!

-Jason

2 Likes

Hi Gary,

I just installed your app for my Schlage Camelot and it works great. Thanks!

I can empathize with your frustration with ST not informing of API changes. But I wouldn’t give up on the platform yet. I believe ST will only get better and better and hopefully they will set up better communication networks for user-developers in the future.

Anyways, I just got my ecobee3 device type set up from yracine. I haven’t gotten my hands dirty yet with ST app programming. But I plan on adding Ecobee control to your app. Would anybody else be interested in this? Do you foresee any issues I might encounter doing this?

I really appreciate all the work that the community puts in. I am very new to ST. I just set up my hub about three days ago. Yesterday I installed a Schlage Connect Century Touchscreen. Today I installed the Door (Un)Lock Triggers(v2) app. But every time that I get to the Turn on/off Switches screen where you tell it whether to turn the switch on or off and can set the Activate the Hello Home Phrase, when I fill everything out and click Done I get An unexpected error occured red flag.

Any idea what I could be doing wrong? I have a suspicion it is the way I initially paired the Schlage lock but I am not sure. I set it up by going to Connect New Device and when through all the selections to where I could select Schlage Century Touchscreen Deadbolt. From reading through all these posts it made it sound like I possibly need to have done this in a different way? Thanks!

I’ve been using the code successfully. I added my door lock by going to Connect New Device and then inputting the correct Z-Wave pairing code on the Schlage keypad. That’s all I remember doing to get the device initially connected.