Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The MultiflexMeter import function (<importType>MultiflexMeter</importType>) imports scalar time series from the MultiflexMeter servce (https://www.multiflexmeter.nl/). The services service provides timeSeries data in JSON format.

Configuring the Import

To make the importer known to FEWS, the import module has to be declared in the moduleInstanceDescriptors.xml in the RegionConfigFiles directory of the FEWS configuration:Import MultiflexMeter data, a timeSeriesImportRun has to be configured.

The following parts of the import configuration are important:

  1. importType: MultiflexMeter

  2. serverUrl: https://portal.multiflexmeter.net/api/v1/timeseries/{locationId}/?resolution=30s

    1. The tag {locationId} will be replaced by FEWS with the configured locations in the timeSeriesSet.

  3. The username and the password of the multiflexmeter api should be provided in the global.properties.

  4. A relative view period has to be configured that will determine the period for which the timeseries will be requested from the API. 
  5. An idMap should be configured to map FEWS locations to the multiflex locations and FEWS parameters to Multiflex parameters.
  6. Missing values: the service returns values that probably should be interpreted as missing values. For example, the value 65535 is returned quite often and is probably a missing value.

Limitations

It is assumed that all timeseries responses are in the following format.

Code Block
{
  "time": "2019-09-18T12:16:30Z",
  "mean_value": 159
}


Example Import Configuration

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
Code Block
xmlxml
<import>
    <general>
        <importType>MultiflexMeter</importType>
        <serverUrl>https://portal.multiflexmeter.net/api/v1/timeseries/{locationId}/?resolution=30s</serverUrl>
        <user>$MULTIFLEX<user>dummy_METER_USER$<user</user>
        <password>$MULTIFLEX<password>dummy_METER_PASSWORD$<password</password>
        <relativeViewPeriod unit="hour" start="-12024" end="0" startOverrulable="true"/>
        <idMapId>IdImportMultiFlex</idMapId>
   		<missingValue>65535.0</missingValue>
        <dataFeedId>Multiflex Meter</dataFeedId>
    </general>
    <timeSeriesSet>
        <moduleInstanceId>ImportMultiflexMeter</moduleInstanceId>
        <valueType>scalar</valueType>
        <parameterId>water_distance_from_device<<parameterId>T.obs</parameterId>
        <locationId>mfm1040</locationId>		<locationSetId>MultiflexMeterLocations</locationSetId>
        <timeSeriesType>external historical</timeSeriesType>
        <timeStep unit="minute" multiplier="30"/>nonequidistant"></timeStep>
        <readWriteMode>add originals</readWriteMode>
    </timeSeriesSet>
</import>

</timeSeriesImportRun>


An example of a MultiflexMeter json response can be seen here:

Code Block
xml
xml
{
  "count": 2,
  "points": [
    {
      "time": "2019-09-18T12:1014:00Z30Z",
      "mean_value": 6553558
    },
    {
      "time": "2019-09-18T12:1015:30Z00Z",
      "mean_value": 6553537
    }
  ]
}

...