# Can locking my door arm a garage sensor?

**URL:** <https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544>\
**Category:** SmartApps & Automations\
**Created:** [October 9, 2015, 2:01am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544 "2015-10-09T02:01:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddingo](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@maddingo](https://community.smartthings.com/u/maddingo)\
**Post date:** [October 9, 2015, 2:01am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/1 "2015-10-09T02:01:14Z")

</div>

Hi,

I have a Schlage touchscreen deadbolt and would like it to be able to arm my garage tilt sensor when it’s locked and disarm it when it’s unlocked. ( by turning the knob inside or entering a code outside) My Vera 3 was able to do this easily.

Thanks!

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 9, 2015, 2:07am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/2 "2015-10-09T02:07:37Z")

</div>

Vera uses the concept of arming and disarming the individual sensors. Smartthings does not.

Instead, smartthings makes its _rules_ eligible or ineligible to run based on various criteria. So a sensor can be essentially “armed” for one routine, and “disarmed” for another at the same time.

For example, I have a motion sensor next to my bed. If my house is in “night” mode, when that motion sensor fires, a routine runs that turns on the overhead ceiling light.

If my house is in “Asleep” Mode, when that same motion sensor fires, the ceiling light routine is ineligible to run, and a different routine runs that turns on a softer nightlight.

So the answer is likely to be yes, you can get the end result that you want, but you get it by making the rule eligible or ineligible to run, not by disarming the device.

What happens differently between the “armed” state and “disarmed” state?

---

<div class="post-metadata">

**Author:** ![damohabir](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@damohabir](https://community.smartthings.com/u/damohabir)\
**Post date:** [October 9, 2015, 2:12am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/3 "2015-10-09T02:12:41Z")

</div>

I have a Schlage Lever lock and I use Smart Lightning app to turn on the kitchen light after sunset when I unlock the door. You might be able to use the same app to arm or disarm the sensor.  
I am just curious why you want to arm and disarm the sensor. Are you using it as part of a security system?

---

<div class="post-metadata">

**Author:** ![maddingo](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@maddingo](https://community.smartthings.com/u/maddingo)\
**Post date:** [October 9, 2015, 10:58am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/4 "2015-10-09T10:58:50Z")

</div>

Armed state would sound a siren when my garage door is opened. Disarmed would allow me to open the garage without the siren going off. All based on whether my front door is locked or unlocked.

---

<div class="post-metadata">

**Author:** ![maddingo](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@maddingo](https://community.smartthings.com/u/maddingo)\
**Post date:** [October 9, 2015, 10:59am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/5 "2015-10-09T10:59:33Z")

</div>

Yes, it is security for my garage.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 10, 2015, 5:50am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/6 "2015-10-10T05:50:41Z")

</div>

> [@maddingo](#):
>
> Armed state would sound a siren when my garage door is opened. Disarmed would allow me to open the garage without the siren going off. All based on whether my front door is locked or unlocked.

This is doable, but it will require some custom code at the moment because smart home monitor doesn’t currently check if your lock status is locked or unlocked. Clearly it should, so it seems likely that it should have this capability in the future, but there’s no specific time line for it so I don’t know if you want to wait to see if it shows up in the standard choices.

If you want to go ahead with custom code, that’s less complicated than it sounds because other people are already doing it. So it’s mostly a matter of copy and paste what they did into your own account.

The following FAQ explains how you use someone else’s custom code.

> [@\[OBSOLETE\] FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic, Groovy Code)](https://community.smartthings.com/t/faq-an-overview-of-using-custom-code-in-smartthings/16772):
>
> The original FAQ information in this thread refers to the original smartthings architecture, which was in place through the end of 2022 and a little beyond. Custom code was written in the groovy programming language and ran in the smartthings cloud. As of May 2023, you can no longer add new Groovy DTH‘s or smartapps to your smartthings account. So if you came here because of a link in an old forum thread, or on another site, I’m afraid the Groovy information is no longer usable. All of this was replaced by a new architecture. Cloud to cloud integrations use the smartthings API. Hub connected devices, mostly Zigbee and zwave, now use “Edge Drivers,” written in the LUA programming language. Here’s the official announcement on those: The process for using a custom Edge Driver in the new …

If that sounds like something you’d like to go ahead with, let us know, and community members can help point you towards the pieces that you need. I’m pretty sure that everything you need already exists in the community, but you will have to publish the various pieces to yourself before you can configure your set up.

Like many things in the SmartThings, this is neither into intuitive nor straightforward. But it is possible.

Before we go any further down this route, are you using a US model hub? Or a UK model?

The reason I ask is that there are third party apps that do provide rules engines which are much more similar to the one which Vera has, and which fill in the gap for a lot of people who don’t want to fool with code. But right now these are not working for the UK model hub.

---

<div class="post-metadata">

**Author:** ![maddingo](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@maddingo](https://community.smartthings.com/u/maddingo)\
**Post date:** [October 10, 2015, 1:58pm UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/7 "2015-10-10T13:58:58Z")

</div>

I’m in the US. It would be nice if there was a simple app to do this. It seems like an obvious feature people would want. I think I can handle the custom code though in the meantime.

Thanks.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [October 10, 2015, 2:41pm UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/8 "2015-10-10T14:41:00Z")

</div>

**Two Sets of Rules: One for “sensor triggers siren when system state is armed” and one to Control when the system state changes**

You will have two system states: one where the garage door sensor can trigger the siren, and one where it doesn’t. You can either use the overall system state called “mode” or you can use the smart home monitor “armed” state. You’ll set up a rule so that the garage door sensor opening triggers the siren only when the system state is Appropriate to do so.

Then you will set up two more rules that control when the system state changes. If you use mode, it might be “home” when you unlock the door and “away” when you lock it. Other people will be able to help you figure out what to is if you get stuck.

You can actually do all kinds of combinations with this. You could have System state change for many different reasons, time of day, who is home, whether it’s cold out, change it manually, etc. and those parameters can be combined into one rule or spread out over many.

**The concept is easy, it’s getting the rules set up that takes research**

Since you are in the US, there are two third-party rules engines that make setting this up pretty straightforward. The authors of both participate regularly in the forums, so you can ask questions and make suggestions.

You may still need a custom device type for the lock. But after that the rules set up should be intuitive with either of these as long as the features are supported.

The first one has been around longer and has more options. However, it’s IOS only, and it is a paid app of about nine dollars. Lots of features. I’m pretty sure your use case would be very easy to set up. You purchase it through the regular App Store.

[http://smartrulesapp.com](http://smartrulesapp.com)

And this is the author’s topic where you can find them to ask questions:

> [@Rule Builder iOS app](https://community.smartthings.com/t/rule-builder-ios-app/12728):
>
> [[image] ](https://gallery.mailchimp.com/56fca9c8059a67b6efdbc9497/images/5ecd4eb2-bec5-47be-9e5e-88eabaefd5cd.png) SmartThings has never been smarter. We’re pleased to announce [SmartRules](http://smartrulesapp.com) is now available to download! SmartRules lets you easily create rules for SmartThings, so you can finally make your smart home smart! No more struggling to search through the published SmartApps to find something that meets your needs, or worse yet, trying to write the code yourself. With SmartRules, you just specify what should happen, when, and it does the rest. Want to turn on a light when motion is detected outside, it’s after sunset and you’re not home? No problem! Want to unlock the door when you arrive home, but only if there’s a leak in your basement? Strange, but you can do it! Define a trigger, set some conditions, and specify the actions to take. Your devices are all org…

Second one is a free contribution developed by a community member. Very nice. Browser-based, so it should work on any phone or tablet.

[https://www.simplerulebuilder.com/about/](https://www.simplerulebuilder.com/about/)

And the author’s topic for that one:

> [@Simplerulebuilder - now private](https://community.smartthings.com/t/web-based-rules-engine-ready-for-testing/11418):
>
> Developing for SmartThings has proven to be frustrating and un-fun. I am revoking public access to this app.

I like both of these. And, no, I don’t know why the official SmartThings mobile app doesn’t come with something like this built-in. Obviously these guys have proven it can be done. Maybe it’s just the fact that these often still require custom device types, and smartthings is waiting until that requirement is removed?

Sorry the answers for these have to be so long. Smart things is a very powerful system that lets you do a lot of complex stuff with many different devices of different protocols. But the process to get everything set up is often complex.

---

<div class="post-metadata">

**Author:** ![maddingo](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@maddingo](https://community.smartthings.com/u/maddingo)\
**Post date:** [October 12, 2015, 12:22am UTC](https://community.smartthings.com/t/can-locking-my-door-arm-a-garage-sensor/25544/9 "2015-10-12T00:22:52Z")

</div>

I think I have it working now. Thanks for taking the time to explain this all and point me in the right direction for the rules engine.
