From 82df1a915202913bc7134784f3bc6f37bdfab76f Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 19 Nov 2022 14:59:07 +0100 Subject: [PATCH 1/2] Zigbee fix attribute not reported --- tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino | 1 + tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino index 6266e8f49..5d34f5fc0 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_5_2_converters.ino @@ -717,6 +717,7 @@ void ZCLFrame::applySynonymAttributes(Z_attribute_list& attr_list) { Z_attribute_synonym syn = Z_plugin_matchAttributeSynonym(device.modelId, device.manufacturerId, attr.cluster, attr.attr_id); if (syn.found()) { + AddLog(LOG_LEVEL_DEBUG, PSTR("ZIG: apply synonym %04X/%04X with %04X/%04X (mul:%i div:%i)"), attr.cluster, attr.attr_id, syn.new_cluster, syn.new_attribute, syn.multiplier, syn.divider); if (syn.new_attribute == 0xFFFF) { // if attr is 0xFFFF, remove attribute attr_list.removeAttribute(&attr); } else { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino index 3ec2ae123..fa6760c8a 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino @@ -1773,6 +1773,7 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) { callBerryZigbeeDispatcher("attributes_refined", &zcl_received, &attr_list, srcaddr); #endif // USE_BERRY + if (!attr_list.isEmpty()) { if (defer_attributes) { // Prepare for publish if (zigbee_devices.jsonIsConflict(srcaddr, attr_list)) { @@ -1780,10 +1781,11 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) { zigbee_devices.jsonPublishFlush(srcaddr); } zigbee_devices.jsonAppend(srcaddr, attr_list); - zigbee_devices.setTimer(srcaddr, 0 /* groupaddr */, USE_ZIGBEE_COALESCE_ATTR_TIMER, clusterid, srcendpoint, Z_CAT_READ_ATTR, 0, &Z_PublishAttributes); + zigbee_devices.setTimer(srcaddr, 0 /* groupaddr */, USE_ZIGBEE_COALESCE_ATTR_TIMER, 0 /*clusterid*/, srcendpoint, Z_CAT_READ_ATTR, 0, &Z_PublishAttributes); } else { // Publish immediately zigbee_devices.jsonPublishNow(srcaddr, attr_list); + } } } } From 16b34963d5beeb817492b1c67b228b357d639cbe Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 19 Nov 2022 15:01:01 +0100 Subject: [PATCH 2/2] Fix identaiton --- .../xdrv_23_zigbee_8_parsers.ino | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino index fa6760c8a..dda38daf8 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_8_parsers.ino @@ -1774,17 +1774,17 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) { #endif // USE_BERRY if (!attr_list.isEmpty()) { - if (defer_attributes) { - // Prepare for publish - if (zigbee_devices.jsonIsConflict(srcaddr, attr_list)) { - // there is conflicting values, force a publish of the previous message now and don't coalesce - zigbee_devices.jsonPublishFlush(srcaddr); - } - zigbee_devices.jsonAppend(srcaddr, attr_list); - zigbee_devices.setTimer(srcaddr, 0 /* groupaddr */, USE_ZIGBEE_COALESCE_ATTR_TIMER, 0 /*clusterid*/, srcendpoint, Z_CAT_READ_ATTR, 0, &Z_PublishAttributes); - } else { - // Publish immediately - zigbee_devices.jsonPublishNow(srcaddr, attr_list); + if (defer_attributes) { + // Prepare for publish + if (zigbee_devices.jsonIsConflict(srcaddr, attr_list)) { + // there is conflicting values, force a publish of the previous message now and don't coalesce + zigbee_devices.jsonPublishFlush(srcaddr); + } + zigbee_devices.jsonAppend(srcaddr, attr_list); + zigbee_devices.setTimer(srcaddr, 0 /* groupaddr */, USE_ZIGBEE_COALESCE_ATTR_TIMER, 0 /*clusterid*/, srcendpoint, Z_CAT_READ_ATTR, 0, &Z_PublishAttributes); + } else { + // Publish immediately + zigbee_devices.jsonPublishNow(srcaddr, attr_list); } } }