Smart Garden Irrigation Mobile App Development
Irrigation automation — task where mobile app must work with combination of factors: schedule, soil humidity data, weather forecast, user geolocation. A smart irrigation controller differs from simple timer by integrating these data sources.
Equipment and Protocols
Rachio — most API-open irrigation controller. REST API at https://api.rach.io/1/public. OAuth2. Zone management: PUT /device/{deviceId}/zone/start_multiple with zones and durations. Get state: GET /device/{deviceId}. WebHook support for events (irrigation started, completed, error).
Hunter Pro-HC — popular commercial controller. Wi-Fi module, HTTP API via local network. No public docs — integrate via reverse-engineering or Home Assistant rainbird integration.
RainBird — official Local API documented. UDP protocol on port 80. LNK WiFi Module supports JSON commands locally without cloud.
ESPHome — for DIY controllers on ESP32. MQTT or HTTP API. Full logic control, open protocol.
Zigbee valves (SASWELL, Woox R4044) — Zigbee2MQTT, command {"state": "ON", "duration": 600} (600 seconds open).
Irrigation Schedule
Irrigation schedule more complex than lighting. Need:
- Days of week or interval (every N days)
- Start time (accounting timezone and DST)
- Duration for each zone
- Skip conditions (rain, high soil humidity)
Schedule UI: table with days horizontally, zones vertically. Tap cell — set duration for that zone that day. On Flutter: Table with InkWell cells or custom CustomPainter for richer UI.
Store schedule backend or directly in controller (Rachio stores itself). Backend storage — execute via cron (node-cron or APScheduler), account for user timezone (moment-timezone or Python zoneinfo).
Weather Forecast Integration
Skip watering in rain — key "smart" function. Weather API options:
Open-Meteo — free, no API key, good accuracy. GET https://api.open-meteo.com/v1/forecast?latitude=...&longitude=...&daily=precipitation_sum&forecast_days=2. If precipitation_sum > 5mm next 24 hours — skip watering.
OpenWeatherMap — daily endpoint in One Call API 3.0 (paid, cheap). rain.1h in mm.
Weather Underground Personal Weather Station — private weather station data more accurate than major providers.
Skip logic: 30 minutes before scheduled watering, backend fetches forecast. If precipitation expected — cancel session, log reason, push user. User can disable auto-skip in settings.
Soil Humidity Sensors
Capacitive soil moisture sensor (on ESP32/Arduino) — analog values 0–4095, linear calibration to humidity percent. MQTT publication every 5–30 minutes. High humidity — auto skip watering.
Commercial sensors: Xiaomi Mi Flora — BLE, flutter_blue_plus for reading characteristic 00001a01-0000-1000-8000-00805f9b34fb (humidity level + illuminance + soil temperature + nutrients). Poll BLE every 5 minutes when phone nearby or via Bluetooth gateway (Raspberry Pi) for continuous monitoring.
On zone screen: soil humidity graph last 7 days + "watering threshold" line. Below graph — session history with skip reasons. fl_chart with LineChart, BarChart for history.
Mobile App: What Matters in UI
Main screen — zone list with crop icons (lawn, garden, flowers), watering status (active/inactive), last watering, soil humidity. Manual start button for each zone with duration selection.
Important: show remaining active watering time with countdown. Not polling every second — WebSocket with update every 10 seconds from backend.
Notifications: watering started, completed, skipped due to rain, error (no pressure, valve didn't respond).
Timeline
Basic app with manual control, scheduling, Rachio integration — 4–6 weeks. Humidity sensors, weather forecast, smart skip, multiple controllers, history with graphs — 10–14 weeks. Cost calculated after determining device and data source set.







