How rufus800/energy-meter-monitoring- works
This is a Flask-based power-quality and energy monitoring dashboard. Its main workflow is PLC polling, persistence of readings, and presentation of live values and historical analytics through two browser pages; an AI assistant can use live and historical context to answer questions. The README also documents deployment behind an existing Cloudflare tunnel. The backend excerpts support the database, history, and AI paths, but do not show every route or the HTML request details, so those connections are kept at the documented application level.
Main entry points: plc_reader.py Flask Application · history.db Readings Database · dashboard.html Live Dashboard · analytics.html Analytics
Components 12
Dashboard UI
- Live Dashboard
dashboard.html - Analytics
analytics.html
Monitoring Backend
- Flask Application
plc_reader.py - PLC Polling
plc_reader.py - History API
plc_reader.py - History Analysis
plc_reader.py - AI Assistant
plc_reader.py
Data Integrations
- Readings Database
history.db - Siemens PLC
- Groq Chat API
- Cloudflare Tunnel
cloudflare-config-template.yml
Other components
- Operator
Connections 14
- Operator → Live Dashboard: views live data
- Operator → Analytics: views analytics
- Live Dashboard → Flask Application: uses dashboard
- Analytics → Flask Application: requests history
- Flask Application → PLC Polling: runs polling
- PLC Polling → Siemens PLC: reads measurements
- PLC Polling → Readings Database: stores readings
- History API → Readings Database: queries history
- History Analysis → Readings Database: reads statistics
- AI Assistant → History Analysis: builds context
- Flask Application → History API: serves history
- Flask Application → AI Assistant: serves chat
- AI Assistant → Groq Chat API: streams completion
- Cloudflare Tunnel → Flask Application: routes port 5002