- 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 |
Proposed CSV upload format
Sensor | ID | Name | Lat_long | Reading_types | Depth | Brand | Model |
---|---|---|---|---|---|---|---|
Description | 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. | How the sensor will be labelled in LiteFarm. | The latitude and longitude for the sensor, comma separated. | Comma delimited list of sensor reading types. Valid values are:
| Assumed to be in cm, only 1 depth per sensor. For this project depths can be 10, 20, 30, 50. | The brand of sensor. | The model of sensor. |
Required? | Required | Required | Required | Required | Required | Optional | Optional |
Example | WERKTX | “Sensor 1” | -31.362442522541148, -64.21047544487595 | soil_moisture_content, water_potential, temperature | 10 | “Ensemble Scientific” | “Model ABC” |
Notes | Where the sensor has been placed in the ground. | Will need to be grouped on the map. This should be default behaviour since sensors are points. |
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.
When uploading, LiteFarm needs to perform validation on the uploaded content.
Column | Valid inputs | Possible errors |
---|---|---|
ID | 1 <= id.length <= 20 | “Sensor with id <id> already exists.” “Sensor id invalid, must be between 1 and 20 characters” |
Name | 1 <= name.length <= 100 | “Sensor name invalid, must be between 1 and 100 characters” |
Lat_long | -90 <= lat <= 90 -180 <= long <= 180 | “Invalid format for lat_long, must be: 1.2345, 6.7890” “Invalid lat entry, must be between -90 and 90.” “Invalid long entry, must be between -180 and 180.” |
Reading_types | At least 1 of the following: soil_moisture_content, water_potential, temperature | “Invalid type detected, must be: soil_moisture_content, water_potential, or temperature.” |
Depth | 0 <= depth <= 500; must be a decimal value. Assumed to be cm. | “Invalid depth, must be a decimal value between 0 and 500.” |
Brand | String: < 100 length | “Brand must be fewer than 100 characters.” |
Model | String: < 100 length | “Model must be fewer than 100 characters.” |
Validation should be performed at least via the API and potentially through the UI as well.
Architecture
Sensor: The attributes describing the physical device and it’s location
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 calibration 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:
What are the valid types of sensor (reading) types to start with?
How do we link up sensor_reading_types with a depth via csv upload?
How does ensemble tie a reading to a parameter when posting new sensor readings?
What is the format for registering an organization with ESCI?
What is the format for registering a callback address with ESCI?
What is the format for registering sensors with ESCI?
What depths are the sensors at?
10, 20, 30, and 50cm. Duplicates at 10 and 30.
Are there any attributes above that are missing?
What data types can we have for sensor reading values?