mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-16 21:03:28 +00:00
Compare commits
17 Commits
PROD_2017.
...
PROD_2017.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6996a07969 | ||
|
|
e5738978b0 | ||
|
|
b3d9578140 | ||
|
|
7549979be5 | ||
|
|
728b169a08 | ||
|
|
d2f981fd34 | ||
|
|
a58dd2094d | ||
|
|
c549a5bed0 | ||
|
|
ef5fffc4bc | ||
|
|
c370e88a6b | ||
|
|
ce8c50c630 | ||
|
|
b069669c11 | ||
|
|
4d61d28b42 | ||
|
|
4547d0543b | ||
|
|
59e6f1251b | ||
|
|
e8939a77d7 | ||
|
|
45663ffb86 |
@@ -158,7 +158,7 @@ def generateEvent(Map results) {
|
|||||||
if(results) {
|
if(results) {
|
||||||
|
|
||||||
def linkText = getLinkText(device)
|
def linkText = getLinkText(device)
|
||||||
def supportedThermostatModes = []
|
def supportedThermostatModes = ["off"]
|
||||||
def thermostatMode = null
|
def thermostatMode = null
|
||||||
|
|
||||||
results.each { name, value ->
|
results.each { name, value ->
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ def parse(String description) {
|
|||||||
} else {
|
} else {
|
||||||
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
||||||
}
|
}
|
||||||
|
} else if (descMap?.clusterInt == zigbee.IAS_ZONE_CLUSTER && descMap.attrInt == zigbee.ATTRIBUTE_IAS_ZONE_STATUS && descMap?.value) {
|
||||||
|
map = translateZoneStatus(new ZoneStatus(zigbee.convertToInt(descMap?.value)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
} else if (map.name == "temperature") {
|
||||||
@@ -129,6 +131,10 @@ def parse(String description) {
|
|||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
|
|
||||||
|
translateZoneStatus(zs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map translateZoneStatus(ZoneStatus zs) {
|
||||||
return zs.isAlarm1Set() ? getMoistureResult('wet') : getMoistureResult('dry')
|
return zs.isAlarm1Set() ? getMoistureResult('wet') : getMoistureResult('dry')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +203,8 @@ def ping() {
|
|||||||
def refresh() {
|
def refresh() {
|
||||||
log.debug "Refreshing Temperature and Battery"
|
log.debug "Refreshing Temperature and Battery"
|
||||||
def refreshCmds = zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
def refreshCmds = zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
||||||
zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020)
|
zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
|
||||||
|
zigbee.readAttribute(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS)
|
||||||
|
|
||||||
return refreshCmds + zigbee.enrollResponse()
|
return refreshCmds + zigbee.enrollResponse()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ def parse(String description) {
|
|||||||
def value = descMap.value.endsWith("01") ? "active" : "inactive"
|
def value = descMap.value.endsWith("01") ? "active" : "inactive"
|
||||||
log.debug "Doing a read attr motion event"
|
log.debug "Doing a read attr motion event"
|
||||||
map = getMotionResult(value)
|
map = getMotionResult(value)
|
||||||
|
} else if (descMap?.clusterInt == zigbee.IAS_ZONE_CLUSTER && descMap.attrInt == zigbee.ATTRIBUTE_IAS_ZONE_STATUS && descMap?.value) {
|
||||||
|
map = translateZoneStatus(new ZoneStatus(zigbee.convertToInt(descMap?.value)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (map.name == "temperature") {
|
} else if (map.name == "temperature") {
|
||||||
@@ -135,6 +137,10 @@ def parse(String description) {
|
|||||||
private Map parseIasMessage(String description) {
|
private Map parseIasMessage(String description) {
|
||||||
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
|
|
||||||
|
translateZoneStatus(zs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map translateZoneStatus(ZoneStatus zs) {
|
||||||
// Some sensor models that use this DTH use alarm1 and some use alarm2 to signify motion
|
// Some sensor models that use this DTH use alarm1 and some use alarm2 to signify motion
|
||||||
return (zs.isAlarm1Set() || zs.isAlarm2Set()) ? getMotionResult('active') : getMotionResult('inactive')
|
return (zs.isAlarm1Set() || zs.isAlarm2Set()) ? getMotionResult('active') : getMotionResult('inactive')
|
||||||
}
|
}
|
||||||
@@ -200,7 +206,8 @@ def refresh() {
|
|||||||
log.debug "refresh called"
|
log.debug "refresh called"
|
||||||
|
|
||||||
def refreshCmds = zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
|
def refreshCmds = zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
|
||||||
zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000)
|
zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
||||||
|
zigbee.readAttribute(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS)
|
||||||
|
|
||||||
return refreshCmds + zigbee.enrollResponse()
|
return refreshCmds + zigbee.enrollResponse()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,8 +134,9 @@ def parse(String description) {
|
|||||||
} else {
|
} else {
|
||||||
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
log.warn "TEMP REPORTING CONFIG FAILED- error code: ${descMap.data[0]}"
|
||||||
}
|
}
|
||||||
|
} else if (descMap?.clusterInt == zigbee.IAS_ZONE_CLUSTER && descMap.attrInt == zigbee.ATTRIBUTE_IAS_ZONE_STATUS && descMap?.value) {
|
||||||
|
maps += translateZoneStatus(new ZoneStatus(zigbee.convertToInt(descMap?.value)))
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
maps += handleAcceleration(descMap)
|
maps += handleAcceleration(descMap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,6 +230,11 @@ private List<Map> parseAxis(List<Map> attrData) {
|
|||||||
|
|
||||||
private List<Map> parseIasMessage(String description) {
|
private List<Map> parseIasMessage(String description) {
|
||||||
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
ZoneStatus zs = zigbee.parseZoneStatus(description)
|
||||||
|
|
||||||
|
translateZoneStatus(zs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Map> translateZoneStatus(ZoneStatus zs) {
|
||||||
List<Map> results = []
|
List<Map> results = []
|
||||||
|
|
||||||
if (garageSensor != "Yes") {
|
if (garageSensor != "Yes") {
|
||||||
@@ -313,7 +319,7 @@ def refresh() {
|
|||||||
def refreshCmds = zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
def refreshCmds = zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) +
|
||||||
zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
|
zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
|
||||||
zigbee.readAttribute(0xFC02, 0x0010, [mfgCode: manufacturerCode]) +
|
zigbee.readAttribute(0xFC02, 0x0010, [mfgCode: manufacturerCode]) +
|
||||||
zigbee.enrollResponse()
|
zigbee.readAttribute(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS) + zigbee.enrollResponse()
|
||||||
|
|
||||||
return refreshCmds
|
return refreshCmds
|
||||||
}
|
}
|
||||||
|
|||||||
2
devicetypes/smartthings/zigbee-button.src/.st-ignore
Normal file
2
devicetypes/smartthings/zigbee-button.src/.st-ignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.st-ignore
|
||||||
|
README.md
|
||||||
42
devicetypes/smartthings/zigbee-button.src/README.md
Normal file
42
devicetypes/smartthings/zigbee-button.src/README.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# ZigBee Button
|
||||||
|
|
||||||
|
Cloud Execution
|
||||||
|
|
||||||
|
Works with:
|
||||||
|
|
||||||
|
* [OSRAM LIGHTIFY Dimming Switch](https://support.smartthings.com/hc/en-us/articles/115000236823-SYLVANIA-Dimming-Switch)
|
||||||
|
* [Iris Smart Button](https://support.smartthings.com/hc/en-us/articles/115000190186-Iris-Smart-Button)
|
||||||
|
* [Iris KeyFob](https://support.smartthings.com/hc/en-us/articles/217409686-Iris-Smart-Fob)
|
||||||
|
|
||||||
|
## Table of contents
|
||||||
|
|
||||||
|
* [Capabilities](#capabilities)
|
||||||
|
* [Health](#device-health)
|
||||||
|
* [Troubleshooting](#troubleshooting)
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
|
||||||
|
* **Actuator** - It represents that a device has commands.
|
||||||
|
* **Battery** - It defines that the device has a battery
|
||||||
|
* **Button** - It defines that a device has one or more buttons
|
||||||
|
* **Holdable Button** - It defines that a device has one or more holdable buttons
|
||||||
|
* **Configuration** - _configure()_ command called when device is installed or device preferences updated
|
||||||
|
* **Refresh** - _refresh()_ command for status updates
|
||||||
|
* **Sensor** - it represents that a Device has attributes.
|
||||||
|
* **Health Check** - indicates ability to get device health notifications
|
||||||
|
|
||||||
|
|
||||||
|
## Device Health
|
||||||
|
|
||||||
|
ZigBee Button is marked offline only in the case when Hub is offline.
|
||||||
|
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range.
|
||||||
|
Pairing needs to be tried again by placing the device closer to the hub.
|
||||||
|
It may also happen that you need to reset the device.
|
||||||
|
Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link:
|
||||||
|
* [OSRAM LIGHTIFY Dimming Switch Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/115000236823-SYLVANIA-Dimming-Switch)
|
||||||
|
* [Iris Smart Button Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/115000190186-Iris-Smart-Button)
|
||||||
|
* [Iris KeyFob Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/217409686-Iris-Smart-Fob)
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
* for the specific language governing permissions and limitations under the License.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import groovy.json.JsonOutput
|
||||||
import physicalgraph.zigbee.zcl.DataType
|
import physicalgraph.zigbee.zcl.DataType
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
@@ -24,6 +26,7 @@ metadata {
|
|||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
capability "Health Check"
|
||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
@@ -249,6 +252,8 @@ def updated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def initialize() {
|
def initialize() {
|
||||||
|
// Arrival sensors only goes OFFLINE when Hub is off
|
||||||
|
sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zigbee", scheme:"untracked"]), displayed: false)
|
||||||
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
||||||
sendEvent(name: "numberOfButtons", value: 2)
|
sendEvent(name: "numberOfButtons", value: 2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ metadata {
|
|||||||
def installed() {
|
def installed() {
|
||||||
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
// Device-Watch simply pings if no device events received for 32min(checkInterval)
|
||||||
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
|
||||||
|
response(refresh())
|
||||||
}
|
}
|
||||||
|
|
||||||
def updated() {
|
def updated() {
|
||||||
|
|||||||
@@ -27,10 +27,9 @@ definition(
|
|||||||
|
|
||||||
preferences {
|
preferences {
|
||||||
page(name: "selectButton")
|
page(name: "selectButton")
|
||||||
page(name: "configureButton1")
|
for (def i=1; i<=8; i++) {
|
||||||
page(name: "configureButton2")
|
page(name: "configureButton$i")
|
||||||
page(name: "configureButton3")
|
}
|
||||||
page(name: "configureButton4")
|
|
||||||
|
|
||||||
page(name: "timeIntervalInput", title: "Only during a certain time") {
|
page(name: "timeIntervalInput", title: "Only during a certain time") {
|
||||||
section {
|
section {
|
||||||
@@ -60,22 +59,45 @@ def selectButton() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def createPage(pageNum) {
|
||||||
|
if ((state.numButton == pageNum) || (pageNum == 8))
|
||||||
|
state.installCondition = true
|
||||||
|
dynamicPage(name: "configureButton$pageNum", title: "Set up button $pageNum here",
|
||||||
|
nextPage: "configureButton${pageNum+1}", install: state.installCondition, uninstall: configured(), getButtonSections(pageNum))
|
||||||
|
}
|
||||||
|
|
||||||
def configureButton1() {
|
def configureButton1() {
|
||||||
dynamicPage(name: "configureButton1", title: "Now let's decide how to use the first button",
|
state.numButton = buttonDevice.currentState("numberOfButtons")?.longValue ?: 4
|
||||||
nextPage: "configureButton2", uninstall: configured(), getButtonSections(1))
|
log.debug "state variable numButton: ${state.numButton}"
|
||||||
|
state.installCondition = false
|
||||||
|
createPage(1)
|
||||||
}
|
}
|
||||||
def configureButton2() {
|
def configureButton2() {
|
||||||
dynamicPage(name: "configureButton2", title: "If you have a second button, set it up here",
|
createPage(2)
|
||||||
nextPage: "configureButton3", uninstall: configured(), getButtonSections(2))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def configureButton3() {
|
def configureButton3() {
|
||||||
dynamicPage(name: "configureButton3", title: "If you have a third button, you can do even more here",
|
createPage(3)
|
||||||
nextPage: "configureButton4", uninstall: configured(), getButtonSections(3))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def configureButton4() {
|
def configureButton4() {
|
||||||
dynamicPage(name: "configureButton4", title: "If you have a fourth button, you rule, and can set it up here",
|
createPage(4)
|
||||||
install: true, uninstall: true, getButtonSections(4))
|
}
|
||||||
|
|
||||||
|
def configureButton5() {
|
||||||
|
createPage(5)
|
||||||
|
}
|
||||||
|
|
||||||
|
def configureButton6() {
|
||||||
|
createPage(6)
|
||||||
|
}
|
||||||
|
|
||||||
|
def configureButton7() {
|
||||||
|
createPage(7)
|
||||||
|
}
|
||||||
|
|
||||||
|
def configureButton8() {
|
||||||
|
createPage(8)
|
||||||
}
|
}
|
||||||
|
|
||||||
def getButtonSections(buttonNumber) {
|
def getButtonSections(buttonNumber) {
|
||||||
|
|||||||
Reference in New Issue
Block a user