MeterMonitor is an AI-powered backend for reading analog water meters via ESP32 cameras. Instead of running OCR on-device, this solution offloads image processing and digit recognition to a server, significantly reducing device power consumption. It integrates with Home Assistant but can also run standalone.
- MQTT - ESP32 devices push images directly
- HTTP - Poll any HTTP endpoint with custom headers/body
- Home Assistant Camera - Direct integration with HA camera entities
- Flexible polling intervals or real-time push
- YOLO AI - Automatic display detection using YOLOv11
- ORB Template - Fast feature-based matching with reference template
- Static Rect - Fixed rectangle for stable camera positions
- Bypass - Direct segmentation for pre-cropped images
- CNN-based digit classification
- Top-N predictions with confidence scoring
- Multi-digit recognition with rotation detection
- Time-delta validation against historical data
- Flow-rate plausibility checks (Δm³/Δt)
- Negative correction for single-digit misreads
- Fallback prediction search through Top-N alternatives
- Configurable confidence thresholds
- MQTT auto-discovery for sensors
- Direct camera entity polling support
- Supervisor token authentication
- Ingress UI access
- Vue.js 3 dashboard
- Interactive setup wizard with live preview
- Template editor for ROI configuration
- Evaluation history with detailed rejection reasons
- Multi-meter management
- SQLite database for history and evaluations
- Configurable retention policies
- Export/import datasets for training
- Comprehensive evaluation metadata
This project is heavily inspired by the AI-on-the-edge project and is trained on the dataset by the user haverland.
- Add Repo: Add
https://github.com/metermonitor-io/metermonitor-haas a repository in Home Assistant. - Install: Find and install the MeterMonitor add-on.
- Configure: Set MQTT credentials.
- Start & Use: Launch the add-on. Access the UI via Ingress.
MQTT sensors are auto-discovered as long as the Mosquitto addon is used and auto discovery is enabled (default). No manual YAML needed.
The docker container is being built for the architecture amd64 and aarch64 (arm), with aarch64 being untested.
git clone https://github.com/phiph-s/metermonitor-managementserver.git
cd metermonitor-managementserver
pip install -r requirements.txt
cd frontend && yarn install && yarn build && cd ..
python3 run.pyEdit settings.json to configure MQTT and model paths.
git clone https://github.com/phiph-s/metermonitor-managementserver.git
docker build -t metermonitor .
docker run -d -p 8070:8070 -v ~/metermonitor-data:/data metermonitorPut options.json in ~/metermonitor-data (same format as settings.json).
├── run.py # Main entry point
├── lib/ # Backend modules (OCR, MQTT, API)
├── models/ # YOLO & CNN models
├── frontend/ # Vue 3 web UI
├── tools/ # Utilities (e.g. MQTT bulk sender)
├── settings.json # Config (standalone)
├── config.json # Add-on config (Home Assistant)
The diagram above shows the complete processing pipeline:
- Image Capture - Multiple sources (MQTT/HTTP/HA Camera) provide meter images
- ROI Extraction - Isolate the display area using YOLO, ORB or Static Rect
- Segmentation - Apply thresholding and island removal to extract individual digits
- CNN Classification - Recognize each digit with confidence scoring
- Smart Correction - Validate readings using historical data and plausibility checks
- Publication - Store in database and publish via MQTT to Home Assistant
The correction algorithm ensures data quality by:
- Validating flow rates against physical limits
- Detecting single-digit misreads through fallback predictions
- Preventing unrealistic jumps in meter values
- Handling negative corrections for common OCR errors (8↔9, 3↔8)
Developed as Master Project @ Hochschule RheinMain
