The Farm21 import function (<importType>Farm21</importType>) imports data from the Farm21 API. (since 2021.01).
See also: https://www.farm21.tech/field-sensor
Example JSON file
Each sensor has a unique id. It can be retrieved from the GUI (https://www.farm21.tech/field-sensor) 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.
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
- 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: