Fixed danish KAmstrup

This commit is contained in:
Gunnar Skjold
2021-09-13 10:14:47 +02:00
parent 74bc5aa7a0
commit 19223312b5
3 changed files with 12 additions and 3 deletions

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ platformio-user.ini
/src/AmsToMqttBridge.ino.cpp
/test
/web/test.html
/sdkconfig

View File

@@ -22,7 +22,7 @@ AmsData::AmsData(uint8_t meterType, bool substituteMissing, HanReader& hanReader
extractFromKamstrup(hanReader, listSize, substituteMissing);
break;
case METER_TYPE_OMNIPOWER:
extractFromOmnipower(hanReader, listSize);
extractFromOmnipower(hanReader, listSize, substituteMissing);
break;
}
}
@@ -261,8 +261,16 @@ void AmsData::extractFromKamstrup(HanReader& hanReader, uint8_t listSize, bool s
}
}
void AmsData::extractFromOmnipower(HanReader& hanReader, uint8_t listSize) {
void AmsData::extractFromOmnipower(HanReader& hanReader, uint8_t listSize, bool substituteMissing) {
switch(listSize) {
case (uint8_t)Kamstrup::List3PhaseITShort:
case (uint8_t)Kamstrup::List3PhaseShort:
case (uint8_t)Kamstrup::List1PhaseShort:
case (uint8_t)Kamstrup::List3PhaseITLong:
case (uint8_t)Kamstrup::List3PhaseLong:
case (uint8_t)Kamstrup::List1PhaseLong:
extractFromKamstrup(hanReader, listSize, substituteMissing);
break;
case (uint8_t)Omnipower::DLMS:
meterTimestamp = hanReader.getTime( (uint8_t)Omnipower_DLMS::MeterClock, true, true);
activeImportCounter = ((float) hanReader.getInt((uint8_t)Omnipower_DLMS::CumulativeActiveImportEnergy)) / 100;

View File

@@ -63,7 +63,7 @@ private:
void extractFromKaifa(HanReader& hanReader, uint8_t listSize);
void extractFromAidon(HanReader& hanReader, uint8_t listSize, bool substituteMissing);
void extractFromKamstrup(HanReader& hanReader, uint8_t listSize, bool substituteMissing);
void extractFromOmnipower(HanReader& hanReader, uint8_t listSize);
void extractFromOmnipower(HanReader& hanReader, uint8_t listSize, bool substituteMissing);
};
#endif