MCGI Power Logger is a centralized web-based dashboard for monitoring and analyzing power consumption data from Schneider PM5310 meters. It provides real-time visibility into Voltage, Current (Amps), and comprehensive Power metrics (Active, Reactive, Apparent Power, and Power Factor), enabling facility operators and energy managers to track usage trends and optimize energy efficiency.
- Real-time Monitoring: Instant access to critical electrical parameters with 1-second precision via SSE.
- Historical Analysis: Long-term data logging in TimescaleDB for high-performance trend analysis.
- Interactive Dashboard: Device cards with live-updating metrics and interactive historical charts.
- Peak Monitoring: Tracking of all-time maximum values for every device and metric.
- Custom Reports: On-demand and scheduled generation of detailed reports in PDF and Excel formats.
- Role-Based Access Control: Secure JWT authentication with Admin, Operator, and Viewer roles.
- Modern UI: Fully responsive interface built with React, Refine, and Ant Design, featuring Dark Mode support.
- Dockerized: Entire stack (Frontend, Backend, Database) is containerized for easy deployment.
- Framework: NestJS
- Database: TimescaleDB (PostgreSQL-based time-series DB)
- ORM: Drizzle ORM
- Communication: modbus-serial for Modbus TCP
- Authentication: Passport.js with JWT
- Framework: React (with TypeScript)
- Framework Core: Refine
- UI Components: Ant Design
- Charts: Ant Design Plots
- Build Tool: Vite
- Devices: 6x Schneider PM5310 Power Meters (Modbus IDs 10, 20, 30, 40, 50, 60).
- Gateway: Schneider PAS600 (Modbus TCP at 172.16.0.80).
- Backend: Polls the PAS600 every second, saves data to TimescaleDB, and pushes real-time updates via Server-Sent Events (SSE).
- Frontend: Displays real-time metrics and provides tools for historical trend analysis and reporting.
- Docker and Docker Compose installed on your system.
-
Clone the repository:
git clone https://github.com/spyshow/power-meter.git cd power-meter -
Configure environment variables (optional, defaults are provided):
- Create a
.envfile in the root based on.env.example. - Ensure
PAS600_IPmatches your gateway's IP address.
- Create a
-
Start the application using Docker Compose:
docker-compose up -d --build
-
Access the application:
- Frontend: http://localhost
- Backend API: http://localhost:3001
If you don't have access to actual hardware, you can run the application in simulation mode by setting MODBUS_SIMULATION=true in the environment or using PAS600_IP=SIMULATE.
cd backend
npm install
npm run start:devcd frontend
npm install
npm run devThis project is licensed under the UNLICENSED license.