5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6 * in compliance with the License. You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
12 * for the specific language governing permissions and limitations under the License.
16 name: "Coffee After Shower",
17 namespace: "hwustrack",
18 author: "Hans Wustrack",
19 description: "This app is designed simply to turn on your coffee machine while you are taking a shower.",
21 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
22 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")
27 paragraph "This app is designed simply to turn on your coffee machine " +
28 "while you are taking a shower."
30 section("Bathroom humidity sensor") {
31 input "bathroom", "capability.relativeHumidityMeasurement", title: "Which humidity sensor?"
33 section("Coffee maker to turn on") {
34 input "coffee", "capability.switch", title: "Which switch?"
36 section("Humidity level to switch coffee on at") {
37 input "relHum", "number", title: "Humidity level?", defaultValue: 50
42 subscribe(bathroom, "humidity", coffeeMaker)
47 subscribe(bathroom, "humidity", coffeeMaker)
50 def coffeeMaker(shower) {
51 log.info "Humidity value: $shower.value"
52 if (shower.value.toInteger() > relHum) {