Added support for getting accumulated energy for phases (Kamstrup)

This commit is contained in:
Conrad Juhl Andersen
2023-07-20 13:04:27 +02:00
parent 4a3d884526
commit 7cbcbd4bc8
5 changed files with 102 additions and 0 deletions

View File

@@ -331,6 +331,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) {
@@ -338,6 +370,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