WattWise AI is a production-grade B2B SaaS web application designed for Indian industries to detect energy waste and optimize consumption patterns using artificial intelligence. The system provides real-time analytics, anomaly detection, and AI-powered recommendations to reduce energy costs by up to 30%.
Indian industries face significant challenges in energy management:
- High Energy Costs: Industrial electricity rates averaging ₹8.50/kWh
- Inefficient Consumption: Lack of visibility into energy usage patterns
- Manual Monitoring: Time-intensive manual analysis of energy data
- Compliance Requirements: Need for sustainability reporting and energy efficiency standards
WattWise AI provides:
- Automated Anomaly Detection: Statistical analysis to identify energy spikes and waste
- AI-Powered Insights: Gemini 3 integration for intelligent recommendations
- Cost Analysis: Real-time cost calculations in Indian Rupees (INR)
- Department-wise Analytics: Granular consumption tracking by department and equipment
- Actionable Recommendations: Practical steps to reduce energy consumption
- Energy Analytics Engine: Rule-based and statistical anomaly detection using scikit-learn
- Database: SQLAlchemy with SQLite for development, PostgreSQL for production
- AI Integration: Google Gemini 3 for intelligent insights
- API Design: RESTful endpoints with proper authentication and validation
- Authentication: Flask-Login with secure session management
- Professional Dashboard: Enterprise-grade UI with Chart.js visualizations
- Authentication System: Secure user registration and login with CSRF protection
- Data Visualization: Interactive charts showing energy trends and patterns
- Responsive Design: Mobile-friendly interface optimized for all devices
- CSV Upload: Historical energy data from enterprise systems
- Data Processing: Validation, parsing, and cost calculation at ₹8.50/kWh
- Analytics: Anomaly detection using Isolation Forest and statistical methods
- AI Analysis: Gemini 3 generates insights and recommendations
- Dashboard: Visual presentation of findings and KPIs
The system accepts CSV files with the following structure:
timestamp,energy_kwh,department,equipment,building
2024-01-15 08:00:00,125.5,Production,Injection-Molding-Machine-A,Factory-1
2024-01-15 09:00:00,142.8,Production,Injection-Molding-Machine-A,Factory-1
2024-01-15 10:00:00,98.3,HVAC,Cooling-System,Main-OfficeRequired Columns:
timestamp: Date and time (YYYY-MM-DD HH:MM:SS)energy_kwh: Energy consumption in kilowatt-hours (numeric)department: Department or area name (text)equipment: Equipment or source type (text)
Optional Columns:
building: Building or facility name (text)
While this system uses CSV upload for demonstration and historical data analysis, production deployments would integrate with:
- Smart Meters: Real-time data via IoT sensors and APIs
- Building Management Systems (BMS): Direct API integration
- SCADA Systems: Industrial control system data feeds
- Energy Management Platforms: Third-party system APIs
- Enterprise Resource Planning (ERP): Integration with business systems
- Baseline Analysis: Calculate average consumption and deviation thresholds
- Anomaly Detection: Identify consumption spikes using Isolation Forest and statistical methods
- Pattern Recognition: Hourly, daily, and departmental usage patterns
- Cost Calculation: Automatic cost computation at ₹8.50/kWh (Indian industrial rate)
- Root Cause Analysis: Explain reasons for energy spikes in business-friendly language
- Optimization Recommendations: Actionable steps to reduce consumption
- Business Language: Plain English explanations for management
- ROI Focus: Cost savings and sustainability benefits in INR
- KPI Overview: Total consumption, costs, anomalies, peak hours
- Interactive Charts: Energy consumption trends using Chart.js
- Department Analysis: Consumption breakdown by department
- Equipment Tracking: High-consuming equipment identification
- AI Analysis Panel: Professional energy consulting reports
- Python 3.8+
- Node.js 14+ (for development tools)
- Google Gemini API key
# Clone the repository
git clone <repository-url>
cd wattwise-ai
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Initialize database
flask db init
flask db migrate -m "Initial migration"
flask db upgrade
# Run the application
python run.pyCreate a .env file based on .env.example:
SECRET_KEY=your-secret-key-here
GEMINI_API_KEY=your-gemini-api-key-here
DATABASE_URL=sqlite:///wattwise.db
INDUSTRIAL_ENERGY_RATE=8.50# Set production environment
export FLASK_ENV=production
# Use Gunicorn for production
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 run:app
# Or use Docker
docker build -t wattwise-ai .
docker run -p 5000:5000 wattwise-aiThe project includes realistic sample datasets in sample_data/:
- manufacturing_energy_data.csv: Manufacturing plant with production equipment, HVAC, lighting
- it_company_energy_data.csv: IT company with data centers, office systems, network equipment
Both datasets contain:
- Realistic Indian industrial consumption patterns
- Energy spikes and anomalies for testing
- Department and equipment breakdown
- Timestamps covering multiple days
- Energy Reduction: 20-30% consumption decrease through optimization
- Operational Efficiency: Automated monitoring reduces manual effort by 80%
- Predictive Maintenance: Early detection of equipment inefficiencies
- ROI: Typical payback period of 6-12 months
- Energy Audits: Automated reporting for regulatory compliance
- Carbon Footprint: Reduced emissions through optimized consumption
- Sustainability Goals: Support for corporate environmental initiatives
- ESG Reporting: Data for environmental, social, and governance reports
- Multi-facility: Support for multiple plant locations
- Department Granularity: Detailed breakdown by operational areas
- Equipment Monitoring: Individual machine-level tracking
- User Management: Role-based access control
Backend:
- Flask 3.0.0 with modular blueprint architecture
- SQLAlchemy 3.1.1 for database ORM
- Flask-Login for authentication
- Pandas 2.1.4 for data processing
- Scikit-learn 1.3.2 for machine learning
- Google Generative AI (Gemini 3)
- Plotly 5.17.0 for charts
Frontend:
- Bootstrap 5.3.0 for responsive design
- Chart.js for data visualization
- Font Awesome 6.4.0 for icons
- Custom JavaScript with ES6 features
- CSS3 with modern design patterns
Database:
- SQLite for development
- PostgreSQL for production
- SQLAlchemy migrations for schema management
- Authentication: Secure login/logout with session management
- CSRF Protection: Flask-WTF for form security
- Input Validation: Comprehensive CSV format and data validation
- Password Security: bcrypt hashing for user passwords
- Session Security: Secure cookie configuration
- Error Handling: Comprehensive error management without information leakage
POST /auth/register- User registrationPOST /auth/login- User loginPOST /auth/logout- User logout
POST /upload- Upload energy data CSVGET /dashboard- Main dashboard viewGET /insights- Energy insights listGET /ai-analysis- AI analysis for specific insight
GET /api/energy-stats- Energy statistics for dashboardGET /api/analyze-insight/<id>- AI analysis for insight
# Run unit tests
python -m pytest tests/
# Run with coverage
python -m pytest --cov=app tests/
# Test CSV upload functionality
python -m pytest tests/test_upload.py- Application Logging: Structured logging with different levels
- Error Tracking: Comprehensive error reporting
- Performance Monitoring: Request timing and database query monitoring
- User Activity: Audit trail for important actions
- Real-time Integration: IoT sensor connectivity and live data streaming
- Machine Learning: Predictive analytics for consumption forecasting
- Mobile App: Native mobile application for facility managers
- Advanced Reporting: Automated report generation and scheduling
- Multi-tenant: Support for multiple companies on single platform
- Integration Marketplace: Pre-built connectors for popular energy systems
For technical support or feature requests:
- Comprehensive error messages and validation feedback
- Sample data for testing and onboarding
- AI-powered recommendations through the analysis interface
- Detailed API documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is designed as an enterprise solution for Indian industrial energy optimization. Contact for licensing and deployment information.
WattWise AI - Empowering Indian industries with intelligent energy management.