From 2eac88062f57944029dbcfdc364bafba2f6b2cee Mon Sep 17 00:00:00 2001 From: Juhaki Park <37175353+juhaki@users.noreply.github.com> Date: Wed, 26 Aug 2020 11:23:18 +0900 Subject: [PATCH] [ICP-13555] EZEX power meter patch #2. [ICP-13555] EZEX power meter patch #2. --- .../zigbee-power-meter.src/zigbee-power-meter.groovy | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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"