Decoder library for SML (Smart Meter Language)
Goal of this project is to create a compact python library for decoding SML output from a electric power meter or at least for the one which I am using (the EMH ED300L).
Side goal is to improve my personal skills in python programming.
- Technische Richtlinie BSI TR-03109-1 - the main specification
- DLMS blue book - contains OBIS codes and measurement units
- EDI@Energy Codeliste der OBIS-Kennzahlen für den deutschen Energiemarkt
- Beschreibung SML Datenprotokoll für SMART METER
On OBIS codes from DLMS blue book
- An OBIS code consists of 6 octets A B C D E F
- section 6 / 6.3.2 / 7.2.1: general structure
- section 7.5: A = 1: Electricity
- section 7.5.1: C = 1: Active Power +
- section 7.5.1: C = 2: Active Power -
- section 7.5.2.1: D = 8: Time Integral 1
- section 7.5.3.2: E = 0: Total
- section 7.5.3.2: E = 1: Rate 1
- section 7.5.3.2: E = 2: Rate 2
- Stefan Weigert - great approach, Python script
- msxfaq.de 1
- msxfaq.de 2
- volkszaehler.org
- schatenseite.de
- kabza.de
- EMH ED300L
- Data Sheet
- User Manual
- Produkthandbuch - section 5.3 contains list of data sets
- Another list of the parameters
After plugging, the Weidmann Lesekopf is available as /dev/ttyUSB0
First set the device to 9600 bit/s, raw mode. In particular the raw mode is important!
stty -F /dev/ttyUSB0 9600
stty -F /dev/ttyUSB0 raw
Now read out the data and pipe through hexdump for nice formatting
cat /dev/ttyUSB0 | hexdump -e '16/1 "%02x " "\n"'
Or store it directly in a binary file for later analysis
cat /dev/ttyUSB0 > edl300_raw.bin
- Python - portable between Windows/Linux/Raspberry Pi
- Simple - no full SML decoder to reduce complexity
- Robust - even if the ED300L specific format is assumed: implement saninty checks (expected values, crc)