From 5b94d8ff61c4149a66c67c102a653e67eda504a1 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Tue, 25 Feb 2020 14:08:04 +0100 Subject: [PATCH] Added calculated value for L2 current when missing from Aidon --- src/AmsData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AmsData.cpp b/src/AmsData.cpp index 8bd1ed39..8ba6d5a9 100644 --- a/src/AmsData.cpp +++ b/src/AmsData.cpp @@ -167,6 +167,7 @@ void AmsData::extractFromAidon(HanReader& hanReader, int listSize) { l1voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL1)) / 10; l2voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL2)) / 10; l3voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL3)) / 10; + l2current = ((activeImportPower * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage; threePhase = true; break; }