Crops and automation rules work together to keep greenhouse conditions within the limits your plants need. A crop profile stores the acceptable min/max range for each environmental variable. When the Dashboard detects a reading outside those ranges it creates an alert automatically. Automation rules go further: they instruct the ESP32 to activate or deactivate an actuator—or fire an alert—whenever a sensor reading crosses a threshold you define.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/frontend-AgroPulse/llms.txt
Use this file to discover all available pages before exploring further.
Crop profiles
A crop profile is a named set of per-sensor min/max thresholds. You can create multiple profiles for a greenhouse and switch between them; only one profile is active at a time. The Dashboard uses the active profile to decide when to generate auto-alerts.Threshold fields
| Field | Unit | Description |
|---|---|---|
temp_min / temp_max | °C | Acceptable temperature range |
humidity_min / humidity_max | % | Acceptable air humidity range |
soil_moisture_min / soil_moisture_max | % | Acceptable soil moisture range |
light_min / light_max | lx | Acceptable illuminance range |
co2_min / co2_max | ppm | Acceptable CO₂ concentration range |
Creating a crop profile
Select a greenhouse
On the Cultivos page, click a greenhouse chip to filter the view. The Nuevo cultivo button only appears when a greenhouse is selected.
Enter the crop name and variety
Provide a name (e.g. “Tomato”) and an optional variety (e.g. “Cherry”). Both are free-text fields.
Set threshold ranges
Enter min/max values for temperature, air humidity, and soil moisture. You can also use the Rellenar con IA button—AgroPulse will call an AI model and pre-fill the ranges based on the crop name and variety. Review the values before saving.
Mark as active
Check Cultivo activo if this profile should be used for Dashboard alert generation. Only one profile is treated as active; the Dashboard picks the first profile flagged active, or the first profile in the list if none is flagged.
How Dashboard alerts are triggered
Every time the Dashboard polls the backend (every 5 seconds), it compares the latest readings against the active crop profile. If a value is outside the defined range, anAutoAlert is created locally and a WARNING-level alert is posted to the backend via the alerts API. The alert banner at the top of the Dashboard can be dismissed per-alert, but the backend record persists.
Alert generation on the Dashboard only covers temperature, humidity, and soil moisture. Light and CO₂ thresholds from the crop profile are stored and available for automation rules, but are not currently checked in the Dashboard poll loop.
Automation rules
Automation rules define IF/THEN logic scoped to a greenhouse. When the condition is met, AgroPulse instructs the linked actuator to perform the specified action.Rule fields
Each rule (RuleDto) has the following fields:
| Field | Type | Description |
|---|---|---|
name | string | Human-readable rule name |
sensorType | SensorType | The sensor type whose readings are evaluated |
conditionType | enum | Comparison operator applied to the reading |
threshold | number | The value the reading is compared against |
actuatorId | number | The actuator to control when the condition is met |
actionType | enum | What to do with the actuator |
active | boolean | Whether the rule is currently enabled |
Condition types
GREATER_THAN
Triggers when the sensor reading is strictly greater than the threshold value. Use for “too hot”, “too humid”, or “too bright” scenarios.
LESS_THAN
Triggers when the sensor reading is strictly less than the threshold value. Use for “too cold”, “too dry”, or “too dark” scenarios.
EQUALS
Triggers when the sensor reading exactly equals the threshold value. Useful for discrete digital sensors.
NOT_EQUALS
Triggers when the sensor reading does not equal the threshold value. Useful for detecting unexpected states from digital sensors.
Action types
| Action | Effect |
|---|---|
ACTIVATE | Turns the actuator on (e.g. start a pump or fan) |
DEACTIVATE | Turns the actuator off |
ALERT | Sends an alert notification without changing actuator state |
Creating a rule
Select a greenhouse
On the Automatización page, click a greenhouse chip. The Nueva regla button only appears once a greenhouse is selected.
Define the IF condition
Choose a sensor type, a condition type, and a numeric threshold. For example:
TEMPERATURE GREATER_THAN 30 triggers when any temperature sensor in the greenhouse reads above 30 °C.Define the THEN action
Select an actuator (from those registered to the greenhouse) and an action type. For example: actuator “Extractor Fan” with action
ACTIVATE.Enable the rule
The Regla activa checkbox is checked by default. Uncheck it to create the rule in a paused state.