Where Energy Meets Intelligence
Real-time energy monitoring system with predictive analytics, room-wise consumption tracking, and smart billing integration for Sri Lankan homes.
- Live power consumption tracking (Watts)
- Voltage and current monitoring
- Temperature & humidity sensors
- 5-second data refresh intervals
- 24-hour historical data
- Individual room power consumption tracking
- Current (Amperes) and power (Watts) breakdown
- Average and peak power metrics
- Visual power distribution pie charts
- Room-specific consumption percentages
- Ridge Regression time-series forecasting
- Consumption pattern analysis
- Daily/weekly/monthly trend predictions
- Real-time model status indicator
- PDF Report Generation: Weekly and monthly summaries
- Bill Integration: Quick links to CEB and LECO payment portals
- Cost Estimation: Daily, monthly cost calculations (₹13.06/kWh default)
- Carbon Tracking: Monthly CO₂ footprint calculations in kg
- 24-hour usage pattern charts
- Power consumption by room (bar charts)
- Power distribution pie charts
- System status monitoring
- Real-time data points counter
- MongoDB for historical data storage
- IoT sensor integration
- Active connection status indicator
- Scalable architecture
| Layer | Technology |
|---|---|
| Frontend | React, Tailwind CSS, Chart.js |
| Backend | FastAPI, Python |
| Database | MongoDB |
| IoT/Sensors | Real-time energy sensors |
| Data Processing | Ridge Regression, Time-series analysis |
| Deployment | Vercel & AWS EC2 |
- Node.js 16+
- Python 3.9+
- MongoDB instance
- IoT energy sensors/smart meters
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run build# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start FastAPI server
uvicorn main:app --reload# Frontend (.env)
REACT_APP_API_URL=http://localhost:8000
# Backend (.env)
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=elektrum
SENSOR_UPDATE_INTERVAL=5elektrum/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Dashboard.jsx
│ │ │ ├── RoomConsumption.jsx
│ │ │ ├── Charts.jsx
│ │ │ └── BillPayment.jsx
│ │ ├── pages/
│ │ └── App.jsx
│ └── package.json
├── backend/
│ ├── main.py
│ ├── models/
│ │ ├── sensor.py
│ │ └── room.py
│ ├── routes/
│ │ ├── energy.py
│ │ ├── analytics.py
│ │ └── reports.py
│ ├── services/
│ │ ├── prediction.py
│ │ └── pdf_generator.py
│ └── requirements.txt
└── README.md
- Dashboard displays live power consumption, voltage, temperature, and humidity
- Auto-refreshes every 5 seconds
- Filter data by time range (1h, 6h, 24h, 7d)
- Check individual room power usage
- Compare current, average, and peak consumption
- Identify high-usage rooms instantly
- Click "Weekly Report" or "Monthly Report"
- Includes consumption breakdown, daily stats, costs, and carbon footprint
- PDFs ready for download
- Quick links to CEB (Ceylon Electricity Board) and LECO payment portals
- Estimated monthly bill based on consumption
- Accurate rate calculations
The system uses Ridge Regression for time-series forecasting:
- Analyzes historical consumption patterns
- Predicts future energy usage
- Helps identify optimization opportunities
- Real-time model status display
- Billing Integration: Direct links to CEB and LECO portals
- Local Pricing: Default rate LKR 13.06/kWh (configurable)
- Carbon Footprint: Monthly CO₂ tracking in kg
- Multi-Language Support: Ready for Sinhala/Tamil translation
GET /api/energy/current- Current power metricsGET /api/energy/history?room=&range=24h- Historical dataPOST /api/energy/log- Log sensor reading
GET /api/analytics/predict?days=7- Predict next 7 daysGET /api/analytics/patterns- Get consumption patternsGET /api/analytics/carbon-footprint- Monthly CO₂ data
POST /api/reports/generate?type=weekly- Generate PDFGET /api/reports/estimated-bill- Calculate estimated cost
- Smart device integration (IoT appliance control)
- Mobile app (React Native/Flutter)
- Machine learning optimization suggestions
- Solar panel integration & off-grid monitoring
- Automated alerts for peak usage
- Multi-home support
- Advanced anomaly detection
- Dark mode UI
MIT License - Feel free to use, modify, and distribute
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Issues: Open a GitHub issue for bugs and feature requests
- Email: kavix@yahoo.com
- Live Demo: https://cd-kavindu.vercel.app/
🚀 Active Development - v1.0.0 Released
- ✅ Core dashboard functionality
- ✅ Room-wise monitoring
- ✅ Predictive analytics
- ✅ PDF report generation
- ⏳ Mobile app in progress
- ⏳ Advanced ML features
⚡ Monitor. Predict. Optimize. Save.