You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

The Sencrop import function (<importType>Sencrop</importType>) imports data from the Sencrop API. (since 2021.01).

See also: https://developer.sencrop.com/guide

The raw data can be retrieved per device. A device id can be mapped to a FEWS location id. 

A typical query to get the rew dataq from a device is: https://api.sencrop.com/v1/users/1664/devices/33/data/raw and will give a response as 

Example JSON file

[
  {
    "date": "2017-10-09T23:54:07.000Z",
    "type": "RELATIVE_HUMIDITY",
    "value": 65.2,
    "discarded": false
  }
]


Mapped json fields

From the json fields, the following parts will be mapped to FEWS:

  • date: timestep

  • type: parameter id
  • value: value

Configuring the Import

De import type and have to be configured in the Import Configuration. A basic example where one location and parameter are imported can be seen in the following XML configuration. 


Import Configuration
<?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>Sencrop</importType>
    	    <serverUrl>https://api.sencrop.com/v1/</serverUrl>
	        <user>$SENCROP_USER_NAME$</user>
	        <password>$SENCROP_PASSWORD$</password>
	        <relativeViewPeriod unit="hour" start="-120" end="0" startOverrulable="true"/>
	        <idMapId>IdImportSencrop</idMapId>
	        <dataFeedId>Sencrop</dataFeedId>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>Import_Sencrop</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>RELATIVE_HUMIDITY</parameterId>
            <locationId>33</locationId>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep unit="nonequidistant" />
            <readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>


  • No labels