The Energy Consumption Optimization part aims to monitor and optimize energy usage in the house. It provides real-time analytics, anomaly detection, and predictive modeling to help users manage their energy consumption effectively.
- Real-time energy monitoring
- Anomaly detection for devices
- Historical data analysis
- Energy consumption forecasting
- Scheduling of tasks for energy optimization
- User-friendly web dashboard
- Daily cloud backup to Firebase at midnight
Before you begin, ensure you have met the following requirements:
- Python 3.7 or higher
- SQLite3
- Flask
- Pandas
- Prophet
- PyFlink
-
Clone the repository:
git clone https://github.com/yourusername/Energy-Consumption-Optimization.git cd Energy-Consumption-Optimization
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up the database:
- Run the database setup script to create the necessary tables:
python database/create_database.py
-
Configure environment variables:
- Create a
.env
file in the root directory and add the following variables:
SMTP_SERVER_HOST=smtp.your-email-provider.com SMTP_SERVER_USERNAME=your_email@example.com SMTP_SERVER_PASSWORD=your_email_password # Set this to your project's root directory path ROOT_PATH=/path/to/your/Energy-Consumption-Optimization # Firebase credentials FIREBASE_API_KEY=your_firebase_api_key FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com FIREBASE_PROJECT_ID=your-project-id FIREBASE_STORAGE_BUCKET=your-project.appspot.com FIREBASE_MESSAGING_SENDER_ID=your_sender_id FIREBASE_APP_ID=your_app_id
- Create a
The application requires multiple components to be running simultaneously in separate terminals:
-
Start the anomaly monitoring system:
python anomaly_monitor.py
-
Start the real-time data generation (for simulating data receive) :
python database/generate_real_time_data.py
-
Start the Flask application:
python app.py
-
Access the dashboard:
- Open your web browser and go to link.
Note: All three components (anomaly monitor, data generation, and Flask app) must be running simultaneously for the system to function properly. Each should be run in its own dedicated terminal window.
- Use the dashboard to monitor real-time energy consumption.
- Set up scheduled tasks for devices to optimize energy usage.
- Review historical data and predictions to make informed decisions.
- All data is automatically backed up to Firebase cloud storage at midnight each day.