A Go implementation for the Gen5 Riva utility power meter by Itron that communicates with the meter API and bridges that information to MQTT brokers for Home Assistant integration or other integrations based on customizable configuration and MQTT topic prefix.
- IEEE 2030.5 Compliance: Implements the IEEE 2030.5-2023 specification for smart energy communication
- Custom TLS/SSL Support: Uses ECDHE-ECDSA-AES128-CCM8 cipher suite required by Itron meters
- Automatic Discovery: mDNS/Zeroconf discovery of meters on the network
- Home Assistant Integration: Automatic device and sensor discovery via MQTT
- Multiple Endpoints: Configurable endpoint monitoring (power, energy summation, etc.)
- Robust Error Handling: Exponential backoff retry logic for reliable operation
- Continuous Monitoring: Real-time polling and data publishing
- TLS Package: Implements custom SSL context with ECDHE-ECDSA-AES128-CCM8 cipher
- Discovery Package: Automatic meter discovery using mDNS
- Parser Package: IEEE 2030.5 XML response parsing
- MQTT Package: MQTT data publishing
- Endpoint Package: Meter endpoint management and polling
- Instantaneous Demand: Real-time power consumption (
/upt/1/mr/1/r) - Current Summation Received: Energy received from grid (
/upt/1/mr/2/rs/1/r/1) - Current Summation Delivered: Energy delivered to grid (
/upt/1/mr/3/rs/1/r/1)
The application automatically creates Home Assistant entities via MQTT discovery by default:
- Device information (LFDI, software version, manufacturer)
- Power sensors with proper device classes
- Energy sensors with state classes for long-term statistics
- Proper units of measurement (W, Wh)
| Variable | Description | Default |
|---|---|---|
METER_IP |
IP address of the Itron meter (disables mDNS discovery when set) | Auto-discovery |
METER_PORT |
Port of the Itron meter | 8081 |
CERT_PATH |
Path to client certificate | /opt/certs/cert.pem |
KEY_PATH |
Path to client key (or same file as cert) | /opt/certs/key.pem |
LOGLEVEL |
Log level (DEBUG, INFO, NOTICE, WARN, ERROR, CRIT, EMER) | INFO |
MQTT_SERVER |
MQTT broker hostname | localhost |
MQTT_PORT |
MQTT broker port | 1883 |
MQTT_USER |
MQTT username | (optional) |
MQTT_PASSWORD |
MQTT password | (optional) |
MQTT_TOPIC_PREFIX |
MQTT topic prefix | homeassistant/ |
The application requires a client certificate (and optionally a separate key) to authenticate with the Itron meter. By default the application looks for the certificate and key at /opt/certs/cert.pem and /opt/certs/key.pem respectively. For container usage you can mount your files to /opt/certs:
# Example: mount both cert and key into the container
docker run -v /path/to/certs:/opt/certs:ro ...
For ease-of-use both certificate and key can be combined in a single PEM file; in that case point both CERT_PATH and KEY_PATH to the same file (or only set CERT_PATH and the program will attempt to use the same file for the key).
See the Setup section of Zak Nye's excellent xcel_itron2mqtt project for how to generate a certificate and key that can be used with this project.
The application provides comprehensive logging with configurable levels:
Log Levels (in order of verbosity):
DEBUG- Detailed debugging information, HTTP requests/responses, connection detailsINFO- General informational messages (default)NOTICE- Important notices (mapped to INFO level)WARN- Warning messages for non-critical issuesERROR- Error messages for failuresCRIT- Critical errors that may cause terminationEMER- Emergency/panic conditions
The application uses YAML configuration files to define which meter endpoints to monitor:
configs/endpoints_default.yaml- Default configuration
The application automatically selects the appropriate configuration based on the meter's software version.
The application supports multiple methods for finding the Itron meter on your network:
-
Manual Configuration (Highest Priority)
- Set
METER_IPenvironment variable to specify the meter's IP address - When
METER_IPis set, mDNS discovery is completely disabled - Optionally set
METER_PORT(defaults to 8081)
- Set
-
Automatic mDNS Discovery (Default)
- Only used when
METER_IPis not set - Searches for
_smartenergy._tcp.localservices on the network - Automatically discovers IP address and port
- Only used when
-
Simple Discovery (Fallback)
- Tries common IP addresses (192.168.1.100, 192.168.0.100, etc.)
- Used if mDNS discovery fails
-
Default Fallback
- Uses localhost:8081 if all discovery methods fail
Pre-built multi-arch images (amd64 and arm64) are published to Docker Hub and GitHub Container Registry by CI.
Docker Hub examples:
# Pull a semver release (e.g. v1.2.3)
docker pull user00265/itron-go-mqtt:v1.2.3
# Pull the latest release (alias of the most recent semver tag)
docker pull user00265/itron-go-mqtt:latest
# Pull the develop image (built from master)
docker pull user00265/itron-go-mqtt:developGitHub Container Registry examples (using user00265 as the owner):
# Pull a semver release
docker pull ghcr.io/user00265/itron-go-mqtt:v1.2.3
# Pull the latest release
docker pull ghcr.io/user00265/itron-go-mqtt:latest
# Pull the develop image
docker pull ghcr.io/user00265/itron-go-mqtt:develop# Run with environment variables
docker run -d \
-e METER_IP=192.168.1.100 \
-e MQTT_SERVER=mqtt.local \
-v /path/to/cert.pem:/app/itron.pem \
itron-go-mqtt# Run with specific meter IP (disables mDNS discovery)
export METER_IP=192.168.1.100
export METER_PORT=8081 # Optional, defaults to 8081
export MQTT_SERVER=mqtt.local
./itron-go-mqtt# Let the application discover the meter automatically via mDNS
# (Do NOT set METER_IP to enable discovery)
export MQTT_SERVER=mqtt.local
./itron-go-mqtt# METER_IP also supports hostnames
export METER_IP=itron-meter.local
export MQTT_SERVER=mqtt.local
./itron-go-mqtt-
SSL Connection Failures
- Verify certificate file path and permissions
- Ensure meter is accessible on the network
- Check that the meter supports the required cipher suite
-
mDNS Discovery Issues
- Check network connectivity
- Verify meter broadcasts on
_smartenergy._tcp.local - Try manual IP configuration
-
MQTT Connection Issues
- Verify MQTT broker accessibility
- Check username/password if authentication is required
- Ensure proper network firewall configuration
The application provides structured logging with multiple levels. Debug level includes:
- SSL/TLS connection establishment details
- HTTP request/response content
- mDNS discovery attempts
- MQTT topic publishing details
- Endpoint querying progress
- Configuration loading information
- This project was inspired by Zak Nye's xcel_itron2mqtt project and uses the default endpoint configuration/mapping from that project.
- IEEE 2030.5-2023 specification
- Itron Riva Gen5 meter documentation