Skip to content

Commit

Permalink
[ICP-13555] EZEX power meter patch SmartThingsCommunity#2.
Browse files Browse the repository at this point in the history
[ICP-13555] EZEX power meter patch SmartThingsCommunity#2.
  • Loading branch information
juhaki authored Aug 26, 2020
1 parent aa37d4d commit 2eac880
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2eac880

Please sign in to comment.