Fixing missing OBIS in enum, adding clock to test project

This commit is contained in:
Roar Fredriksen
2017-10-26 00:47:29 +02:00
parent dfb80cfc65
commit 7e697f27bb
2 changed files with 15 additions and 5 deletions

View File

@@ -71,12 +71,16 @@ enum class Kamstrup_List2
VoltageL2, VoltageL2,
VoltageL3_OBIS, VoltageL3_OBIS,
VoltageL3, VoltageL3,
MeterClock_OBIS,
MeterClock, MeterClock,
CumulativeActiveImportEnergy_OBIS,
CumulativeActiveImportEnergy, CumulativeActiveImportEnergy,
CumulativeActiveExportEnergy_OBIS,
CumulativeActiveExportEnergy, CumulativeActiveExportEnergy,
CumulativeReactiveImportEnergy_OBIS,
CumulativeReactiveImportEnergy, CumulativeReactiveImportEnergy,
CumulativeReactiveExportEnergy_OBIS,
CumulativeReactiveExportEnergy CumulativeReactiveExportEnergy
}; };

View File

@@ -71,15 +71,15 @@ void loop() {
if (hanReader.read(samples[sampleIndex++])) if (hanReader.read(samples[sampleIndex++]))
{ {
// Get the list identifier // Get the list identifier
int list = hanReader.getList(); int listSize = hanReader.getListSize();
Serial.println(""); Serial.println("");
Serial.print("List #"); Serial.print("List size: ");
Serial.print((byte)list, HEX); Serial.print(listSize);
Serial.print(": "); Serial.print(": ");
// Only care for the ACtive Power Imported, which is found in the first list // Only care for the ACtive Power Imported, which is found in the first list
if (list == (int)Kamstrup::List1 || list == (int)Kamstrup::List2) if (listSize == (int)Kamstrup::List1 || listSize == (int)Kamstrup::List2)
{ {
String id = hanReader.getString((int)Kamstrup_List1::ListVersionIdentifier); String id = hanReader.getString((int)Kamstrup_List1::ListVersionIdentifier);
Serial.println(id); Serial.println(id);
@@ -114,6 +114,12 @@ void loop() {
Serial.println(" A)"); Serial.println(" A)");
} }
if (listSize == (int)Kamstrup::List2)
{
time_t clock = hanReader.getTime((int)Kamstrup_List2::MeterClock);
Serial.print("Clock is: ");
Serial.println(clock);
}
} }
} }