From 183cb1e2b130f04da80c1b18e68e48471f4ee356 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Sun, 7 Jan 2024 11:04:43 +0100 Subject: [PATCH] Adjustments after changing type of phase power --- lib/HomeAssistantMqttHandler/json/ha4.json | 12 ++++++------ lib/JsonMqttHandler/json/json4.json | 12 ++++++------ lib/RawMqttHandler/src/RawMqttHandler.cpp | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/HomeAssistantMqttHandler/json/ha4.json b/lib/HomeAssistantMqttHandler/json/ha4.json index c6c85791..4504f945 100644 --- a/lib/HomeAssistantMqttHandler/json/ha4.json +++ b/lib/HomeAssistantMqttHandler/json/ha4.json @@ -3,14 +3,14 @@ "id" : "%s", "type" : "%s", "P" : %d, - "P1" : %.2f, - "P2" : %.2f, - "P3" : %.2f, + "P1" : %d, + "P2" : %d, + "P3" : %d, "Q" : %d, "PO" : %d, - "PO1" : %.2f, - "PO2" : %.2f, - "PO3" : %.2f, + "PO1" : %d, + "PO2" : %d, + "PO3" : %d, "QO" : %d, "I1" : %.2f, "I2" : %.2f, diff --git a/lib/JsonMqttHandler/json/json4.json b/lib/JsonMqttHandler/json/json4.json index 5c50f7de..80da3eec 100644 --- a/lib/JsonMqttHandler/json/json4.json +++ b/lib/JsonMqttHandler/json/json4.json @@ -11,14 +11,14 @@ "id" : "%s", "type" : "%s", "P" : %d, - "P1" : %.2f, - "P2" : %.2f, - "P3" : %.2f, + "P1" : %d, + "P2" : %d, + "P3" : %d, "Q" : %d, "PO" : %d, - "PO1" : %.2f, - "PO2" : %.2f, - "PO3" : %.2f, + "PO1" : %d, + "PO2" : %d, + "PO3" : %d, "QO" : %d, "I1" : %.2f, "I2" : %.2f, diff --git a/lib/RawMqttHandler/src/RawMqttHandler.cpp b/lib/RawMqttHandler/src/RawMqttHandler.cpp index 0e7bddc3..82d78109 100644 --- a/lib/RawMqttHandler/src/RawMqttHandler.cpp +++ b/lib/RawMqttHandler/src/RawMqttHandler.cpp @@ -95,22 +95,22 @@ bool RawMqttHandler::publishList3(AmsData* data, AmsData* meterState) { bool RawMqttHandler::publishList4(AmsData* data, AmsData* meterState) { if(full || meterState->getL1ActiveImportPower() != data->getL1ActiveImportPower()) { - mqtt.publish(topic + "/meter/import/l1", String(data->getL1ActiveImportPower(), 2)); + mqtt.publish(topic + "/meter/import/l1", String(data->getL1ActiveImportPower())); } if(full || meterState->getL2ActiveImportPower() != data->getL2ActiveImportPower()) { - mqtt.publish(topic + "/meter/import/l2", String(data->getL2ActiveImportPower(), 2)); + mqtt.publish(topic + "/meter/import/l2", String(data->getL2ActiveImportPower())); } if(full || meterState->getL3ActiveImportPower() != data->getL3ActiveImportPower()) { - mqtt.publish(topic + "/meter/import/l3", String(data->getL3ActiveImportPower(), 2)); + mqtt.publish(topic + "/meter/import/l3", String(data->getL3ActiveImportPower())); } if(full || meterState->getL1ActiveExportPower() != data->getL1ActiveExportPower()) { - mqtt.publish(topic + "/meter/export/l1", String(data->getL1ActiveExportPower(), 2)); + mqtt.publish(topic + "/meter/export/l1", String(data->getL1ActiveExportPower())); } if(full || meterState->getL2ActiveExportPower() != data->getL2ActiveExportPower()) { - mqtt.publish(topic + "/meter/export/l2", String(data->getL2ActiveExportPower(), 2)); + mqtt.publish(topic + "/meter/export/l2", String(data->getL2ActiveExportPower())); } if(full || meterState->getL3ActiveExportPower() != data->getL3ActiveExportPower()) { - mqtt.publish(topic + "/meter/export/l3", String(data->getL3ActiveExportPower(), 2)); + mqtt.publish(topic + "/meter/export/l3", String(data->getL3ActiveExportPower())); } if(full || meterState->getL1ActiveImportCounter() != data->getL1ActiveImportCounter()) { mqtt.publish(topic + "/meter/import/l1/accumulated", String(data->getL1ActiveImportCounter(), 2));