homewizard-water-exporter-0.1.7 is not a library.
HomeWizard Water Prometheus Exporter
A Rust-based Prometheus exporter for the HomeWizard Water Meter, providing real-time water consumption metrics.
Features
- 💧 Real-time Monitoring - Water consumption metrics updated every 60 seconds
- 🚰 Flow Rate Tracking - Active water flow measurement in liters per minute
- 📊 Total Consumption - Cumulative water usage tracking in cubic meters
- 📡 Network Monitoring - WiFi signal strength tracking
- 🚀 High Performance - Lightweight Rust implementation with minimal resource usage
- 🐳 Docker Ready - Multi-platform images for easy deployment
- ✅ Production Ready - Comprehensive test coverage and error handling
- 🔧 Offset Support - Handle meter replacements with offset tracking
Prerequisites
- HomeWizard Water Meter with local API enabled
- Rust 1.88+ (for building from source)
- Docker (for container deployment)
Quick Start
# Using Docker
# Or using pre-built binary
HOMEWIZARD_HOST=192.168.1.241
Installation
Using Docker (Recommended)
# From Docker Hub
# From GitHub Container Registry
Using Pre-built Binaries
Download the latest release for your platform from the releases page.
# Example for Linux x86_64
HOMEWIZARD_HOST=192.168.1.241
Using Cargo
HOMEWIZARD_HOST=192.168.1.241
Building from Source
# Clone the repository
# Build the binary
# Run the exporter
HOMEWIZARD_HOST=192.168.1.241
Configuration
The exporter can be configured via command-line arguments or environment variables:
| Environment Variable | CLI Flag | Default | Description |
|---|---|---|---|
HOMEWIZARD_HOST |
--host |
Required | IP address or hostname of HomeWizard Water Meter |
METRICS_PORT |
--port |
9899 |
Port to expose Prometheus metrics |
POLL_INTERVAL |
--poll-interval |
60 |
Seconds between API polls |
LOG_LEVEL |
--log-level |
info |
Log level (trace, debug, info, warn, error) |
HTTP_TIMEOUT |
--http-timeout |
5 |
HTTP request timeout in seconds |
Metrics
The exporter provides the following Prometheus metrics:
| Metric | Type | Description |
|---|---|---|
homewizard_water_total_m3 |
Counter | Total water consumption in m³ |
homewizard_water_active_flow_lpm |
Gauge | Current water flow in liters per minute |
homewizard_water_offset_m3 |
Gauge | Water meter offset in m³ |
homewizard_water_wifi_strength_percent |
Gauge | WiFi signal strength percentage |
homewizard_water_meter_info{wifi_ssid} |
Gauge | Water meter information |
Prometheus Configuration
Add the following to your prometheus.yml:
scrape_configs:
- job_name: 'homewizard_water'
static_configs:
- targets:
scrape_interval: 60s
Enabling HomeWizard Local API
- Open the HomeWizard Energy app
- Go to Settings → Meters → Your Water Meter
- Enable "Local API"
Example Metrics Output
# HELP homewizard_water_total_m3 Total water consumption in m³
# TYPE homewizard_water_total_m3 counter
homewizard_water_total_m3 451.827
# HELP homewizard_water_active_flow_lpm Current water flow in liters per minute
# TYPE homewizard_water_active_flow_lpm gauge
homewizard_water_active_flow_lpm 0
# HELP homewizard_water_wifi_strength_percent WiFi signal strength percentage
# TYPE homewizard_water_wifi_strength_percent gauge
homewizard_water_wifi_strength_percent 100
Grafana Dashboard
An example Grafana dashboard is included in grafana-dashboard.json. To import:
- Open Grafana
- Go to Dashboards → Import
- Upload the JSON file or paste its contents
- Select your Prometheus data source
- Click Import
The dashboard includes:
- Total water consumption
- Real-time flow rate graph
- Hourly water usage
- WiFi signal strength gauge
- Current flow rate display
Development
# Show all available make targets
# Build the binary
# Run tests
# Check code formatting and linting
# Run the exporter locally
HOMEWIZARD_HOST=192.168.1.241
# Build Docker image
# Run in Docker
HOMEWIZARD_HOST=192.168.1.241
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.