4 * Copyright 2015 SmartThings
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: "Turn on at Sunset",
18 namespace: "examples",
19 author: "SmartThings",
20 description: "Turn on lights at sunset, based on your location's geofence.",
22 iconUrl: "https://s3.amazonaws.com/smartapp-icons/ModeMagic/rise-and-shine.png",
23 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/ModeMagic/rise-and-shine@2x.png",
24 iconX3Url: "https://s3.amazonaws.com/smartapp-icons/ModeMagic/rise-and-shine@2x.png")
28 input "switches", "capability.switch", title: "Which lights to turn on?"
42 subscribe(location, "sunset", sunsetHandler)
45 def sunsetHandler(evt) {
46 log.debug "turning on lights at sunset"