# Do this when that happens

**URL:** <https://community.smartthings.com/t/do-this-when-that-happens/24838>\
**Category:** SmartApps & Automations\
**Created:** [October 2, 2015, 4:34pm UTC](https://community.smartthings.com/t/do-this-when-that-happens/24838 "2015-10-02T16:34:18Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [October 2, 2015, 5:29pm UTC](https://community.smartthings.com/t/do-this-when-that-happens/24838/6 "2015-10-02T17:29:00Z")

</div>

I wrote a little one that runs a Routine when a lock is unlocked. Take a look at that for some hints.

> [@Smart Home Monitor LIVE!](https://community.smartthings.com/t/smart-home-monitor-live/21690/130):
>
> Here is a small app that allows you to run a Routine when a lock is unlocked. From there, you can do whatever you want! /\*\* \* Unlock Runs Routine \* \* Copyright 2015 Bruce Ravenel \* \* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except \* in compliance with the License. You may obtain a copy of the License at: \* \* http://www.apache.org/licenses/LICENSE-2.0 \* \* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed \* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License \* for the specific language governing permissions and limitations under the License. \* \*/ definition( name: "Unlock Runs Routine", na…

There are some other apps that do notifications, for the other half.

---

_[View the full topic](https://community.smartthings.com/t/do-this-when-that-happens/24838)._
