2 * CoopBoss Door Status to color
4 * Copyright 2015 John Rucker
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.
18 name: "Door State to Color Light (Hue Bulb)",
19 namespace: "JohnRucker",
20 author: "John Rucker",
21 description: "Change the color of your Hue bulbs based on your coop's door status.",
23 iconUrl: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo.png",
24 iconX2Url: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo2x.png",
25 iconX3Url: "http://coopboss.com/images/SmartThingsIcons/coopbossLogo3x.png")
29 section("When the door opens/closese...") {
30 paragraph "Sets a Hue bulb or bulbs to a color based on your coop's door status:\r unknown = white\r open = blue\r opening = purple\r closed = green\r closing = pink\r jammed = red\r forced close = orange."
31 input "doorSensor", "capability.doorControl", title: "Select CoopBoss", required: true, multiple: false
32 input "bulbs", "capability.colorControl", title: "pick a bulb", required: true, multiple: true
37 log.debug "Installed with settings: ${settings}"
42 log.debug "Updated with settings: ${settings}"
48 subscribe(doorSensor, "doorState", coopDoorStateHandler)
51 def coopDoorStateHandler(evt) {
52 log.debug "${evt.descriptionText}, $evt.value"
131 bulbs*.setHue(hueColor)
132 bulbs*.setSaturation(saturation)
133 bulbs*.setColor(hClr)
136 //it.on() // Turn the bulb on when open (this method does not come directly from the colorControl capability)
137 //it.setLevel(100) // Make sure the light brightness is 100%
138 //it.setHue(hueColor)
139 //it.setSaturation(saturation)