3 name: "Good Night House",
4 namespace: "charette.joseph@gmail.com",
5 author: "Joseph Charette",
6 description: "Some on, some off with delay for bedtime, Lock The Doors",
7 category: "Convenience",
8 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
9 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png"
12 * Walk Gentle Into That Good Night
14 * Author: oneaccttorulethehouse@gmail.com
19 section("When I touch the app turn these lights off…"){
20 input "switchesoff", "capability.switch", multiple: true, required:true
22 section("When I touch the app turn these lights on…"){
23 input "switcheson", "capability.switch", multiple: true, required:false
25 section("Lock theses locks...") {
26 input "lock1","capability.lock", multiple: true
28 section("And change to this mode...") {
29 input "newMode", "mode", title: "Mode?"
31 section("After so many seconds (optional)"){
32 input "waitfor", "number", title: "Off after (default 120)", required: true
39 log.debug "Installed with settings: ${settings}"
40 log.debug "Current mode = ${location.mode}"
41 subscribe(app, appTouch)
47 log.debug "Updated with settings: ${settings}"
48 log.debug "Current mode = ${location.mode}"
50 subscribe(app, appTouch)
54 log.debug "changeMode, location.mode = $location.mode, newMode = $newMode, location.modes = $location.modes"
55 if (location.mode != newMode) {
56 setLocationMode(newMode)
57 log.debug "Changed the mode to '${newMode}'"
59 log.debug "New mode is the same as the old mode, leaving it be"
61 log.debug "appTouch: $evt"
64 def delay = (waitfor != null && waitfor != "") ? waitfor * 1000 : 120000
65 switchesoff.off(delay: delay)