diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 311c659..47dd320 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -118,15 +118,38 @@ private Map getBatteryResult(rawValue) { private Map parseNonIasButtonMessage(Map descMap){ def buttonState = "" def buttonNumber = 0 - if (((device.getDataValue("model") == "3460-L") || (device.getDataValue("model") == "3450-L")) - &&(descMap.clusterInt == 0x0006)) { - if (descMap.command == "01") { + if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) { + if (descMap.commandInt == 1) { getButtonResult("press") } - else if (descMap.command == "00") { + else if (descMap.commandInt == 0) { getButtonResult("release") } } + else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) { + if (descMap.commandInt == 1) { + getButtonResult("press") + } + else if (descMap.commandInt == 0) { + def button = 1 + switch(descMap.sourceEndpoint) { + case "01": + button = 4 + break + case "02": + button = 3 + break + case "03": + button = 1 + break + case "04": + button = 2 + break + } + + getButtonResult("release", button) + } + } else if (descMap.clusterInt == 0x0006) { buttonState = "pushed" if (descMap.command == "01") {