diff --git a/common/zigbeeintegrationplugin.cpp b/common/zigbeeintegrationplugin.cpp index 8b2b60f..51a8f78 100644 --- a/common/zigbeeintegrationplugin.cpp +++ b/common/zigbeeintegrationplugin.cpp @@ -361,6 +361,8 @@ void ZigbeeIntegrationPlugin::configureElectricalMeasurementInputClusterAttribut } electricalMeasurementCluster->readFormatting(); + qCDebug(m_dc) << "Configuring attribute reporting for Electrical Measurement input cluster on" << endpoint->endpointId(); + ZigbeeClusterLibrary::AttributeReportingConfiguration acTotalPowerConfig; acTotalPowerConfig.attributeId = ZigbeeClusterElectricalMeasurement::AttributeACPhaseAMeasurementActivePower; acTotalPowerConfig.dataType = Zigbee::Int16; @@ -387,7 +389,7 @@ void ZigbeeIntegrationPlugin::configureElectricalMeasurementInputClusterAttribut if (reportingReply->error() != ZigbeeClusterReply::ErrorNoError) { qCWarning(m_dc) << "Failed to configure electrical measurement cluster attribute reporting" << reportingReply->error(); } else { - qCDebug(m_dc) << "Enabled attribute reporting successfully"; + qCDebug(m_dc) << "Attribute reporting enabled successfully for electrical measurement cluster"; } }); } @@ -401,24 +403,28 @@ void ZigbeeIntegrationPlugin::configureMeteringInputClusterAttributeReporting(Zi } meteringCluster->readFormatting(); + qCDebug(m_dc) << "Configuring attribute reporting for Metering input cluster on" << endpoint->endpointId(); + ZigbeeClusterLibrary::AttributeReportingConfiguration instantaneousDemandConfig; instantaneousDemandConfig.attributeId = ZigbeeClusterMetering::AttributeInstantaneousDemand; instantaneousDemandConfig.dataType = Zigbee::Int24; instantaneousDemandConfig.minReportingInterval = 1; // We want currentPower asap instantaneousDemandConfig.maxReportingInterval = 120; - instantaneousDemandConfig.reportableChange = ZigbeeDataType(static_cast(1)).data(); + instantaneousDemandConfig.reportableChange = ZigbeeDataType(1, Zigbee::Int24).data(); ZigbeeClusterLibrary::AttributeReportingConfiguration currentSummationConfig; currentSummationConfig.attributeId = ZigbeeClusterMetering::AttributeCurrentSummationDelivered; currentSummationConfig.dataType = Zigbee::Uint48; currentSummationConfig.minReportingInterval = 5; currentSummationConfig.maxReportingInterval = 120; - currentSummationConfig.reportableChange = ZigbeeDataType(static_cast(1)).data(); + currentSummationConfig.reportableChange = ZigbeeDataType(1, Zigbee::Uint48).data(); ZigbeeClusterReply *reportingReply = meteringCluster->configureReporting({instantaneousDemandConfig, currentSummationConfig}); connect(reportingReply, &ZigbeeClusterReply::finished, this, [=](){ if (reportingReply->error() != ZigbeeClusterReply::ErrorNoError) { qCWarning(m_dc) << "Failed to configure metering cluster attribute reporting" << reportingReply->error(); + } else { + qCDebug(m_dc) << "Attribute reporting enabled successfully for metering cluster"; } }); @@ -1142,6 +1148,7 @@ void ZigbeeIntegrationPlugin::connectToOtaOutputCluster(Thing *thing, ZigbeeNode connect(otaCluster, &ZigbeeClusterOta::imageBlockRequestReceived, thing, [this, thing, otaCluster](quint8 transactionSequenceNumber, quint16 manufacturerCode, quint16 imageType, quint32 fileVersion, quint32 fileOffset, quint8 maximumDataSize, const ZigbeeAddress &requestNodeAddress, quint16 minimumBlockPeriod){ Q_UNUSED(requestNodeAddress) Q_UNUSED(minimumBlockPeriod) + qCDebug(m_dc) << "Image block request received from" << thing->name() << "TSN:" << transactionSequenceNumber << "NamufacturerCode:" << manufacturerCode << "FileVersion:" << fileVersion << "Offset:" << fileOffset << "MaxSize:" << maximumDataSize; if (!m_enabledFirmwareUpdates.contains(thing)) { // If nymea restarted during the process, or the upgrade process has been cancelled in some other way, let's cancel the OTA. qCDebug(m_dc) << "Device requested an image block but update is not enabled for" << thing->name();