Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Office Energy Monitor – IoT-Based Smart Energy Monitoring System

An IoT-inspired smart office energy monitoring platform built with FastAPI, React, ESP32 (Wokwi), WebSockets, and a Discord Bot. The system provides real-time device monitoring, energy usage analytics, automated alerts, and interactive dashboards for efficient office energy management.


📸 Dashboard Preview

Dashboard


🏗️ System Architecture

System Architecture


⚙️ Backend Architecture

Backend Architecture


🔌 Hardware Architecture

Hardware Architecture


✨ Features

  • 📊 Real-time Power Monitoring
  • 💡 Live Device Status Monitoring
  • 🏢 Room-wise Energy Summary
  • 📈 Power Consumption History
  • 📜 Device Activity History
  • 🚨 High Power Usage Alert
  • 🕔 After Office Hours Alert
  • ⏱️ Long Running Device Alert
  • 🤖 Discord Bot Integration
  • 🖥️ Interactive Office Layout
  • ⚡ ESP32 Hardware Demonstration (Wokwi)
  • 🔄 Random Device Simulation
  • 🗄️ SQLAlchemy + PostgreSQL

🚀 Technologies Used

Frontend

  • React.js
  • CSS3
  • Chart.js

Backend

  • FastAPI
  • SQLAlchemy
  • SQLite

Hardware

  • ESP32 DevKit
  • Relay Modules
  • Light & Fan Simulation
  • ACS712 Current Sensor (Concept)
  • Wokwi Simulation

Other Tools

  • Discord Bot
  • REST API
  • Git
  • GitHub

📂 Project Structure

office-energy-monitor
│
├── backend/
├── frontend/
├── discord_bot/
├── hardware/
│   └── wokwi/
│       ├── diagram.json
│       └── sketch.ino
│
├── docs/
│   └── images/
│       ├── dashboard.png
│       ├── system_architecture.svg
│       ├── backend_architecture.svg
│       └── hardware_architecture.svg
│
├── README.md
└── requirements.txt

📋 Core Modules

  • Device Simulator
  • Device Repository
  • Device History
  • Power History
  • Room Summary
  • Alert Engine
  • Discord Notification Service
  • Hardware Demonstration

🚨 Alert Types

🔴 High Power Alert

Triggered when total power consumption exceeds the configured threshold.


🟠 After Office Hours Alert

Triggered when devices remain ON after office hours.


🟡 Long Running Device Alert

Triggered when a device stays ON for a long period.


🤖 Discord Commands

!status
!usage
!rooms
!room Drawing Room
!room Work Room 1
!room Work Room 2
!alerts
!ping

🔌 Hardware Demonstration

The project includes a representative ESP32-based hardware simulation using Wokwi.

Components used:

  • ESP32 DevKit
  • Relay Modules
  • LED-based Light Simulation
  • Fan Output Simulation
  • ACS712 Current Sensor (Concept)
  • WiFi Communication (Architecture)

The hardware demonstrates how the software architecture can be integrated with a real IoT deployment.


▶️ Running the Project

Backend

cd backend
python -m venv .venv

# Windows
.venv\Scripts\activate

pip install -r requirements.txt

uvicorn app.main:app --reload

Frontend

cd frontend

npm install

npm run dev

Discord Bot

cd discord_bot

pip install -r requirements.txt

python bot.py

📸 Project Demonstration

The project includes:

  • Modern React Dashboard
  • Live Office Layout
  • Power Usage Monitoring
  • Room-wise Summary
  • Device History
  • Power History Chart
  • Alert Dashboard
  • Discord Bot Commands
  • Wokwi Hardware Demonstration

📈 Future Improvements

  • MQTT Integration
  • Real ESP32 Deployment
  • Smart Meter Integration
  • Mobile Application
  • AI-Based Power Consumption Prediction
  • User Authentication
  • Cloud Database Support

🎯 Project Highlights

✅ Real-time Monitoring

✅ Interactive Dashboard

✅ Room-wise Analysis

✅ Alert Engine

✅ Discord Integration

✅ Hardware Demonstration

✅ Modular Backend

✅ REST API Architecture


👨‍💻 Author

Md. Meherab Hossain Talukder


📄 License

This project was developed for academic and hackathon purposes.


⭐ If you like this project

Please consider giving the repository a ⭐ on GitHub.

About

IoT-based smart office energy monitoring platform with FastAPI, React, ESP32 simulation, WebSockets, and Discord bot integration.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages