Skip to content

Commit

Permalink
Merge pull request #42522 from SmartThingsCommunity/staging
Browse files Browse the repository at this point in the history
Rolling up staging to acceptance
  • Loading branch information
greens authored Sep 1, 2020
2 parents aa3afd5 + 5b636bd commit 734d5dc
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 734d5dc

Please sign in to comment.