Data Evaluation - green-ecolution/backend GitHub Wiki
To accurately understand how the watering status of trees is calculated, our system evaluates the sensor data following a clearly defined logic. We always rely on the latest sensor readings received from each sensor to determine the current status of trees. This evaluation is based on sensor readings at three depths: 30 cm, 60 cm, and 90 cm.
Since less centibar/kilopascal (kPa) indicates better soil moisture conditions, lower values are preferable. We determine the appropriate kPa values based on the age of the tree and use a traffic-signal system to help users easily understand the watering status:
- 🟢Green: Everything is fine, no watering needed.
- 🟡yellow: Still fine, but watering may be needed soon.
- 🔴Red: Watering is required.
The specific threshold values for each tree age are as follows:
Tree Age | Depth (cm) | 🟢Green (kPa) | 🟡yellow (kPa) | 🔴Red (kPa) |
---|---|---|---|---|
1st year | 30,60,90 cm | <25 | 25–32 | >32 |
2nd year | 30 cm | <62 | 62–80 | >80 |
60,90 cm | <25 | 25–32 | >32 | |
3rd year | 30 cm | <1585 | – | – |
60,90 cm | <80 | – | >80 |
- For third-year trees, at 30 cm depth, there is no defined orange or red threshold.
- For older trees, no specific evaluation strategy is currently implemented.
To simplify the evaluation, the following general rules apply:
- If all sensors are in the green range 🟢 → No watering is needed.
- If any sensor is in the yellow range 🟡 → The tree is still fine, but may need watering soon.
- If any sensor is in the red range 🔴 → The tree must be watered immediately.
The evaluation logic is applied differently for single trees and tree clusters, as described below:
Evaluation of Single Trees
Each single tree may or may not be equipped with its own sensor box:
-
Single tree with sensor:
The sensor box contains three Watermark sensors, placed at depths of 30 cm, 60 cm, and 90 cm. We use the most recent readings from these sensors to evaluate whether the tree currently requires watering. The evaluation criteria (threshold values) are defined based on the age of the tree (1st year, 2nd year, or 3rd year), as outlined above. -
Single tree without sensor:
If a tree does not have a sensor installed, our system cannot determine its current watering status. The status of such a tree remains unknown ⚪.
Evaluation of Tree Clusters
A tree cluster is a group of multiple trees located closely together. A tree cluster may contain several sensors, but not every tree within the cluster needs to have its own sensor.
To evaluate the watering status of a tree cluster, our system performs the following steps:
-
Identifying Sensors:
Our system considers only the trees within the cluster that have sensors installed. Trees without sensors are excluded from the calculation. -
Calculating Averages:
The latest sensor readings at each depth (30 cm, 60 cm, and 90 cm) are collected from all sensor-equipped trees. Then, the system calculates the average values at each depth.
Example:
Consider a tree cluster consisting of 13 trees, among which only 3 trees have sensors installed. The latest recorded sensor values for these three sensor-equipped trees are as follows:
Sensor Tree | 30 cm (kPa) | 60 cm (kPa) | 90 cm (kPa) |
---|---|---|---|
Tree 1 | 20 | 21 | 22 |
Tree 2 | 31 | 32 | 33 |
Tree 3 | 34 | 35 | 36 |
To calculate the cluster's average soil moisture levels at each depth, the following calculations are performed:
- 30 cm:
(20 + 31 + 34) / 3 = 28 kPa
- 60 cm:
(21 + 32 + 35) / 3 = 29 kPa
- 90 cm:
(22 + 33 + 36) / 3 = 30 kPa
(Note: Values after the decimal point are disregarded.)
Special Case: Clusters with Mixed Tree Ages
Typically, tree clusters are formed by grouping trees of the same planting year, as evaluation thresholds differ according to the tree’s age. However, if a cluster contains trees of varying ages, the system applies the thresholds based on the youngest trees. This approach ensures the health of younger trees, as they have higher water demands.
For example, if a tree cluster contains trees from both the 1st and 2nd years, the system uses the threshold values for 1st-year trees to determine the watering status.
Important Note: Watering Plan Overrides
After trees have been watered, sensors need some time to detect and reflect this change in soil moisture. During this transitional period, the system allows the manually set watering plans to override the automatic sensor-based evaluation status. This ensures the watering status displayed to users is always accurate, even when sensor readings have not yet stabilized. For further information read chapter Scheduler.