Use Cases
10
UC1-UC9, UC11
Tests
119
All passing
Workflows
2
Daily + Weekly
Schedule
6x/day
Every 4 hours
Production Monitoring
UC1Admin Production Alerts
15 testsProduction
Monitors all solar plants for production anomalies and sends system-wide alerts to admin.
Features
- RED alert: Production < 20% of baseline for 3 consecutive days
- ORANGE alert: Production < 40% of baseline for 3 consecutive months
- Auto-ignore: Plants with 0 production for 1 month
- HTML email with color-coded alert sections
UC2Customer Weekly Reports
16 testsProduction
Generates personalized weekly production reports for each customer every Sunday.
Features
- Weekly, monthly, yearly production totals
- Month-over-month and year-over-year comparisons
- Multi-plant support per customer
- Admin summary email with all customers combined
Device Alarms & Notifications
UC3Device Alarm Notifications
38 testsProduction
Monitors device-level warnings from ShineMonitor API and sends alarm notifications to admin and customers.
Features
- Fetches UNHANDLED device alarms via webQueryPlantsWarning API
- 3-send rule: each alarm sent 3 times, then auto-ignored
- 4-hour interval between sends to prevent spam
- State persistence for send count tracking
- Admin + customer device alarm emails
UC4Test Customer Email Control
3 testsProduction
Controls which customers receive emails based on trigger type, enabling continuous testing.
Features
- Scheduled runs: all customers receive emails
- Push/manual runs: only test customer (Gayan-IMH) receives emails
- Test mode bypasses 3-send limit for testing
UC5Test Mode Filter
2 testsProduction
Filters alarms to test customer only when running in test mode (push/manual triggers).
UC6Log Summary Counts
1 testProduction
Logs alarm summary counts in GitHub Actions for admin visibility.
Output
- "Summary: X alarms from Y customers affecting Z plants"
UC7State JSON Enhancement
1 testProduction
Adds human-readable fields (customer, plant, message) to device alarm state file.
UC8Weekly Report Schedule Filter
1 testProduction
Controls when customer emails are sent based on trigger type.
Rules
- Admin emails: sent on ALL triggers (push/manual/schedule)
- Customer emails: only on scheduled runs (Sunday)
System Optimization
UC9Admin Email Optimization
9 testsProduction
Reduces admin email noise using hash-based duplicate detection. Only sends when alert state actually changes.
Features
- SHA256 hash of alert content (excludes timestamp)
- Compares hash to previous run's hash
- Email reduction: 6/day down to 1-2/day (83% reduction)
Analytics & ROI
UC11Plant ROI Analysis
19 testsProduction
Analyzes historical device data for ROI verification, focusing on OffGrid (battery backup) usage during grid outages.
Features
- Tracks OffGrid events (battery backup mode)
- Calculates total backup hours, energy provided, cost savings
- Monthly breakdown with peak load analysis
- Works for any plant by selecting customer
ROI Report Viewer
Reports are pre-generated from roi/*.txt files. To generate new reports, run:
py check_plant_roi.py --customer <name> --days 365 then py analyze_plant_roi.py --input roi/<file>.csvInfrastructure
BVTBuild Verification Tests
14 testsProduction
Verifies centralized credentials configuration across all scripts. Prevents hardcoded path regressions.
APIShineMonitor API Tests
8 testsProduction
Integration tests for ShineMonitor API endpoints. Runs in GitHub Actions (Linux), skipped on Windows.
GitHub Workflows
ShineMonitor Daily Monitor
File: trigger-shinemonitor.yml
Schedule: 6x daily (02:30, 06:30, 10:30, 14:30, 18:30, 22:30 UTC)
Triggers: Schedule, Push, Manual
UCs: UC1, UC3-UC9
ShineMonitor Weekly Reports
File: trigger-customer-reports.yml
Schedule: Sunday 04:00 UTC
Triggers: Schedule, Push, Manual
UCs: UC2, UC8