Log Modbus Energy Meter data to InfluxDB on a Raspberry Pi and publish values via MQTT

FloKra 200ce2e4fe ## v0.3 - 2023-10-20 hai 1 ano
.gitignore 1fe9f02a23 Initial commit %!s(int64=7) %!d(string=hai) anos
CHANGELOG.md 200ce2e4fe ## v0.3 - 2023-10-20 hai 1 ano
LICENSE 1fe9f02a23 Initial commit %!s(int64=7) %!d(string=hai) anos
README.md 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
meters.yml 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
metertype_SDM120.yml 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
metertype_SDM630.yml 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
modbuslog.ini 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
modbuslog.py 200ce2e4fe ## v0.3 - 2023-10-20 hai 1 ano
modbuslog.service 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
readings_names.yml 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
sdm_setid.py 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
setup.py 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
systemctl_service_install.sh 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
systemctl_service_uninstall.sh 4bad442988 initial commit of extended version, see CHANGELOG.md for details %!s(int64=4) %!d(string=hai) anos
write_register.py 896d9166df Fixes typo and closes #1 %!s(int64=7) %!d(string=hai) anos

README.md

Modbus Energy Meter Logger and MQTT gateway

Log Modbus Energy Meter data to InfluxDB on a Raspberry Pi and publish values via MQTT

Based on original project on Github

Added features

  • base configuration using ini file
  • MQTT publishing to use the readings in other systems
  • split data aquiring completely in momentary (power) and energy readings with different intervals
  • calculate daily total energy usage and log to file system as a backup
  • higher sample rate for momentary power reading, write to database on power changes and/or interval
  • separate interval for aquiring/writing energy readings
  • split InfluxDB logging in momentary (power) and energy readings (seperate databases if desired to enable usage of different retention policies and continuous queries)
  • enhanced meters configuration to support that changes, using yaml file as in original project
  • many more improvements

Verified to work on a Raspberry Pi 4 with Digitus USB-RS485 Interface, reading values from 3 Eastron SDM120 instruments. By changing the meters.yml file and making a corresponding metertype_[model].yml file it should be possible to use other modbus enabled models.

Requirements

Hardware

  • Raspberry Pi 2/3/4
  • RS485 USB interface or RS485 Shield for RPi
  • Modbus based Energy Meter(s), e.g WEBIQ 131D / Eastron SDM120 or WEBIQ 343L / Eastron SMD630

Software

Prerequisite

The original project has been documented at Hackster. Please follow the instructions there for more detailed information. Also check original project on Github.