Skip to content

Commit

Permalink
Fix cluster definition for metering channels (#663)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson committed Jul 27, 2021
1 parent e37331b commit 742a2d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public Channel getChannel(ThingUID thingUID, ZigBeeEndpoint endpoint) {
@Override
public void attributeUpdated(ZclAttribute attribute, Object val) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
if (attribute.getCluster() == ZclClusterType.METERING
&& attribute.getId() == ZclMeteringCluster.ATTR_INSTANTANEOUSDEMAND) {
Integer value = (Integer) val;
BigDecimal valueCalibrated = BigDecimal.valueOf(value * multiplier / divisor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public Channel getChannel(ThingUID thingUID, ZigBeeEndpoint endpoint) {
@Override
public void attributeUpdated(ZclAttribute attribute, Object val) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
if (attribute.getCluster() == ZclClusterType.METERING
&& attribute.getId() == ZclMeteringCluster.ATTR_CURRENTSUMMATIONDELIVERED) {
Integer value = (Integer) val;
BigDecimal valueCalibrated = BigDecimal.valueOf(value * multiplier / divisor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public Channel getChannel(ThingUID thingUID, ZigBeeEndpoint endpoint) {
@Override
public void attributeUpdated(ZclAttribute attribute, Object val) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
if (attribute.getCluster() == ZclClusterType.METERING
&& attribute.getId() == ZclMeteringCluster.ATTR_CURRENTSUMMATIONRECEIVED) {
Integer value = (Integer) val;
BigDecimal valueCalibrated = BigDecimal.valueOf(value * multiplier / divisor);
Expand Down

0 comments on commit 742a2d0

Please sign in to comment.