Compare commits

...

4 Commits

Author SHA1 Message Date
YANG JR-SHENG
a68e64fb2c Modifying 'SmartApps for Switch' 2017-04-16 23:05:33 -07:00
YANG JR-SHENG
bcb92426ff MSA-1897: Bling's SmartApps for discovery switch 2017-04-16 23:04:19 -07:00
Vinay Rao
e5739fd425 Merge pull request #1903 from workingmonk/feature/zigbee_centralite_button
DVCSMP-2570 Adding centralite zigbee button fingerprint
2017-04-13 11:12:10 -07:00
Vinay Rao
6448a5bc7c adding centralite zigbee button fingerprint
number of button handling
2017-04-13 03:03:06 -07:00
2 changed files with 78 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ metadata {
command "enrollResponse"
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "OSRAM", model: "LIGHTIFY Dimming Switch", deviceJoinName: "OSRAM LIGHTIFY Dimming Switch"
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "CentraLite", model: "3130", deviceJoinName: "Centralite Zigbee Smart Switch"
//fingerprint inClusters: "0000, 0001, 0003, 0020, 0500", outClusters: "0003,0019", manufacturer: "CentraLite", model: "3455-L", deviceJoinName: "Iris Care Pendant"
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button"
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob"
@@ -251,12 +252,19 @@ def initialize() {
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
sendEvent(name: "numberOfButtons", value: 2)
}
else if ((device.getDataValue("manufacturer") == "CentraLite") &&
((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L"))) {
sendEvent(name: "numberOfButtons", value: 1)
}
else if ((device.getDataValue("manufacturer") == "CentraLite") && (device.getDataValue("model") == "3450-L")) {
sendEvent(name: "numberOfButtons", value: 4)
else if (device.getDataValue("manufacturer") == "CentraLite") {
if (device.getDataValue("model") == "3130") {
sendEvent(name: "numberOfButtons", value: 2)
}
else if ((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L")) {
sendEvent(name: "numberOfButtons", value: 1)
}
else if (device.getDataValue("model") == "3450-L") {
sendEvent(name: "numberOfButtons", value: 4)
}
else {
sendEvent(name: "numberOfButtons", value: 4) //default case. can be changed later.
}
}
else {
//default. can be changed

View File

@@ -0,0 +1,64 @@
import grails.converters.JSON
/**
* JSON API Access App
*/
definition(
name: "Bling_SmartApps",
namespace: "BlingSmartApps",
author: "Bling",
description: "Return things as JSON",
category: "My Apps",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
oauth: [displayName: "JSON API", displayLink: ""]
)
preferences {
section("Allow these things to be exposed via JSON...") {
input "switches", "capability.switch", title: "Switches", multiple: true, required: true, hideWhenEmpty: true
//input "temperatures", "capability.temperatureMeasurement", title: "Temp Measurements", multiple: true, required: false
//input "contacts", "capability.contactSensor", title: "Open/Closed Devices", multiple: true, required: false
//input "presences", "capability.presenceSensor", title: "Presence Sensors", multiple: true, required: false
//input "motions", "capability.motionSensor", title: "Motion Sensors", multiple: true, required: false
}
}
mappings {
path("/things") {
action: [
GET: "listThings"
]
}
}
def listThings() {
[
switches: switches.collect{device(it,"switch")}
/*
switches: switches.collect{device(it,"switch")},
temperatures: temperatures.collect{device(it,"temperature")},
contacts: contacts.collect{device(it,"contact")},
presences: presences.collect{device(it,"presence")},
motions: motions.collect{device(it,"motion")}
*/
]
}
private device(it, type) {
def device_state = [label:it.label, type:type, id:it.id, devtest:it]
for (attribute in it.supportedAttributes) {
device_state."${attribute}" = it.currentValue("${attribute}")
}
device_state ? device_state : null
}
def installed() {}
def updated() {}