This driver reads DLMS Push messages from Grid meters via RS485 converter, interprets the data, and posts it to the DBus service on Victron Energy systems. It enables integration of DLMS-compatible meters into the Victron ecosystem.
- Reads data from DLMS Grid meters via RS485 serial converter
- Interprets DLMS Push messages (no polling required)
- Augments meter data with additional information
- Posts data to the DBus as a grid service
- Compatible with Victron Energy GX devices
- SSH into your Venus device (as root)
If you haven't enabled root access via SSH, follow the instructions here: https://www.victronenergy.com/live/ccgx:root_access.
- Download and extract the repository
mkdir -p /data/drivers
cd /data/drivers
git clone https://github.com/AndyTempel/dbus-dlms-meter.git
cd dbus-dlms-meter- Configure the service
cp config.py.example config.py
nano config.pyEdit the configuration file to match your setup (serial port, authentication keys, etc.)
- Install service
./bin/setup.sh- Reboot the device
rebootCopy config.py.example to config.py and edit the following parameters:
# Serial interface configuration
TTY_INTERFACE = 'ttyUSB0' # Change to your serial port
SERIAL_BAUD_RATE = 38400 # Default baud rate for most DLMS meters
BYTE_SIZE = 8
PARITY = Parity.NONE # No parity
STOP_BITS = StopBits.ONE # One stop bit
# DLMS security settings
AUTHENTICATION_KEY = '' # Optional: Set your authentication key
BLOCK_CIPHER_KEY = '' # Optional: Set your encryption key
TELEGRAM_ID = 'si-sodo-reduxi' # File for telegram definitionsTo make sure serial-starter ignores your RS485 adapter reliably, set the FTDI Product Description of your USB–RS485 adapter to a known value, and match that in the setup script.
- Recommended value: KSOFTESS (this repository expects this by default).
- How to set it: On Windows, use FT_Prog to program the adapter and set the Product Description field to KSOFTESS. Apply the changes and replug the adapter.
- Script reference: bin/setup-dependencies.sh uses SERIAL_ID_MODEL to generate a udev rule and to detect the correct tty device. Default is:
- SERIAL_ID_MODEL="KSOFTESS"
- If you choose a different description, update both places in the script accordingly:
- The SERIAL_ID_MODEL variable near the top
- The CUSTOM_UDEV_RULE that includes ENV{ID_MODEL}=="..."
- Verify on device:
- Run:
udevadm info --query=property --name=/dev/ttyUSB0 | grep ^ID_MODEL=and check it matches your chosen value. - Re-run
./bin/setup.shafter changing the description or script to refresh the udev rule and serial handling.
- Run:
The service performs the following functions:
-
Serial Connection: Establishes a connection to the configured serial port where the RS485 converter is attached.
-
DLMS Push Listening: Listens for DLMS Push messages from the grid meter. These are spontaneous messages sent by the meter without polling.
-
Message Processing: Decodes and interprets the DLMS messages according to the DLMS/COSEM protocol.
-
DBus Registration: Registers as a grid service on the DBus using the com.victronenergy.grid interface.
-
Data Publishing: Publishes the interpreted meter data to the appropriate DBus paths for consumption by the Victron system.
This service has been tested with the following DLMS-compatible meters:
- Iskraemeco AM550
Most DLMS meters need to have a converter to RS485, such as the Reduxi Converter for AM550.
Check the service status:
svstat /service/dbus-dlms-meter- Verify the correct TTY interface in your config.py
- Check cable connections to your RS485 converter
- Ensure the baud rate matches your meter's configuration
- Set the FTDI Product Description of your USB RS485 adapter using FT_Prog to "KSOFTESS" (default expected here). If you pick a different value, update SERIAL_ID_MODEL and the CUSTOM_UDEV_RULE in bin/setup-dependencies.sh accordingly.
- If the issue persists, add a rule to a serial-starter rules file
/etc/udev/rules.d/serial-starter.rulesExample rule:ACTION=="add", ENV{ID_BUS}=="usb", ENV{ID_MODEL}=="KSOFTESS", ENV{VE_SERVICE}="ignore"
tail -f /var/log/dbus-dlms-meter/current | tai64nlocal- Permission denied: Make sure the TTY device has proper permissions
- No data received: Check the meter configuration and ensure it's set to send Push messages
- Decoding errors: Verify your authentication and cipher keys are correct
- Python 3.x
- gurux-dlms (for DLMS protocol)
- Victron DBus libraries
- uv dependency management
cd /data/drivers/dbus-dlms-meter
python -m unittest discover testsMIT License (MIT)
- Victron Energy for their DBus API documentation
- DLMS User Association for protocol specifications
- Gurux for the gurux-dlms library