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,
VoltageL3_OBIS,
VoltageL3,
MeterClock_OBIS,
MeterClock,
CumulativeActiveImportEnergy_OBIS,
CumulativeActiveImportEnergy,
CumulativeActiveExportEnergy_OBIS,
CumulativeActiveExportEnergy,
CumulativeReactiveImportEnergy_OBIS,
CumulativeReactiveImportEnergy,
CumulativeReactiveExportEnergy_OBIS,
CumulativeReactiveExportEnergy
};

View File

@ -71,15 +71,15 @@ void loop() {
if (hanReader.read(samples[sampleIndex++]))
{
// Get the list identifier
int list = hanReader.getList();
int listSize = hanReader.getListSize();
Serial.println("");
Serial.print("List #");
Serial.print((byte)list, HEX);
Serial.print("List size: ");
Serial.print(listSize);
Serial.print(": ");
// 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);
Serial.println(id);
@ -114,6 +114,12 @@ void loop() {
Serial.println(" A)");
}
if (listSize == (int)Kamstrup::List2)
{
time_t clock = hanReader.getTime((int)Kamstrup_List2::MeterClock);
Serial.print("Clock is: ");
Serial.println(clock);
}
}
}