2 * Copyright 2015 SmartThings
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
10 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
11 * for the specific language governing permissions and limitations under the License.
17 * Turn on one or more switches at a specified time and turn them off at a later time.
22 namespace: "smartthings",
23 author: "SmartThings",
24 description: "Turn on one or more switches at a specified time and turn them off at a later time.",
25 category: "Convenience",
26 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png",
27 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png"
31 section("Select switches to control...") {
32 input name: "switches", type: "capability.switch", multiple: true
34 section("Turn them all on at...") {
35 input name: "startTime", title: "Turn On Time?", type: "time"
37 section("And turn them off at...") {
38 input name: "stopTime", title: "Turn Off Time?", type: "time"
43 log.debug "Installed with settings: ${settings}"
44 schedule(startTime, "startTimerCallback")
45 schedule(stopTime, "stopTimerCallback")
49 def updated(settings) {
51 schedule(startTime, "startTimerCallback")
52 schedule(stopTime, "stopTimerCallback")
55 def startTimerCallback() {
56 log.debug "Turning on switches"
61 def stopTimerCallback() {
62 log.debug "Turning off switches"