Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#3019 from SmartThingsCommunit…
Browse files Browse the repository at this point in the history
…y/master

Rolling up master to staging
  • Loading branch information
workingmonk authored Apr 17, 2018
2 parents 4589d8b + 541747d commit 7b1dec4
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Local Execution on V2 Hubs
Works with:

* [Samsung SmartThings Motion Sensor](https://shop.smartthings.com/#!/products/samsung-smartthings-motion-sensor)
* [Bosch Motion Detector](https://us.boschsecurity.com/en/products/intrusionalarmsystems/detectorsandaccessories/motionpir/radionpirzbwirelessmotion/radionpirzbwirelessmotion_products_56178)

## Table of contents

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ metadata {
fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3328-G", deviceJoinName: "Centralite Micro Motion Sensor"
fingerprint inClusters: "0000,0001,0003,000F,0020,0402,0500", outClusters: "0019", manufacturer: "SmartThings", model: "motionv4", deviceJoinName: "Motion Sensor"
fingerprint inClusters: "0000,0001,0003,000F,0020,0402,0500", outClusters: "0019", manufacturer: "SmartThings", model: "motionv5", deviceJoinName: "Motion Sensor"
fingerprint inClusters: "0000,0001,0003,0020,0400,0500,0B05", outClusters: "0019", manufacturer: "Bosch", model: "RFPR-ZB", deviceJoinName: "Bosch Motion Sensor"
fingerprint inClusters: "0000,0001,0003,000F,0020,0402,0500", outClusters: "0019", manufacturer: "Bosch", model: "RFDL-ZB-MS", deviceJoinName: "Bosch Motion Sensor"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,22 @@ def installed() {
// 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, offlinePingable: "1"])
def commands = refresh()
if (zwaveInfo.mfr.equals("001A")) {
if (zwaveInfo?.mfr?.equals("001A")) {
commands << "delay 100"
//for Eaton dimmers parameter 7 is ramp time. We set it to 1s for devices to work correctly with local execution
commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 7, size: 1).format()
} else if (isHoneywellDimmer()) {
//Set ramp time to 1s for this device to turn off dimmer correctly when current level is over 66.
commands << "delay 100"
//Parameter 7 - z-wave ramp up/down step size, Parameter 8 - z-wave step interval equals configurationValue times 10 ms
commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 7, size: 1).format()
commands << "delay 200"
commands << zwave.configurationV1.configurationSet(configurationValue: [0, 1], parameterNumber: 8, size: 2).format()
commands << "delay 200"
//Parameter 7 - manual operation ramp up/down step size, Parameter 8 - z-wave manual operation interval equals configurationValue times 10 ms
commands << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 9, size: 1).format()
commands << "delay 200"
commands << zwave.configurationV1.configurationSet(configurationValue: [0, 1], parameterNumber: 10, size: 2).format()
}
response(commands)
}
Expand Down Expand Up @@ -250,3 +262,12 @@ def refresh() {
}
delayBetween(commands, 100)
}

def isHoneywellDimmer() {
zwaveInfo?.mfr?.equals("0039") && (
(zwaveInfo?.prod?.equals("5044") && zwaveInfo?.model?.equals("3033")) ||
(zwaveInfo?.prod?.equals("5044") && zwaveInfo?.model?.equals("3038")) ||
(zwaveInfo?.prod?.equals("4944") && zwaveInfo?.model?.equals("3038")) ||
(zwaveInfo?.prod?.equals("4944") && zwaveInfo?.model?.equals("3130"))
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ metadata {
fingerprint mfr: "0086", prod: "0103", model: "0060", deviceJoinName: "Aeotec Smart Switch 6"
fingerprint mfr: "014F", prod: "574F", model: "3535", deviceJoinName: "GoControl Wall-Mounted Outlet"
fingerprint mfr: "014F", prod: "5053", model: "3531", deviceJoinName: "GoControl Plug-in Switch"
fingerprint mfr: "0063", prod: "4F44", model: "3031", deviceJoinName: "GE Direct-Wire Outdoor Switch"
}

// simulator metadata
Expand Down Expand Up @@ -87,6 +88,10 @@ def installed() {
def updated() {
// 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])
if (zwaveInfo?.mfr?.equals("0063")) { // These old GE devices have to be polled
unschedule("poll")
runEvery15Minutes("poll")
}
try {
if (!state.MSR) {
response(zwave.manufacturerSpecificV2.manufacturerSpecificGet().format())
Expand Down Expand Up @@ -212,6 +217,10 @@ def ping() {
refresh()
}

def poll() {
sendHubCommand(refresh())
}

def refresh() {
delayBetween([
zwave.switchBinaryV1.switchBinaryGet().format(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ metadata {
def installed() {
// Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline
sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
response(initialPoll())
}

def updated() {
Expand Down Expand Up @@ -246,3 +247,25 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS
result << createEvent(descriptionText: "$device.displayName MSR: $msr", isStateChange: false)
result
}

def initialPoll() {
def request = []
request << zwave.batteryV1.batteryGet()
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 0x0C) //motion
commands(request) + ["delay 20000", zwave.wakeUpV1.wakeUpNoMoreInformation().format()]
}

private commands(commands, delay=200) {
log.info "sending commands: ${commands}"
delayBetween(commands.collect{ command(it) }, delay)
}

private command(physicalgraph.zwave.Command cmd) {
if (zwaveInfo && zwaveInfo.zw?.contains("s")) {
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
} else if (zwaveInfo && zwaveInfo.cc?.contains("56")){
zwave.crc16EncapV1.crc16Encap().encapsulate(cmd).format()
} else {
cmd.format()
}
}
2 changes: 2 additions & 0 deletions devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ metadata {
fingerprint inClusters: "0x20,0x25,0x86,0x80,0x85,0x72,0x71"
fingerprint mfr: "0258", prod: "0003", model: "0088", deviceJoinName: "Neo Coolcam Siren Alarm"
fingerprint mfr: "021F", prod: "0003", model: "0088", deviceJoinName: "Dome Siren"
fingerprint mfr: "0060", prod: "000C", model: "0001", deviceJoinName: "Utilitech Siren"
}

simulator {
Expand Down Expand Up @@ -68,6 +69,7 @@ def installed() {
def updated() {
// Device-Watch simply pings if no device events received for 122min(checkInterval)
sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, isStateChanged: true, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
refresh()
}

def createEvents(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
Expand Down

0 comments on commit 7b1dec4

Please sign in to comment.