Meter Reading - AdvantageNavigator/ImportEngine GitHub Wiki

The METER_READING command allows to send energy consumption data to Advantage Navigator. Each meter reading must have a meter identifier, a value (the meter reading value) and a time stamp. The following example shows how to build such a command and how to send the data to Advantage Navigator:

ImportEngineClient client = new ImportEngineClient("user", "secret");
		
MeterReading reading1 = new MeterReading("meter_001", new DateTime("01/01/2015 12:00:00"), 10.0);
MeterReading reading2 = new MeterReading("meter_001", new DateTime("01/01/2015 13:00:00"), 11.0);
MeterReading reading3 = new MeterReading("meter_001", new DateTime("01/01/2015 14:00:00"), 12.0);

MeterReadingCommand command = new MeterReadingCommand();
command.addMeterReading(reading1);
command.addMeterReading(reading2);
command.addMeterReading(reading3);

// quality attribute, description, beginDate
command.setOptionalColumns(true, false, false);

String result = client.executeCommand(command);

Note: a single meter reading command should not contain more than 5000 meter readings. The user of the library is responsible for creating more meter reading commands to devide a larger amount of readings if necessary.

Optional columns

Meter readings may include the optional columns qualityAttribute, description and beginDate. In the upload file, optional columns are introduced in the header with the statement optionalColumnList=. Note that this statement must contain at least one optional column name. Otherwise, the import engine cannot parse the command file.

Each meter reading can contain one or more of these optional colums. The method setOptionalColumns() of the MeterReadingCommand class can be used to specify, which optional columns should be transfered to the Advnatage Navigator import engine. If a meter reading doesn't contain one or more specified columns, default values will be used:

Optional column Default value
Quality attribute Good, Automatic value (33)
Description empty string ("")
Begin date set equal to time stamp

Quality attributes

Each meter reading can optionally contain a quality attribute, which is a bitmask of certain flags explained in the import engine documentation. The library contains an enumeration QualityFlag that contains the flags and a class QualityAttribute that stores a set of quality flags. The following example shows how to use this classes:

QualityAttribute quality = new QualityAttribute();
quality.getQualityFlags().add(QualityFlag.GOOD);
quality.getQualityFlags().add(QualityFlag.AUTOMATIC_VALUE);

int value = quality.getValue();	// returns 33