emrp:ws2025:agv
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| emrp:ws2025:agv [2026/02/27 02:36] – [4.5.2 Automations] 23553_students.hsrw | emrp:ws2025:agv [2026/02/27 21:39] (current) – [4.5.2 Automations] 23553_students.hsrw | ||
|---|---|---|---|
| Line 43: | Line 43: | ||
| Because the current scope uses fans only (no heating/ | Because the current scope uses fans only (no heating/ | ||
| - | The initial control rules are: | + | Although the DHT11 sensors only measure air temperature and relative humidity, these values can be used to calculate the dew point. Dew point is helpful because it is a direct indicator of how close the air is to saturation and therefore to condensation on cold surfaces (e.g., glass), which can promote fungal diseases. In addition, dew point reflects the air’s moisture state more robustly than relative humidity alone, which is temperature-dependent and can appear “high” even when the absolute moisture content is not. This makes dew point a useful metric when deciding whether exchanging inside air with outside air is likely to reduce condensation risk and improve the greenhouse climate. |
| - | | + | < |
| - | * Humidity-driven ventilation: | + | {{ : |
| + | </ | ||
| + | |||
| + | Definitions: | ||
| + | | ||
| + | * RH_in, RH_out = inside/ | ||
| + | * DP_in, DP_out = inside/ | ||
| + | |||
| + | 1. Extreme temperature control (highest priority, ignores humidity): | ||
| + | Goal: prevent heat stress fast. | ||
| + | |||
| + | Start fans if: | ||
| + | |||
| + | * T_in ≥ 29 °C AND T_out < T_in − 0.5% | ||
| + | |||
| + | No humidity/ | ||
| + | |||
| + | 2. Normal temperature control (humidity-safe cooling) | ||
| + | Goal: cool only when it won’t significantly worsen moisture/ | ||
| + | |||
| + | Start fans if: | ||
| + | * 27 °C < T_in < 29 °C | ||
| + | * AND T_out < T_in − 0.5% | ||
| + | * AND DP_out ≤ DP_in + 1% | ||
| + | |||
| + | This allows cooling even if outside dew point is slightly higher, but blocks cases where outside air is much wetter. | ||
| + | |||
| + | 3. Humidity-driven ventilation | ||
| + | Goal: keep RH_in < 70% and reduce mold pressure. | ||
| + | |||
| + | Start fans if: | ||
| + | * RH_in > 70% | ||
| + | * AND T_out ≤ 27 °C | ||
| + | * AND outside air is truly drier: DP_out | ||
| + | |||
| + | If outside dew point is lower, exchanging | ||
| + | |||
| + | If one of these three conditions is true for 1 minute the fans start, if they are false fo 2 minutes the fans turn off. | ||
| ===== 3. Components ===== | ===== 3. Components ===== | ||
| Line 106: | Line 143: | ||
| * Relay | * Relay | ||
| * 2x DHT11 Sensors | * 2x DHT11 Sensors | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| Line 129: | Line 166: | ||
| * Relay controller | * Relay controller | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| Line 171: | Line 208: | ||
| All greenhouse-side electronics (PoE splitter, ESP32, buck converter, breadboard/ | All greenhouse-side electronics (PoE splitter, ESP32, buck converter, breadboard/ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| Line 199: | Line 236: | ||
| * Installed near the top (remove warm, humid air that accumulates above) | * Installed near the top (remove warm, humid air that accumulates above) | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| - | Because the electronics enclosure is mounted on the greenhouse door while the Ethernet feed and the inside sensor cable are routed to fixed points, both cables are installed with sufficient slack to accommodate the door movement without putting strain on connectors or wiring. | + | The electronics enclosure is installed next to the greenhouse door (rather than on the door itself) and remains stationary. The Ethernet feed and the DHT11 sensors |
| ==== 4.4 Software setup ==== | ==== 4.4 Software setup ==== | ||
| Line 233: | Line 270: | ||
| The initial installation step can require internet access because ESPHome may download required build packages and platform dependencies. | The initial installation step can require internet access because ESPHome may download required build packages and platform dependencies. | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| Line 342: | Line 379: | ||
| - | < | + | < |
| {{ : | {{ : | ||
| </ | </ | ||
| Line 359: | Line 396: | ||
| These entities are visualized on a dedicated dashboard to monitor current conditions and to manually override ventilation if required. | These entities are visualized on a dedicated dashboard to monitor current conditions and to manually override ventilation if required. | ||
| - | < | + | To add automatic calculations of the dew points for inside and outside Templates are used. [S3] |
| + | |||
| + | Following the quick link in the Template Documentation or under '' | ||
| + | |||
| + | <file script inside_dew_point.txt> | ||
| + | {% set T = states(' | ||
| + | {% set RH = states(' | ||
| + | {% if T is not none and RH is not none and RH > 0 %} | ||
| + | {% set a = 17.62 %} | ||
| + | {% set b = 243.12 %} | ||
| + | {% set gamma = (a * T) / (b + T) + log(RH / 100) %} | ||
| + | {{ ((b * gamma) / (a - gamma)) | round(2) }} | ||
| + | {% else %} | ||
| + | {{ none }} | ||
| + | {% endif %} | ||
| + | </ | ||
| + | |||
| + | A second template is used for checking if the control condition for venting are met. Instead of a '' | ||
| + | |||
| + | <file script should_vent.txt> | ||
| + | {% set tin = states(' | ||
| + | {% set tout = states(' | ||
| + | {% set hin = states(' | ||
| + | {% set dpin = states(' | ||
| + | {% set dpout = states(' | ||
| + | |||
| + | {% if None in [tin, tout, hin, dpin, dpout] %} | ||
| + | false | ||
| + | {% else %} | ||
| + | {% set dT = 0.5 %} | ||
| + | {% set dp_max = 1.0 %} | ||
| + | {% set dp_margin = 0.7 %} | ||
| + | |||
| + | {% set extreme_temp = (tin >= 29 and tout < (tin - dT)) %} | ||
| + | {% set normal_temp | ||
| + | {% set humidity | ||
| + | |||
| + | {{ extreme_temp or normal_temp or humidity }} | ||
| + | {% endif %} | ||
| + | </ | ||
| + | |||
| + | < | ||
| {{ : | {{ : | ||
| </ | </ | ||
| - | |||
| === 4.5.2 Automations === | === 4.5.2 Automations === | ||
| - | The ventilation control logic is implemented using Home Assistant automations. This includes temperature-driven ventilation and humidity-driven ventilation rules based on comparing inside vs. outside conditions. | + | The ventilation control logic is implemented using Home Assistant automations |
| - | {{ : | + | < |
| + | {{ : | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | {{ : | ||
| + | </ | ||
| + | |||
| + | The following YAML file specifies the criteria that Home Assistant uses to determine when to activate the ventilation system based on 2.2 Control concept. | ||
| + | |||
| + | <file yaml automation.yaml> | ||
| + | alias: Greenhouse Ventilation | ||
| + | description: | ||
| + | Vent switch follows binary_sensor.greenhouse_should_vent with anti-flip-flop | ||
| + | delays. | ||
| + | triggers: | ||
| + | - entity_id: | ||
| + | - binary_sensor.greenhouse_should_vent | ||
| + | to: | ||
| + | - " | ||
| + | for: | ||
| + | hours: 0 | ||
| + | minutes: 1 | ||
| + | seconds: 0 | ||
| + | trigger: state | ||
| + | - entity_id: | ||
| + | - binary_sensor.greenhouse_should_vent | ||
| + | to: | ||
| + | - " | ||
| + | for: | ||
| + | hours: 0 | ||
| + | minutes: 2 | ||
| + | seconds: 0 | ||
| + | trigger: state | ||
| + | actions: | ||
| + | - target: | ||
| + | entity_id: switch.agv_esp32_greenhouse_ventilation | ||
| + | action: switch.turn_{{ trigger.to_state.state }} | ||
| + | mode: single | ||
| + | |||
| + | </ | ||
| + | To prevent the ventilation system from switching on or off due to brief sensor spikes or small fluctuations around the thresholds, the " | ||
| ===== 5. Testing & Validation ===== | ===== 5. Testing & Validation ===== | ||
| ==== 5.1 Test plan ==== | ==== 5.1 Test plan ==== | ||
| Line 400: | Line 518: | ||
| * Testing was performed in a bathroom rather than a real greenhouse, so airflow patterns, heat capacity, and leakage behavior differ significantly. | * Testing was performed in a bathroom rather than a real greenhouse, so airflow patterns, heat capacity, and leakage behavior differ significantly. | ||
| * The controlled tests mainly covered cases where the “inside” environment was hotter and/or more humid than the “outside” reference. Conditions such as rain events, strong solar radiation, and rapid outside fluctuations were not fully represented. | * The controlled tests mainly covered cases where the “inside” environment was hotter and/or more humid than the “outside” reference. Conditions such as rain events, strong solar radiation, and rapid outside fluctuations were not fully represented. | ||
| + | * DHT11 sensors are low accuracy, especially for humidity (often ±5% RH or worse, plus slow response). | ||
| ===== 7. Future Work Ideas ===== | ===== 7. Future Work Ideas ===== | ||
| Line 431: | Line 550: | ||
| * [S1] ESPHome Getting Started (Home Assistant add-on): https:// | * [S1] ESPHome Getting Started (Home Assistant add-on): https:// | ||
| * [S2] ESPHome DHT sensor component documentation: | * [S2] ESPHome DHT sensor component documentation: | ||
| + | * [S3] Home Assistant Template documentation: | ||
emrp/ws2025/agv.1772156213.txt.gz · Last modified: 2026/02/27 02:36 by 23553_students.hsrw