diff --git a/devicetypes/smartthings/zigbee-power-meter.src/zigbee-power-meter.groovy b/devicetypes/smartthings/zigbee-power-meter.src/zigbee-power-meter.groovy index d86972d89a4..99b9b56c318 100755 --- a/devicetypes/smartthings/zigbee-power-meter.src/zigbee-power-meter.groovy +++ b/devicetypes/smartthings/zigbee-power-meter.src/zigbee-power-meter.groovy @@ -52,8 +52,10 @@ def parse(String description) { if (event) { log.info event if (event.name == "power") { - if (event.cluster == 0x0B04 && event.attrId == 0x050b) { - event.value = event.value + def descMap = zigbee.parseDescriptionAsMap(description) + log.debug "event : Desc Map: $descMap" + if (descMap.clusterInt == 0x0B04 && descMap.attrInt == 0x050b) { + event.value = event.value/10 event.unit = "W" } else { event.value = event.value/1000 @@ -82,6 +84,12 @@ def parse(String description) { map.value = zigbee.convertHexToInt(it.value)/1000 map.unit = "W" } + if (it.clusterInt == 0x0B04 && it.attrInt == 0x050b) { + log.debug "meter" + map.name = "power" + map.value = zigbee.convertHexToInt(it.value)/10 + map.unit = "W" + } if (it.clusterInt == 0x0702 && it.attrInt == 0x0000) { log.debug "energy" map.name = "energy"