mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-18 21:03:39 +00:00
Compare commits
17 Commits
MSA-1339-1
...
PROD_2016.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1a910f11f | ||
|
|
9f09a4b0b2 | ||
|
|
3c47fe7b60 | ||
|
|
45a0822e9b | ||
|
|
bbba20288e | ||
|
|
ff9dd3f6e2 | ||
|
|
a94a62d34c | ||
|
|
e861d3c256 | ||
|
|
7adff88d0f | ||
|
|
ad1f1b2dc9 | ||
|
|
8d8b039dda | ||
|
|
c875547942 | ||
|
|
1676a9c381 | ||
|
|
98d7829d1a | ||
|
|
34107f935e | ||
|
|
038d770691 | ||
|
|
ce28ec2039 |
@@ -403,39 +403,21 @@ def refresh() {
|
|||||||
|
|
||||||
if (device.getDataValue("manufacturer") == "SmartThings") {
|
if (device.getDataValue("manufacturer") == "SmartThings") {
|
||||||
log.debug "Refreshing Values for manufacturer: SmartThings "
|
log.debug "Refreshing Values for manufacturer: SmartThings "
|
||||||
refreshCmds = refreshCmds + [
|
/* These values of Motion Threshold Multiplier(0x01) and Motion Threshold (0x0276)
|
||||||
/* These values of Motion Threshold Multiplier(01) and Motion Threshold (7602)
|
seem to be giving pretty accurate results for the XYZ co-ordinates for this manufacturer.
|
||||||
seem to be giving pretty accurate results for the XYZ co-ordinates for this manufacturer.
|
Separating these out in a separate if-else because I do not want to touch Centralite part
|
||||||
Separating these out in a separate if-else because I do not want to touch Centralite part
|
as of now.
|
||||||
as of now.
|
*/
|
||||||
*/
|
refreshCmds += zigbee.writeAttribute(0xFC02, 0x0000, 0x20, 0x01, [mfgCode: manufacturerCode])
|
||||||
|
refreshCmds += zigbee.writeAttribute(0xFC02, 0x0002, 0x21, 0x0276, [mfgCode: manufacturerCode])
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global write 0xFC02 0 0x20 {01}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global write 0xFC02 2 0x21 {7602}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
refreshCmds = refreshCmds + [
|
refreshCmds += zigbee.writeAttribute(0xFC02, 0x0000, 0x20, 0x02, [mfgCode: manufacturerCode])
|
||||||
/* sensitivity - default value (8) */
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global write 0xFC02 0 0x20 {02}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1", "delay 400",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Common refresh commands
|
//Common refresh commands
|
||||||
refreshCmds = refreshCmds + [
|
refreshCmds += zigbee.readAttribute(0x0402, 0x0000) +
|
||||||
"st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200",
|
zigbee.readAttribute(0x0001, 0x0020) +
|
||||||
"st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200",
|
zigbee.readAttribute(0xFC02, 0x0010, [mfgCode: manufacturerCode])
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global read 0xFC02 0x0010",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 1","delay 400"
|
|
||||||
]
|
|
||||||
|
|
||||||
return refreshCmds + enrollResponse()
|
return refreshCmds + enrollResponse()
|
||||||
}
|
}
|
||||||
@@ -443,38 +425,15 @@ def refresh() {
|
|||||||
def configure() {
|
def configure() {
|
||||||
sendEvent(name: "checkInterval", value: 7200, displayed: false)
|
sendEvent(name: "checkInterval", value: 7200, displayed: false)
|
||||||
|
|
||||||
String zigbeeEui = swapEndianHex(device.hub.zigbeeEui)
|
|
||||||
log.debug "Configuring Reporting"
|
log.debug "Configuring Reporting"
|
||||||
|
|
||||||
def configCmds = [
|
def configCmds = enrollResponse() +
|
||||||
"zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200",
|
zigbee.batteryConfig() +
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
zigbee.temperatureConfig() +
|
||||||
|
zigbee.configureReporting(0xFC02, 0x0010, 0x18, 10, 3600, 0x01, [mfgCode: manufacturerCode]) +
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 1 {${device.zigbeeId}} {}", "delay 200",
|
zigbee.configureReporting(0xFC02, 0x0012, 0x29, 1, 3600, 0x0001, [mfgCode: manufacturerCode]) +
|
||||||
"zcl global send-me-a-report 1 0x20 0x20 30 21600 {01}", "delay 200", //checkin time 6 hrs
|
zigbee.configureReporting(0xFC02, 0x0013, 0x29, 1, 3600, 0x0001, [mfgCode: manufacturerCode]) +
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
zigbee.configureReporting(0xFC02, 0x0014, 0x29, 1, 3600, 0x0001, [mfgCode: manufacturerCode])
|
||||||
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0x402 {${device.zigbeeId}} {}", "delay 200",
|
|
||||||
"zcl global send-me-a-report 0x402 0 0x29 30 3600 {6400}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
|
||||||
|
|
||||||
"zdo bind 0x${device.deviceNetworkId} ${endpointId} 1 0xFC02 {${device.zigbeeId}} {}", "delay 200",
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global send-me-a-report 0xFC02 0x0010 0x18 10 3600 {01}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global send-me-a-report 0xFC02 0x0012 0x29 1 3600 {0100}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global send-me-a-report 0xFC02 0x0013 0x29 1 3600 {0100}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
|
|
||||||
|
|
||||||
"zcl mfg-code ${manufacturerCode}", "delay 200",
|
|
||||||
"zcl global send-me-a-report 0xFC02 0x0014 0x29 1 3600 {0100}", "delay 200",
|
|
||||||
"send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500"
|
|
||||||
]
|
|
||||||
|
|
||||||
return configCmds + refresh()
|
return configCmds + refresh()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ metadata {
|
|||||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x98", outClusters: "0x5A,0x82"
|
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x98", outClusters: "0x5A,0x82"
|
||||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters:"0x20" // Philio multi+
|
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters:"0x20" // Philio multi+
|
||||||
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x5A,0x80,0x73,0x86,0x84,0x85,0x59,0x71,0x70,0x7A,0x98" // Vision door/window
|
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x5A,0x80,0x73,0x86,0x84,0x85,0x59,0x71,0x70,0x7A,0x98" // Vision door/window
|
||||||
|
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x98,0x86,0x72,0x5A,0x85,0x59,0x73,0x80,0x71,0x31,0x70,0x84,0x7A" // Vision Motion
|
||||||
}
|
}
|
||||||
|
|
||||||
// simulator metadata
|
// simulator metadata
|
||||||
@@ -263,5 +264,9 @@ def retypeBasedOnMSR() {
|
|||||||
log.debug "Changing device type to Door / Window Sensor Plus (SG)"
|
log.debug "Changing device type to Door / Window Sensor Plus (SG)"
|
||||||
setDeviceType("Door / Window Sensor Plus (SG)")
|
setDeviceType("Door / Window Sensor Plus (SG)")
|
||||||
break
|
break
|
||||||
|
case "0109-2002-0205": // Vision Motion
|
||||||
|
log.debug "Changing device type to Vision Motion Sensor Plus (SG)"
|
||||||
|
setDeviceType("Vision Motion Sensor Plus (SG)")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ metadata {
|
|||||||
capability "Motion Sensor"
|
capability "Motion Sensor"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
capability "Battery"
|
capability "Battery"
|
||||||
|
|
||||||
|
fingerprint mfr: "011F", prod: "0001", model: "0001", deviceJoinName: "Schlage Motion Sensor" // Schlage motion
|
||||||
|
fingerprint mfr: "014A", prod: "0001", model: "0001", deviceJoinName: "Ecolink Motion Sensor" // Ecolink motion
|
||||||
|
fingerprint mfr: "014A", prod: "0004", model: "0001", deviceJoinName: "Ecolink Motion Sensor" // Ecolink motion +
|
||||||
|
fingerprint mfr: "0060", prod: "0001", model: "0002", deviceJoinName: "Everspring Motion Sensor" // Everspring SP814
|
||||||
|
fingerprint mfr: "0060", prod: "0001", model: "0003", deviceJoinName: "Everspring Motion Sensor" // Everspring HSP02
|
||||||
|
fingerprint mfr: "011A", prod: "0601", model: "0901", deviceJoinName: "Enerwave Motion Sensor" // Enerwave ZWN-BPC
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator {
|
simulator {
|
||||||
@@ -125,9 +132,9 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd)
|
|||||||
}
|
}
|
||||||
if (!state.lastbat || (new Date().time) - state.lastbat > 53*60*60*1000) {
|
if (!state.lastbat || (new Date().time) - state.lastbat > 53*60*60*1000) {
|
||||||
result << response(zwave.batteryV1.batteryGet())
|
result << response(zwave.batteryV1.batteryGet())
|
||||||
result << response("delay 1200")
|
} else {
|
||||||
|
result << response(zwave.wakeUpV1.wakeUpNoMoreInformation())
|
||||||
}
|
}
|
||||||
result << response(zwave.wakeUpV1.wakeUpNoMoreInformation())
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,10 +337,10 @@ def initialize() {
|
|||||||
|
|
||||||
settings.devices.each {
|
settings.devices.each {
|
||||||
def deviceId = it
|
def deviceId = it
|
||||||
def detail = state.deviceDetail[deviceId]
|
def detail = state?.deviceDetail[deviceId]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch(detail.type) {
|
switch(detail?.type) {
|
||||||
case 'NAMain':
|
case 'NAMain':
|
||||||
log.debug "Base station"
|
log.debug "Base station"
|
||||||
createChildDevice("Netatmo Basestation", deviceId, "${detail.type}.${deviceId}", detail.module_name)
|
createChildDevice("Netatmo Basestation", deviceId, "${detail.type}.${deviceId}", detail.module_name)
|
||||||
@@ -487,12 +487,12 @@ def poll() {
|
|||||||
log.debug "State: ${state.deviceState}"
|
log.debug "State: ${state.deviceState}"
|
||||||
|
|
||||||
settings.devices.each { deviceId ->
|
settings.devices.each { deviceId ->
|
||||||
def detail = state.deviceDetail[deviceId]
|
def detail = state?.deviceDetail[deviceId]
|
||||||
def data = state.deviceState[deviceId]
|
def data = state?.deviceState[deviceId]
|
||||||
def child = children.find { it.deviceNetworkId == deviceId }
|
def child = children?.find { it.deviceNetworkId == deviceId }
|
||||||
|
|
||||||
log.debug "Update: $child";
|
log.debug "Update: $child";
|
||||||
switch(detail.type) {
|
switch(detail?.type) {
|
||||||
case 'NAMain':
|
case 'NAMain':
|
||||||
log.debug "Updating NAMain $data"
|
log.debug "Updating NAMain $data"
|
||||||
child?.sendEvent(name: 'temperature', value: cToPref(data['Temperature']) as float, unit: getTemperatureScale())
|
child?.sendEvent(name: 'temperature', value: cToPref(data['Temperature']) as float, unit: getTemperatureScale())
|
||||||
|
|||||||
Reference in New Issue
Block a user