Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IEMAS - Industrial Energy Monitoring & Analytics System

Overview

IEMAS is an enterprise-grade Industrial IoT platform designed to monitor and analyze energy consumption from Schneider Energy Meters in industrial environments. The system provides real-time data collection, storage, visualization, and AI-powered analytics through a modular architecture that scales from 1 to 20+ meter installations.

Architecture

Schneider Energy Meters (Modbus RTU/TCP) / Realistic Meter Simulator
           ↓
    ESP32 Devices (Edge Layer) / Python HTTP Client
           ↓
    FastAPI Backend (Python)
           ↓
  Supabase PostgreSQL Database
           ↓
  Next.js Dashboard (TypeScript/React)
           +
    Gemini AI Assistant

Tech Stack

Backend

  • Framework: FastAPI (Python 3.11+)
  • ORM: SQLAlchemy
  • Validation: Pydantic
  • Database: PostgreSQL (via Supabase or local asyncpg)
  • AI: Google Gemini AI

Frontend

  • Framework: Next.js 16.2.9 (App Router with Turbopack)
  • Language: TypeScript
  • Styling: Tailwind CSS v4
  • Data Fetching: TanStack Query
  • Charts: Recharts v3
  • Icons: Lucide React

Realistic Meter Simulator

  • Core: Python 3.11+ Modbus RTU/TCP Simulator Engine
  • Features: Electrical parameter models, machine operation cycles, HTTP sender

Project Structure

IEMAS/
├── backend/                    # FastAPI backend service
│   ├── app/
│   │   ├── main.py             # Application entry point
│   │   ├── database.py         # Database connection
│   │   ├── models/             # Pydantic & SQLAlchemy models
│   │   └── routers/            # API route handlers
│   └── requirements.txt        # Python dependencies
│
├── frontend/                   # Next.js dashboard
│   ├── app/                    # App Router pages
│   ├── components/             # React components (RealtimeChart, Analytics, etc.)
│   ├── lib/                    # API clients and utilities
│   ├── hooks/                  # Custom React hooks
│   └── package.json            # Node dependencies
│
├── realistic_meter_simulator/  # Python-based IoT sensor simulator
│   ├── main.py                 # Simulator entry point
│   ├── simulator.py            # Modbus / IoT device engine
│   ├── electrical_parameters.py# Voltage/Current/Power logic
│   └── simulator_config.json   # Simulation environment config
│
├── firmware/                   # ESP32 firmware (Arduino/ESP-IDF)
├── database/                   # Database schema & migrations
└── docker-compose.yml          # Multi-container orchestration

Getting Started

1. Database Setup

Create a PostgreSQL database (e.g. Supabase) and run the SQL schema located in database/schema.sql.

2. Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure environment variables
cp .env.example .env
# Edit .env with your PostgreSQL credentials

# Run development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Backend will be available at http://localhost:8000

3. Frontend Setup

cd frontend
npm install

# Run development server with Turbopack
npm run dev

Frontend will be available at http://localhost:3000

4. Running the Simulator

To test the system locally without physical edge devices, you can use the Realistic Meter Simulator:

# In the project root:
python -m realistic_meter_simulator.main

This will start generating simulated Modbus data and pushing it to the backend via HTTP.

Features

Real-Time Data Collection

  • Automatic meter readings via Modbus / REST APIs
  • Full simulation suite for synthetic operational testing
  • Exponential backoff retry logic

AI-Powered Analytics

  • Natural language queries via Gemini AI
  • Energy trend analysis and reporting
  • Peak consumption insights

Industrial UI Design

  • Responsive SCADA-inspired interface
  • Real-time Recharts visualizations
  • High-contrast status indicators

API Endpoints

  • GET /api/readings - Get filtered historical readings
  • GET /api/readings/latest - Get real-time latest reading per meter
  • POST /api/readings - Receive meter reading from Edge/Simulator
  • GET /api/meters - List all configured meters

Development Roadmap

  • Phase 1: Project scaffolding and infrastructure setup
  • Phase 2: Backend data models and API endpoints
  • Phase 3: Database integration and authentication
  • Phase 4: Alert system and WebSocket real-time updates
  • Phase 5: ESP32 firmware development (Simulated)
  • Phase 6: Frontend dashboard and routing
  • Phase 7: Real-time meter visualization
  • Phase 8: Alert notification system
  • Phase 9: AI assistant integration
  • Phase 10: System monitoring dashboard
  • Phase 11: End-to-end integration and testing
  • Phase 12: Production deployment preparation

License

Proprietary - Industrial Energy Monitoring & Analytics System

About

The Industrial Energy Monitoring & Analytics System (IEMAS) is an enterprise-grade Industrial IoT platform designed to monitor and analyze energy consumption from Schneider Energy Meters in industrial environments. The system provides real-time data collection, storage, visualization, and AI-assisted analytics through a modular architecture.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages