Overview

The NRWTelemetry importer facilitates access to recent and historical data relating to measurements taken on site by NRW telemetry system.

More information, including licensing, can be found on https://api-portal.naturalresources.wales/

The import feature was introduced in 2024 but is available from Delft-FEWS version 2023.02 onwards. Note that this import request all available data. If performance matters, it is recommended to use the NRWTelemetryMeasure import instead. 

Authentication

The NRW API portal allows access in two ways.

  • For NRW users, by a user name and password. A tenant key is also required to form the token url.
<general>
    <importType>NRWTelemetry</importType>
	<serverUrl>https://api.naturalresources.wales/telemetry/api/measures/readings</serverUrl>
	<user>{{user}}</user>
	<password>{{password}}</password>
	...
</general>
<properties>
	<string key="tokenUrl" value="https://login.microsoft.com/{{tenant}}/oauth2/v2.0/token"></string>
</properties>


  • For external users, with an api key, which is provided by NRW
<general>
	<importType>NRWTelemetry</importType>
	<serverUrl>https://api.naturalresources.wales/telemetry/api/measures/readings</serverUrl>
	<relativeViewPeriod unit="hour" start="-3" end="0"/>
	...
</general>
<properties>
	<string key="apiKey" value="{{apiKey}}"></string>
</properties>

Import only gaps

It is possible to use the onlyGaps configuration option (see onlyGaps). Note that the timestep of the timeseries needs to equidistant and equal to (a multiple of) 15 minutes.

Configuration (Example)

ModuleConfigFiles

The following example of an Import Module Instance will import all available time-stamped readings for all measures for the last three hours.

Import_AROME.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">
	<import>
		<general>
			<importType>NRWTelemetry</importType>
			<serverUrl>https://api.naturalresources.wales/telemetry/api/measures/readings</serverUrl>
			<user>{{user}}</user>
			<password>{{password}}</password>
			<relativeViewPeriod unit="hour" start="-3" end="0"/>
			<idMapId>NRW_map</idMapId>
		</general>
		<properties>
			<string key="tokenUrl" value="https://login.microsoft.com/{{tenant}}/oauth2/v2.0/token"></string>
		</properties>
		<timeSeriesSet>
			<moduleInstanceId>Import_Telemetry</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Water Level</parameterId>
			<locationId>H055000044</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="minute" multiplier="15" />
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>


IdMapFiles

Defines the ID mapping of the location and parameters. Note that the external parameter is not used.

sample of IdImportAROME.xml
<idMap 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/idMap.xsd" version="1.1">
	<map internalLocation="H055000044" internalParameter="Water Level" externalLocation="H055000044 Water Level Stage" externalParameter="-9999"/>
	<map internalLocation="H067000042" internalParameter="Water Level" externalLocation="H067000042 Water Level Wych Brook" externalParameter="-9999"/>
</idMap>



  • No labels