Merge pull request #613 from cnrd/phase-accumlation

Added support for getting accumulated energy for phases (Kamstrup)
This commit is contained in:
Gunnar Skjold
2024-01-06 19:53:10 +01:00
committed by GitHub
5 changed files with 102 additions and 0 deletions

View File

@@ -407,6 +407,38 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
listType = 4;
l3activeExportPower = val;
}
val = getNumber(AMS_OBIS_ACTIVE_IMPORT_L1_COUNT, sizeof(AMS_OBIS_ACTIVE_IMPORT_L1_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l1activeImportCounter = val/1000;
}
val = getNumber(AMS_OBIS_ACTIVE_IMPORT_L2_COUNT, sizeof(AMS_OBIS_ACTIVE_IMPORT_L2_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l2activeImportCounter = val/1000;
}
val = getNumber(AMS_OBIS_ACTIVE_IMPORT_L3_COUNT, sizeof(AMS_OBIS_ACTIVE_IMPORT_L3_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l3activeImportCounter = val/1000;
}
val = getNumber(AMS_OBIS_ACTIVE_EXPORT_L1_COUNT, sizeof(AMS_OBIS_ACTIVE_EXPORT_L1_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l1activeExportCounter = val/1000;
}
val = getNumber(AMS_OBIS_ACTIVE_EXPORT_L2_COUNT, sizeof(AMS_OBIS_ACTIVE_EXPORT_L2_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l2activeExportCounter = val/1000;
}
val = getNumber(AMS_OBIS_ACTIVE_EXPORT_L2_COUNT, sizeof(AMS_OBIS_ACTIVE_EXPORT_L2_COUNT), ((char *) (d)));
if (val != NOVALUE) {
listType = 4;
l3activeExportCounter = val/1000;
}
if(meterType == AmsTypeKamstrup) {
if(listType >= 3) {
@@ -414,6 +446,12 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
activeExportCounter *= 10;
reactiveImportCounter *= 10;
reactiveExportCounter *= 10;
l1activeImportCounter *= 10;
l2activeImportCounter *= 10;
l3activeImportCounter *= 10;
l1activeExportCounter *= 10;
l2activeExportCounter *= 10;
l3activeExportCounter *= 10;
}
if(l1current != 0)
l1current /= 100;

View File

@@ -55,6 +55,12 @@ private:
uint8_t AMS_OBIS_ACTIVE_EXPORT_L1[4] = { 22, 7, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_EXPORT_L2[4] = { 42, 7, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_EXPORT_L3[4] = { 62, 7, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_IMPORT_L1_COUNT[4] = { 21, 8, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_IMPORT_L2_COUNT[4] = { 41, 8, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_IMPORT_L3_COUNT[4] = { 61, 8, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_EXPORT_L1_COUNT[4] = { 22, 8, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_EXPORT_L2_COUNT[4] = { 42, 8, 0, 255 };
uint8_t AMS_OBIS_ACTIVE_EXPORT_L3_COUNT[4] = { 62, 8, 0, 255 };
};
#endif