What This Workflow Does
This intelligent automation system transforms traditional fish farming by connecting weather forecasts directly to feeding decisions. It solves the common problem of overfeeding during rainy periods, which wastes expensive feed and degrades water quality. By fetching official BMKG weather data for Indonesia, the workflow analyzes 6-hour and 12-hour rain probabilities, then automatically adjusts feeding schedules and quantities.
The system reduces feed by 20% when rain probability exceeds 60%, matching natural fish behavior during adverse weather. It sends commands to ESP8266-based fish feeder hardware via HTTP webhooks and provides comprehensive Telegram notifications with weather analysis, feeding decisions, and hardware status. This creates a complete feedback loop where environmental data drives operational decisions without manual intervention.
How It Works
1. Weather Data Collection
The workflow triggers twice daily (05:30 and 16:30 WIB) using n8n's schedule node. It fetches official BMKG weather forecasts for your specific ADM4 region via HTTP request, extracting precise rain probability percentages for the coming 6 and 12-hour periods.
2. Intelligent Decision Making
A JavaScript code node processes the weather data, applying configurable thresholds. If rain probability exceeds your set limit (default: 60%), it calculates appropriate feed reduction (default: -20%) and generates specific command payloads for the hardware.
3. Hardware Control
The system sends structured JSON commands via HTTP POST to your ESP8266/ESP32 device's IP address. These commands trigger servo motors or other feeding mechanisms, executing the precise feeding amount determined by the weather analysis.
4. Notification & Logging
Comprehensive Telegram messages detail the weather analysis, feeding decision rationale, hardware response status, and next scheduled feeding. All activities are logged with timestamps for operational monitoring and pattern analysis.
Pro tip: Start with a conservative 15% feed reduction during initial testing. Monitor fish behavior and water parameters for 1-2 weeks before adjusting thresholds. Different fish species have varying sensitivity to weather changes.
Who This Is For
This automation is ideal for commercial aquaculture operations in Indonesia seeking to optimize feed costs and labor. Hobbyist fish farmers with medium to large ponds will benefit from reduced daily maintenance. Agricultural technology companies can use this as a foundation for more complex farm management systems. Educational institutions teaching IoT and smart agriculture concepts will find this a practical, real-world application. Environmental researchers studying the impact of weather on aquaculture can adapt the data collection and analysis components.
What You'll Need
- n8n instance (self-hosted or cloud) with internet access
- Telegram bot created via @BotFather for notifications
- ESP8266 or ESP32 microcontroller with servo motor for automated feeding mechanism
- Basic Arduino programming knowledge to set up the hardware webhook endpoint
- Indonesian location with known BMKG ADM4 regional code
- Stable internet connection at both n8n and hardware locations
Quick Setup Guide
- Import the template: Download the JSON file and import into your n8n instance via the workflow import function.
- Configure credentials: Set up your Telegram bot token and chat ID in n8n's credential management system.
- Update location settings: Modify the configuration node with your latitude, longitude, and BMKG ADM4 code.
- Set hardware IP: Enter your ESP8266 device's local IP address in the HTTP request node targeting your feeder.
- Adjust thresholds: Customize the rain probability threshold (default: 60%) and feed reduction percentage (default: -20%) in the code node.
- Test the workflow: Execute manually once to verify all connections work before enabling the schedule trigger.
Key Benefits
20-30% feed cost reduction through precise weather-based portion control. Fish naturally eat less during rainy periods, and this system matches feeding to actual appetite rather than fixed schedules.
Improved water quality by preventing overfeeding that leads to ammonia spikes and oxygen depletion. Better water parameters directly correlate with reduced disease incidence and faster growth rates.
Labor savings of 10-20 hours weekly per farm location by automating twice-daily feeding routines. Staff can focus on monitoring, maintenance, and value-added tasks rather than repetitive feeding.
Data-driven decision making with comprehensive logs of weather conditions, feeding decisions, and hardware performance. This historical data helps optimize thresholds and identify patterns for further efficiency gains.
Scalable architecture that supports multiple ponds or locations from a single workflow. Each location can have customized thresholds while sharing the same core automation logic.