A multithreaded Python application that reads energy measurements from Eastron SDM 120/230 Modbus meters and stores them in InfluxDB, with optional ZeroMQ data publishing.
This Python module continuously monitors one or more Eastron SDM120 / SDM230 Modbus energy meters, storing the collected data in an InfluxDB time-series database. Additionally, it can publish real-time data through ZeroMQ for integration with other systems.
It has been developed and is in real world usage on a Raspberry Pi 1 Model B revision 1 (older 256MB model).
- Python 3 (version 3.11 or higher)
- influxdb - InfluxDB client library
- pymodbus - Modbus communication protocol
- pyzmq - ZeroMQ messaging library
- retrying - Retry logic
- Access to Eastron SDM120/SDM230 energy meters via Modbus
- InfluxDB instance for data storage
- Optional: ZeroMQ-compatible systems for real-time data consumption
To see all available command-line options and configuration parameters:
python sdm2influx.py -h# Monitor a single meter and store data in InfluxDB
python sdm2influx.py --influx-host localhost --influx-database energy_dataFor detailed configuration options, refer to the help output.
-
Install the required development tools:
-
Set up the development environment:
pre-commit install make install
- Publish package to PyPI
- Support for complex meter configurations like multi-branch monitoring
Contributions are welcome! Please ensure all code passes make check to maintain code quality.