4 * Copyright 2014 ObyCode
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7 * in compliance with the License. You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
12 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
13 * for the specific language governing permissions and limitations under the License.
17 name: "AlarmThing AlertAll",
18 namespace: "com.obycode",
20 description: "Send a message whenever any sensor changes on the alarm.",
21 category: "Safety & Security",
22 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
23 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png"
27 section("Notify me when there is any activity on this alarm:") {
28 input "theAlarm", "capability.alarm", multiple: false, required: true
33 log.debug "Installed with settings: ${settings}"
39 log.debug "Updated with settings: ${settings}"
46 log.debug "in initialize"
47 subscribe(theAlarm, "contact", contactTriggered)
48 subscribe(theAlarm, "motion", motionTriggered)
51 def contactTriggered(evt) {
52 if (evt.value == "open") {
53 sendPush("A door was opened")
55 sendPush("A door was closed")
59 def motionTriggered(evt) {
60 if (evt.value == "active") {
61 sendPush("Alarm motion detected")
63 //sendPush("Motion stopped")