Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#41961 from SmartThingsCommuni…
Browse files Browse the repository at this point in the history
…ty/acceptance

Rolling up acceptance to production for deploy
  • Loading branch information
greens authored Aug 25, 2020
2 parents 8ec34d2 + aa3afd5 commit 1ce5b84
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def installed() {
state.numberOfSwitches = 1
}

if (!childDevices) {
if (!childDevices && state.numberOfSwitches > 1) {
addChildSwitches(state.numberOfSwitches)
}
sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID])
Expand All @@ -93,12 +93,12 @@ def installed() {
}
// Preferences template end
response([
refresh((1..state.numberOfSwitches).toList())
refresh((1..state.numberOfSwitches).toList())
])
}

def updated() {
if (!childDevices) {
if (!childDevices && state.numberOfSwitches > 1) {
addChildSwitches(state.numberOfSwitches)
}
// Preferences template begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) {
def refresh() {
log.debug "refresh()..."
delayBetween([
encap(zwave.associationV2.associationRemove(groupingIdentifier: 1, nodeId:[])), // Refresh Node ID in Group 1
encap(zwave.associationV2.associationSet(groupingIdentifier: 1, nodeId:zwaveHubNodeId)), //Assign Node ID of SmartThings to Group 1
encap(zwave.meterV2.meterGet(scale: 0)),
encap(zwave.meterV2.meterGet(scale: 2))
])
Expand All @@ -157,13 +159,12 @@ def configure() {
log.debug "configure()..."
if (isAeotecHomeEnergyMeter())
delayBetween([
encap(zwave.configurationV1.configurationSet(parameterNumber: 255, size: 4, scaledConfigurationValue: 1)), // Reset the device to the default settings
encap(zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 1)), // report power in Watts...
encap(zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 3)), // report total power in Watts and total energy in kWh...
encap(zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 0)), // disable group 2...
encap(zwave.configurationV1.configurationSet(parameterNumber: 103, size: 4, scaledConfigurationValue: 0)), // disable group 3...
encap(zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300)), // ...every 5 min
encap(zwave.configurationV1.configurationSet(parameterNumber: 102, size: 4, scaledConfigurationValue: 2)), // report energy in kWh...
encap(zwave.configurationV1.configurationSet(parameterNumber: 112, size: 4, scaledConfigurationValue: 300)), // ...every 5 min
zwave.configurationV1.configurationSet(parameterNumber: 90, size: 1, scaledConfigurationValue: 1).format(), // enabling automatic reports...
zwave.configurationV1.configurationSet(parameterNumber: 91, size: 2, scaledConfigurationValue: 10).format() // ...every 10W change
encap(zwave.configurationV1.configurationSet(parameterNumber: 90, size: 1, scaledConfigurationValue: 0)), // enabling automatic reports, disabled selective reporting...
encap(zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: 0)) //disable CRC16 encapsulation
], 500)
else if (isQubinoSmartMeter())
delayBetween([
Expand Down Expand Up @@ -213,4 +214,4 @@ private isAeotecHomeEnergyMeter() {

private isQubinoSmartMeter() {
zwaveInfo.model.equals("0052")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def both() {
on()
}

def chime() {
on()
}

def ping() {
def cmds = [
encap(zwave.basicV1.basicGet())
Expand Down Expand Up @@ -201,26 +205,30 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm
switch (cmd.event) {
case 0x09: //TAMPER
sendEvent(name: "tamper", value: "detected")
runIn(10, "clearTamper")
sendEvent(name: "alarm", value: "both")
runIn(2, "clearTamperAndAlarm")
break
case 0x01: //ON
if (state.lastTriggeredSound == 1) {
createEvent([name: "alarm", value: "both"])
createEvent([name: "chime", value: "chime"])
sendEvent(name: "chime", value: "chime")
sendEvent(name: "alarm", value: "both")
} else {
setActiveSound(state.lastTriggeredSound)
}
break
case 0x00: //OFF
resetActiveSound()
createEvent([name: "tamper", value: "clear"])
sendEvent(name: "tamper", value: "clear")
sendEvent(name: "alarm", value: "off")
sendEvent(name: "chime", value: "off")
break
}
}
}

def clearTamper() {
def clearTamperAndAlarm() {
sendEvent(name: "tamper", value: "clear")
sendEvent(name: "alarm", value: "off")
}

def setOnChild(deviceDni) {
Expand Down Expand Up @@ -252,7 +260,7 @@ def resetActiveSound() {
def setActiveSound(soundId) {
String childDni = "${device.deviceNetworkId}:${soundId}"
def child = childDevices.find { it.deviceNetworkId == childDni }
child?.sendEvent(name: "chime", value: "on")
child?.sendEvent(name: "chime", value: "chime")
child?.sendEvent(name: "alarm", value: "both")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,13 @@ private getButtonName() {
private Map parseAduroSmartButtonMessage(Map descMap){
def buttonState = "pushed"
def buttonNumber = 0
if (descMap.clusterInt == ADUROSMART_SPECIFIC_CLUSTER) {
if (descMap.clusterInt == zigbee.ONOFF_CLUSTER) {
if (descMap.command == "01") {
buttonNumber = 1
} else if (descMap.command == "00") {
buttonNumber = 4
}
} else if (descMap.clusterInt == ADUROSMART_SPECIFIC_CLUSTER) {
def list2 = descMap.data
buttonNumber = (list2[1] as int) + 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ def parse(String description) {
if (event) {
log.info event
if (event.name == "power") {
event.value = event.value/1000
event.unit = "W"
if (event.cluster == 0x0B04 && event.attrId == 0x050b) {
event.value = event.value
event.unit = "W"
} else {
event.value = event.value/1000
event.unit = "W"
}
} else if (event.name == "energy") {
event.value = event.value/1000000
event.unit = "kWh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ metadata {
fingerprint profileId: "0104", inClusters: "0000, 0004, 0003, 0005, 0006, 0008, 0300, 1000", outClusters: "0019", manufacturer: "innr", model: "BY 285 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Smart Bulb Color
fingerprint manufacturer: "innr", model: "RB 250 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Smart Candle Colour
fingerprint manufacturer: "innr", model: "RS 230 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Smart GU10 Spot Colour
fingerprint manufacturer: "innr", model: "AE 280 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Smart Color Bulb E26 AE 280 C

// Müller Licht
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000, FEDC", outClusters: "000A, 0019", manufacturer: "MLI", model: "ZBT-ExtendedColor", deviceJoinName: "Tint Light", mnmn:"SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Müller Licht Bulb White+Color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ metadata {
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, FFFF", outClusters: "0019", manufacturer: "MEGAMAN", model: "BSZTM005", deviceJoinName: "INGENIUM Switch" //INGENIUM ZB Mains Switching Module

// Innr
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 220", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 222", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FC82", outClusters: "000A, 0019", manufacturer: "innr", model: "SP 224", deviceJoinName: "Innr Outlet", ocfDeviceType: "oic.d.smartplug" //Innr Smart Plug

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ metadata {
// Innr
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "innr", model: "RB 185 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-2000K-6500K" //Innr Smart Bulb Color
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "innr", model: "FL 130 C", deviceJoinName: "Innr Light" //Innr Flex Light Color
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "innr", model: "OFL 120 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Outdoor Flex Light Colour 2m
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "innr", model: "OFL 140 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Outdoor Flex Light Colour 4m
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "innr", model: "OSL 130 C", deviceJoinName: "Innr Light", mnmn: "SmartThings", vid: "generic-rgbw-color-bulb-1800K-6500K" //Innr Smart Outdoor Spot Light Colour OSL 130 C

// OSRAM
fingerprint profileId: "C05E", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000", outClusters: "0019", "manufacturer":"OSRAM", "model":"Classic A60 RGBW", deviceJoinName: "OSRAM Light" //OSRAM SMART+ LED Classic A60 RGBW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ metadata {

main(["switch","power","energy"])
details(["switch", "power", "energy", "refresh", "reset"])

preferences {
section {
input(
title: "Settings Available For Aeotec Nano Dimmer Only",
type: "paragraph",
element: "paragraph"
)
input(
title: "Set the MIN brightness level (Aeotec Nano Dimmer Only):",
description: "This may need to be adjusted for bulbs that are not dimming properly.",
name: "minDimmingLevel",
type: "number",
range: "0..99",
defaultValue: 0
)
}
}
}

def getCommandClassVersions() {
Expand All @@ -114,7 +132,15 @@ 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])
response(refresh())

def results = []
results << refresh()

if (isAeotecNanoDimmer()) {
results << getAeotecNanoDimmerConfigurationCommands()
}

response(results)
}

// parse events into attributes
Expand Down Expand Up @@ -229,8 +255,14 @@ def setLevel(level, rate = null) {

def configure() {
log.debug "configure()"

def result = []

if (isAeotecNanoDimmer()) {
state.configured = false
result << response(getAeotecNanoDimmerConfigurationCommands())
}

log.debug "Configure zwaveInfo: "+zwaveInfo

if (zwaveInfo.mfr == "0086") { // Aeon Labs meter
Expand Down Expand Up @@ -270,6 +302,36 @@ def normalizeLevel(level) {
level == 99 ? 100 : level
}

def getAeotecNanoDimmerConfigurationCommands() {
def result = []
Integer minDimmingLevel = (settings.minDimmingLevel as Integer) ?: 0 // default value (parameter 131) for Aeotec Nano Dimmer

if (!state.minDimmingLevel) {
state.minDimmingLevel = 0 // default value (parameter 131) for Aeotec Nano Dimmer
}

if (!state.configured || (minDimmingLevel != state.minDimmingLevel)) {
state.configured = false // this flag needs to be set to false when settings are changed (and the device was initially configured before)
result << encap(zwave.configurationV1.configurationSet(parameterNumber: 131, size: 1, scaledConfigurationValue: minDimmingLevel))
result << encap(zwave.configurationV1.configurationGet(parameterNumber: 131))
}

return result
}

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
if (isAeotecNanoDimmer()) {
if (cmd.parameterNumber == 131) {
state.minDimmingLevel = cmd.scaledConfigurationValue
state.configured = true
}

log.debug "${device.displayName} parameter '${cmd.parameterNumber}' with a byte size of '${cmd.size}' is set to '${cmd.configurationValue}'"
}

return [:]
}

/*
* Security encapsulation support:
*/
Expand Down Expand Up @@ -319,3 +381,7 @@ private encap(physicalgraph.zwave.Command cmd) {
private encapSequence(cmds, Integer delay=250) {
delayBetween(cmds.collect{ encap(it) }, delay)
}

private isAeotecNanoDimmer() {
zwaveInfo?.mfr?.equals("0086") && zwaveInfo?.model?.equals("006F")
}

0 comments on commit 1ce5b84

Please sign in to comment.