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 โน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.