SmartSpray is an irrigation system controlled by Home Assistant and implemented on an ESP32 microcontroller using ESPHome. The system allows you to schedule and control irrigation zones based on various conditions such as temperature, rainfall, and specific time intervals.
The dashboard_layout.yaml
file defines the layout of the irrigation dashboard in Home Assistant.
- Title: Irrigation
- Views:
- Home:
- Entities:
- Current time
- Rainfall in the past day
- Minimum temperature
- Zone Programming:
- Selectable start time
- Individual day toggles
- Zones:
- Zone 1: Enable toggle and duration
- Zone 2: Enable toggle and duration
- Zone 3: Enable toggle and duration
- Zone 4: Enable toggle and duration
- Entities:
- Home:
The ESP32code.yaml
file contains the ESPHome configuration for the irrigation system.
device_name
: irrigationswitch_id
: Irrigationrainfall
: sensor.buienradar_rain_1dtemperature
: sensor.buienradar_temperature
- Board: ESP32 development board
- Flash write interval: 1 minute
- SSID and password are set through secrets
- Fallback hotspot (captive portal) enabled in case of WiFi connection failure
- API and OTA (Over-the-Air) updates enabled
- Home Assistant time integration for time synchronization
- Global variables for zone remainings and days to run
- Rainfall and temperature sensors imported from Home Assistant
- WiFi signal strength sensor
- Template sensors for zone remainings
- Template switches for each irrigation zone
- Template switches for each day of the week
- Template switches for enabling/disabling each irrigation zone
- GPIO switches for controlling irrigation channels
- Various scripts for turning off valves and managing zone waiting times
- Interval set to 1 second for time-based automations
- Checks conditions such as minimum temperature and maximum rainfall before triggering irrigation
- Time-based automations for starting each irrigation zone based on configured schedule
- Install the necessary Home Assistant elements and resources, including the
multiple-entity-row
element. - Configure WiFi settings in ESPHome using secrets.
- Adjust irrigation settings such as start time, zone durations, and conditions in Home Assistant.
- Flash the ESP32 with the provided configuration.
- Monitor and control the irrigation system through the Home Assistant dashboard.