Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#975 from SmartThingsCommunity…
Browse files Browse the repository at this point in the history
…/staging

Rolling up staging to production
  • Loading branch information
workingmonk committed Jun 7, 2016
2 parents d56e132 + 98d7829 commit 8d8b039
Show file tree
Hide file tree
Showing 33 changed files with 926 additions and 385 deletions.
3 changes: 0 additions & 3 deletions devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ metadata {
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
}
tileAttribute ("device.level", key: "SECONDARY_CONTROL") {
attributeState "level", label: 'Level ${currentValue}%'
}
tileAttribute ("device.color", key: "COLOR_CONTROL") {
attributeState "color", action:"setAdjustedColor"
}
Expand Down
3 changes: 0 additions & 3 deletions devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ metadata {
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
}
tileAttribute ("device.level", key: "SECONDARY_CONTROL") {
attributeState "level", label: 'Level ${currentValue}%'
}
tileAttribute ("device.color", key: "COLOR_CONTROL") {
attributeState "color", action:"setAdjustedColor"
}
Expand Down
3 changes: 0 additions & 3 deletions devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ metadata {
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
}
tileAttribute ("device.level", key: "SECONDARY_CONTROL") {
attributeState "level", label: 'Level ${currentValue}%'
}
}

controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/**
* Hue White Ambiance Bulb
*
* Philips Hue Type "Color Temperature Light"
*
* Author: SmartThings
*/

// for the UI
metadata {
// Automatically generated. Make future change here.
definition (name: "Hue White Ambiance Bulb", namespace: "smartthings", author: "SmartThings") {
capability "Switch Level"
capability "Actuator"
capability "Color Temperature"
capability "Switch"
capability "Refresh"

command "refresh"
}

simulator {
// TODO: define status and reply messages here
}

tiles (scale: 2){
multiAttributeTile(name:"rich-control", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
}
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
}
}

controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") {
state "colorTemperature", action:"color temperature.setColorTemperature"
}

valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "colorTemperature", label: '${currentValue} K'
}

standardTile("refresh", "device.refresh", height: 2, width: 2, inactiveLabel: false, decoration: "flat") {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}

main(["rich-control"])
details(["rich-control", "colorTempSliderControl", "colorTemp", "refresh"])
}
}

// parse events into attributes
def parse(description) {
log.debug "parse() - $description"
def results = []

def map = description
if (description instanceof String) {
log.debug "Hue Ambience Bulb stringToMap - ${map}"
map = stringToMap(description)
}

if (map?.name && map?.value) {
results << createEvent(name: "${map?.name}", value: "${map?.value}")
}
results
}

// handle commands
void on() {
log.trace parent.on(this)
sendEvent(name: "switch", value: "on")
}

void off() {
log.trace parent.off(this)
sendEvent(name: "switch", value: "off")
}

void setLevel(percent) {
log.debug "Executing 'setLevel'"
if (percent != null && percent >= 0 && percent <= 100) {
parent.setLevel(this, percent)
sendEvent(name: "level", value: percent)
sendEvent(name: "switch", value: "on")
} else {
log.warn "$percent is not 0-100"
}
}

void setColorTemperature(value) {
if (value) {
log.trace "setColorTemperature: ${value}k"
parent.setColorTemperature(this, value)
sendEvent(name: "colorTemperature", value: value)
sendEvent(name: "switch", value: "on")
} else {
log.warn "Invalid color temperature"
}
}

void refresh() {
log.debug "Executing 'refresh'"
parent.manualRefresh()
}

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ metadata {
capability "Sensor"

attribute "colorName", "string"

// indicates that device keeps track of heartbeat (in state.heartbeat)
attribute "heartbeat", "string"


}

// simulator metadata
Expand Down Expand Up @@ -75,9 +70,6 @@ metadata {
def parse(String description) {
//log.trace description

// save heartbeat (i.e. last time we got a message from device)
state.heartbeat = Calendar.getInstance().getTimeInMillis()

if (description?.startsWith("catchall:")) {
if(description?.endsWith("0100") ||description?.endsWith("1001") || description?.matches("on/off\\s*:\\s*1"))
{
Expand Down Expand Up @@ -132,7 +124,6 @@ def off() {
}

def refresh() {
sendEvent(name: "heartbeat", value: "alive", displayed:false)
[
"st rattr 0x${device.deviceNetworkId} ${endpointId} 6 0", "delay 500",
"st rattr 0x${device.deviceNetworkId} ${endpointId} 8 0", "delay 500",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

metadata {
// Automatically generated. Make future change here.
definition (name: "SmartPower Outlet", namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartPower Outlet", namespace: "smartthings", author: "SmartThings", category: "C1") {
capability "Actuator"
capability "Switch"
capability "Power Meter"
Expand All @@ -25,9 +25,6 @@ metadata {
capability "Sensor"
capability "Health Check"

// indicates that device keeps track of heartbeat (in state.heartbeat)
attribute "heartbeat", "string"

fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200", deviceJoinName: "Outlet"
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3200-Sgb", deviceJoinName: "Outlet"
fingerprint profileId: "0104", inClusters: "0000,0003,0004,0005,0006,0B04,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "4257050-RZHAC", deviceJoinName: "Outlet"
Expand Down Expand Up @@ -81,9 +78,6 @@ metadata {
def parse(String description) {
log.debug "description is $description"

// save heartbeat (i.e. last time we got a message from device)
state.heartbeat = Calendar.getInstance().getTimeInMillis()

def finalResult = zigbee.getKnownDescription(description)

//TODO: Remove this after getKnownDescription can parse it automatically
Expand Down Expand Up @@ -124,7 +118,6 @@ def on() {
}

def refresh() {
sendEvent(name: "heartbeat", value: "alive", displayed:false)
zigbee.onOffRefresh() + zigbee.refreshData("0x0B04", "0x050B")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

metadata {
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings", category: "C2") {
capability "Configuration"
capability "Battery"
capability "Refresh"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.st-ignore
README.md
30 changes: 30 additions & 0 deletions devicetypes/smartthings/smartsense-motion-sensor.src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Smartsense Motion Sensor



Works with:

* [Samsung SmartThings Motion Sensor](https://shop.smartthings.com/#!/products/samsung-smartthings-motion-sensor)

## Table of contents

* [Capabilities](#capabilities)
* [Health]($health)

## Capabilities

* **Configuration** - _configure()_ command called when device is installed or device preferences updated
* **Motion Sensor** - can detect motion
* **Battery** - defines device uses a battery
* **Refresh** - _refresh()_ command for status updates
* **Health Check** - indicates ability to get device health notifications

## Device Health

A Category C2 motion sensor that has 120min check-in interval






Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

metadata {
definition (name: "SmartSense Motion Sensor", namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartSense Motion Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
capability "Motion Sensor"
capability "Configuration"
capability "Battery"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

metadata {
definition (name: "SmartSense Multi Sensor", namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartSense Multi Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {

capability "Three Axis"
capability "Battery"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//DEPRECATED - Using the smartsense-multi-sensor.groovy DTH for this device. Users need to be moved before deleting this DTH

metadata {
definition (name: "SmartSense Open/Closed Accelerometer Sensor", namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartSense Open/Closed Accelerometer Sensor", namespace: "smartthings", author: "SmartThings", category: "C2") {
capability "Battery"
capability "Configuration"
capability "Contact Sensor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
*/
metadata {
definition (name: "SmartSense Temp/Humidity Sensor",namespace: "smartthings", author: "SmartThings") {
definition (name: "SmartSense Temp/Humidity Sensor",namespace: "smartthings", author: "SmartThings", category: "C2") {
capability "Configuration"
capability "Battery"
capability "Refresh"
Expand Down
42 changes: 42 additions & 0 deletions devicetypes/smartthings/tile-ux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Device Tiles Examples and Reference

This package contains examples of Device tiles, organized by tile type.

## Purpose

Each Device Handler shows example usages of a specific tile, and is meant to represent the variety of permutations that a tile can be configured.

The various tiles can be used by QA to test tiles on all supported mobile devices, and by developers as a reference implementation.

## Installation

1. Self-publish the Device Handlers in this package.
2. Self-publish the Device Tile Controller SmartApp. The SmartApp can be found [here](https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/smartapps/smartthings/tile-ux/device-tile-controller.src/device-tile-controller.groovy).
3. Install the SmartApp from the Marketplace, under "My Apps".
4. Select the simulated devices you want to install and press "Done".

The simulated devices can then be found in the "Things" view of "My Home" in the mobile app.
You may wish to create a new room for these simulated devices for easy access.

## Usage

Each simulated device can be interacted with like other devices.
You can use the mobile app to interact with the tiles to see how they look and behave.

## Troubleshooting

If you get an error when installing the simulated devices using the controller SmartApp, ensure that you have published all the Device Handlers for yourself.
Also check live logging to see if there is a specific tile that is causing installation issues.

## FAQ

*Question: A tile isn't behaving as expected. What should I do?*

QA should create a JIRA ticket for any issues or inconsistencies of tiles across devices.

Developers may file a support ticket, and reference the specific tile and issue observed.

*Question: I'd like to contribute an example tile usage that would be helpful for testing and reference purposes. Can I do that?*

We recommend that you open an issue in the SmartThingsPublic repository describing the example tile and usage.
That way we can discuss with you the proposed change, and then if appropriate you can create a PR associated to the issue.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ metadata {

tiles(scale: 2) {
valueTile("currentColor", "device.color") {
state "default", label: '${currentValue}'
state "color", label: '${currentValue}', defaultState: true
}

controlTile("rgbSelector", "device.color", "color", height: 6, width: 6, inactiveLabel: false) {
Expand All @@ -41,6 +41,13 @@ def parse(String description) {
log.debug "Parsing '${description}'"
}

def setColor(value) {
log.debug "setting color: $value"
if (value.hex) { sendEvent(name: "color", value: value.hex) }
if (value.hue) { sendEvent(name: "hue", value: value.hue) }
if (value.saturation) { sendEvent(name: "saturation", value: value.saturation) }
}

def setSaturation(percent) {
log.debug "Executing 'setSaturation'"
sendEvent(name: "saturation", value: percent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ metadata {
}

valueTile("rangeValue", "device.rangedLevel", height: 2, width: 2) {
state "default", label:'${currentValue}'
state "range", label:'${currentValue}', defaultState: true
}

controlTile("rangeSliderConstrained", "device.rangedLevel", "slider", height: 2, width: 4, range: "(40..60)") {
Expand Down
Loading

0 comments on commit 8d8b039

Please sign in to comment.