Automates browser-based data extraction from the IoTCrops admin portal (관수리포트 menu). Built with Playwright + Node.js. Runs a local dashboard to control everything.
If you don't have Node.js yet, install it via Homebrew:
# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Then install Node.js
brew install nodeVerify it works:
node --version # should be v18 or higher
npm --versiongit clone <repo-url>
cd IrrigationReportAutomationOr if you received the folder directly, just cd into it.
The script needs login credentials. Create a file named .env in the project root:
touch .env
open -e .env # opens in TextEdit, or use any text editorPaste in the following (ask your supervisor for the actual values):
ADMIN_EMAIL=your_email_here
ADMIN_PASSWORD=your_password_here
ADMIN_URL=https://admin.iofarm.com/report/
Save and close. This file is gitignored and never committed.
npm installnpx playwright install chromiumThis downloads a bundled Chromium browser that the script controls. You only need to do this once.
npm startA browser window will open, and the Dashboard will appear at http://localhost:3456 in your default browser.
When the dashboard opens, configure and start the run:
| Setting | What it does |
|---|---|
| Manager | Select 승진 or 진우 (or type a custom name) |
| Start From | Which farm to begin processing from |
| Mode | Normal / Watch / Learning (see below) |
| Max Farms | How many farms to process (use 3 for testing) |
Click "Start Automation" when ready.
The dashboard shows live logs, screenshots, and pause/stop controls while it runs.
Results are saved to the data/ folder as JSON files.
Runs fully automatically. Extracts irrigation times from charts and saves results.
Same as Normal but doesn't click anything. Use this to verify the script navigates correctly without changing data.
Shows the script's detection on each chart and pauses for your review:
- Green circle = detected first irrigation point
- Red circle = detected last irrigation point
If the detection is correct: press F8 to continue If the detection is wrong: click the correct points on the chart, then press F8
After 10–20 corrections the algorithm noticeably improves.
# Standard run
npm start
# Run for a specific manager
MANAGER="진우" npm start
MANAGER="승진" npm start
# Run with learning mode active
CHART_LEARNING="true" npm start
# Run learning mode for a specific manager
MANAGER="진우" CHART_LEARNING="true" npm start
# Analyze what the algorithm learned from your corrections
npm run analyze1. npm start → check if data looks right
2. CHART_LEARNING="true" npm start → if detection is off, correct it 10–20 times
3. npm run analyze → see what improved
4. npm start → now runs with better accuracy
Dashboard doesn't open
Check the terminal for a line like Dashboard server started at http://localhost:XXXX.
If port 3456 is taken, the server picks the next available port automatically.
Script hangs and does nothing You're probably in Learning Mode and need to press F8 to continue.
"Cannot find module" or import errors
Run npm install again — a dependency is missing.
Browser opens but login fails
Double-check your .env file has the correct email, password, and URL with no extra spaces.
Kill all Node processes if something is stuck
killall nodeIrrigationReportAutomation/
├── irrigation-playwright.js # Main automation script
├── src/ # Core modules (auth, navigation, chart analysis)
├── training/ # Saved learning data (gitignored)
├── data/ # Extracted results (gitignored)
├── .env # Credentials (gitignored, you create this)
├── package.json
└── README.md
- Playwright — browser automation
- Node.js (ES Modules) — runtime
- TensorFlow.js — TCN model for irrigation detection
- HSSP Algorithm — baseline chart analysis (Highest Slope Start Point)
- Dashboard — HTTP server with Server-Sent Events for real-time UI