Proposed CSV upload format
This is a proposed format for bulk uploading sensors. To be vetted and verified with Ensemble folks.
Sensor | Name | External_ID | Latitude | Longitude | Reading_types | Depth | Brand | Model | Part_number | hardware_version |
---|---|---|---|---|---|---|---|---|---|---|
Description | How the sensor will be labelled in LiteFarm. | The sensor’s unique external id. This is the identity that will be used to register the sensor with external services and receive readings associated with this sensor. | The latitude for the sensor. | The longitude for the sensor. | Comma delimited list of sensor reading types. Valid values are:
| Assumed to be in cm, only 1 depth per sensor. | The brand of sensor. | The model of sensor. | ||
Data type | String | String | Decimal | Decimal | Specific strings | Decimal | String | String | String | String |
Required? | Required | Optional | Required | Required | Required | Optional | Optional | Optional | Optional | Optional |
Example | “Sensor 1” | “WERKTX” | -31.3624425 | -64.2104754448 | soil_water_content, soil_water_potential, temperature | 10 | “Ensemble Scientific” | “Model ABC” | “ESA-12345” | “B” |
Validation | 1 <= name.length <= 100 | 1 <= id.length <= 20 | -90 <= lat <= 90 | -180 <= long <= 180 | At least 1 of the following: soil_moisture_content, water_potential, temperature | 0 <= depth <= 1000 | String: < 100 length | String: < 100 length | String: < 100 length | String: < 100 length |
Error | “Invalid sensor name, must be between 1 and 100 characters” | “Sensor with external id: <id> already exists.” “Invalid external id, must be between 1 and 20 characters” | “Invalid latitude value, must be between -90 and 90. and fewer than 10 decimals” | “Invalid longitude value, must be between -180 and 180. and fewer than 10 decimals” | “Invalid reading type detected, valid values include:
| “Invalid depth, must be a decimal value between 0 and 1000.” | “Invalid brand, must be fewer than 100 characters.” | “Invalid model, must be fewer than 100 characters.” | “Invalid part_number, must be fewer than 100 characters.” | “Invalid hardware_version, must be fewer than 100 characters.” |
Notes | May need to group sensors with same / similar lat / long on the map. This should be default behaviour since sensors are points. For this project depths can be 10, 20, 30, 50. | If this is “Ensemble Scientific”, it should activate the need to register this sensor during the bulk creation endpoint. |
Definition of a sensor: A device with a single id, name, lat / long, and depth. Must have at least one reading parameter, but may have several. Optionally has a brand and model. Ensemble requires a part_number and hardware_version to register it with their service.
Validation should be performed at least via the API and potentially through the UI as well.
Architectural guidance
Please take this as guidance rather than instruction. The following tables seem to make sense to allow users to document sensors and to integrate them with those external services.
Sensor: The attributes describing the physical device and it’s location. This should somehow tie to a point location for that sensor.
sensor_parameter: The parameters that instruct LiteFarm on how to parse data read by the sensor but don’t change from reading to reading and also aren’t related to the physical nature of the sensor. May just be part of the sensor table!
sensor_reading: Readings from the sensor.
Sensor | ID | Name | Lat_long | Type | Depth | Elevation | … |
---|---|---|---|---|---|---|---|
Description | The sensor’s unique id. | How the sensor will be labelled in LiteFarm. | The latitude and longitude for the sensor, comma separated. | Valid values to begin are: | Assumed to be in cm, comma delimited if multiple depths. | The elevation of ground level at the location where the sensor is mounted. | |
Required? | Required | Required | Required | Required | Optional | Optional | |
Example | “Sensor 1” | -31.362442522541148, -64.21047544487595 |
sensor_parameter | ID | Sensor_id | parameter_number | Type | Parameter_measured | Unit | Min_value | Max_value |
---|---|---|---|---|---|---|---|---|
Description | Unique identifier | Reference to a specific sensor. | For sensors with multiple types, this parameter would define 1 specific type. | |||||
Required? | ||||||||
Example |
Sensor_reading | ID | Read_time | Transmit_time | Sensor_ID | sensor_parameter_id | Value |
---|---|---|---|---|---|---|
Description | A unique identifier for this reading. May have some meaning or traceability for Ensemble. | The timestamp when this reading was captured. | The timestamp when this reading was transmitted. | The sensor reporting the reading. | The calibration which instructs on how to interpret the value. Required since each sensor can have multiple types of readings, e.g. “Temperature” and “Moisture”. | The numerical value of the reading. |
Required? | Required | Required | Required | Required | Required | |
Example |
Questions:
Requirements
- LF-2338Getting issue details... STATUS
Summary | Description | Fix Version |
---|---|---|
Sensor model work | Build out database to support tables for:
| MVP |
Bulk or individual? | v2 | |
Upload screen with template and front-end validation | v1 | |
Bulk sensor creation and outcome splash | v1 |