Page tree
Skip to end of metadata
Go to start of metadata


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

See also:

Example JSON file

    "name": "Test sensor 1",
    "id": 1450,
    "readings": [
        "soil_moisture_10": 11.6,
        "soil_moisture_20": 16.8,
        "soil_moisture_30": 18.9,
        "soil_temperature": 11,
        "humidity": 67.2,
        "air_temperature": 10,
        "crop_type": null,
        "race_type": null,
        "cultivation_type": null,
        "latitude": 0,
        "longitude": 0,
        "measured_at": "2020-10-29T15:46:28.000000Z",
        "id": 1804953

Location ids

Each sensor has a unique id. It can be retrieved from the GUI ( in the groups and sensors when clicking on the sensor id. This is the id the FEWS location id should be mapped to with id mapping.

Group ids

Sensor are grouped. The id of a group can be found when clicking on the group edit functionality.

Mapped json fields

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

  • id: locationId
  • readings: events

  • reading.soil_moisture_10: value of the soil moisture 10 parameter.
  • reading.soil_moisture_20: value of the soil moisture 20 parameter.
  • reading.soil_moisture_30: value of the soil moisture 30 parameter.
  • reading.soil_temperature: value of the soil temperature parameter.
  • reading.humidity: value of the humidity parameter.
  • reading.air_temperature: value of the air temperature parameter.

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. 

For the password a key has to be generated using the portal of Farm21. 

To get all sensor data for an organization, specify the server url as follows:


It is also possible to specify a specific group id to import only sensors that are part of that group. The group id is available in the portal. The groupid is part of the configured URL and should be changed to the group id to be used. See the serverUrl in the following example where the group id is 668.


For a complete example of the import configuration, see the following example:

Import Configuration
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="" xmlns:xsi="" xsi:schemaLocation="">
	        <relativeViewPeriod unit="hour" start="-120" end="0" startOverrulable="true"/>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep unit="nonequidistant" />
            <readWriteMode>add originals</readWriteMode>

  • No labels