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.
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
- Framework: FastAPI (Python 3.11+)
- ORM: SQLAlchemy
- Validation: Pydantic
- Database: PostgreSQL (via Supabase or local asyncpg)
- AI: Google Gemini AI
- 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
- Core: Python 3.11+ Modbus RTU/TCP Simulator Engine
- Features: Electrical parameter models, machine operation cycles, HTTP sender
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
Create a PostgreSQL database (e.g. Supabase) and run the SQL schema located in database/schema.sql.
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 8000Backend will be available at http://localhost:8000
cd frontend
npm install
# Run development server with Turbopack
npm run devFrontend will be available at http://localhost:3000
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.mainThis will start generating simulated Modbus data and pushing it to the backend via HTTP.
- Automatic meter readings via Modbus / REST APIs
- Full simulation suite for synthetic operational testing
- Exponential backoff retry logic
- Natural language queries via Gemini AI
- Energy trend analysis and reporting
- Peak consumption insights
- Responsive SCADA-inspired interface
- Real-time Recharts visualizations
- High-contrast status indicators
GET /api/readings- Get filtered historical readingsGET /api/readings/latest- Get real-time latest reading per meterPOST /api/readings- Receive meter reading from Edge/SimulatorGET /api/meters- List all configured meters
- 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
Proprietary - Industrial Energy Monitoring & Analytics System