sml-kit

Meter quirks

Which real meters deviate from the SML specification, how sml-kit reads them, and how to find out what your meter needs.

On this page
  1. Find out what your meter needs
  2. Known deviations
  3. Power direction from the status word
  4. Why the DZG correction is not automatic
  5. Not deviations
  6. Tested captures

sml-kit reads the specification strictly by default. A meter that deviates is read by naming the deviation, so it stays visible instead of being silently accepted.

Find out what your meter needs๐Ÿ”—

cargo run --example decode -- capture.bin      # raw bytes or hex

The tool reads strictly first. If that fails, it tries each option and reports the smallest one that reads every frame:

โœ˜ 7 error(s) strictly; reads with: time without choice. Run with --lenient.

Known deviations๐Ÿ”—

MeterWhat it doesOptionDefault error
Holley DTZ541 (some units)Computes CRC-16/KERMIT instead of CRC-16/X-25CrcCheck::Lenient, in ParseOptions::lenient()FrameCrc / MessageCrc
Holley DTZ541-ZDBA, DDZ285Sends SML_Time as a bare number, without its choice tagbare_time, in ParseOptions::lenient()UnexpectedType { expected: List, found: Unsigned }
DZG DVS74 (affected serials)Sends a positive power โ‰ฅ 327.68 W as a short signed integer: 356.24 W reads โˆ’299.12 W.with_dzg_power(true)none: the wrong value, exactly as sent
use sml_kit::{ParseOptions, readout_with};

let holley = readout_with(frame, ParseOptions::lenient())?;
let dzg = readout_with(frame, ParseOptions::default().with_dzg_power(true))?;

Use the same CrcCheck for the frame CRC: Decoder::new(buf).with_crc_check(options.crc).

Power direction from the status word๐Ÿ”—

Some meters send the power without a sign and report the direction, import (+A) or export (โˆ’A), in the status word of 1.8.0. There are two layouts, and the value alone does not tell them apart, so you name the one your meter uses:

LayoutBitSourceMeters (checked on the corpus)
StatusWord::Edl5 (0x20)FNN Lastenheft EDL 1.2, Tab. 7EMH ED300L, EMH eHZ, ISKRA MT175, EasyMeter Q3A
StatusWord::Mme11 (0x800)manufacturer manuals (4-byte status)DZG DVS74 and DWSB20, Holley DTZ541, EMH mME40, Itron OpenWay 3.HZ; Elster AS2020 (a published capture, not in the corpus)
use sml_kit::{Direction, StatusWord, readout};

let list = readout(frame)?;
if list.direction(StatusWord::Edl) == Some(Direction::Export) {
    println!("feeding in");
}
let power = list.signed_power(StatusWord::Edl); // negative while feeding in

signed_power negates only a power the meter sent without a sign; a value the meter already sent negative is returned as sent. At standstill the meter reports import. On an EDL meter, bits 8โ€“23 are tariff information, so reading it as Mme would be wrong.

Why the DZG correction is not automatic๐Ÿ”—

The correction reads a negative 1โ€“3 byte power value of a DZG meter as unsigned. Affected meters always send genuine negatives in four bytes or more, so for them it is exact. But DZG meters with fixed firmware send a genuine โˆ’105.50 W (a generator) in two bytes, and the correction would turn it into +549.86 W. DZG's published list of affected serial numbers is incomplete (a DWS7412.1 outside it shows the bug), so sml-kit cannot decide for you. Turn it on for the meter that needs it, never as a default.

The status word settles it for one meter: DZG meters set bit 11 while exporting. The buggy DVS-7412.2 capture says import (0x1c0104) next to its โˆ’299.12 W; the generator says export (0x1c6904) next to its โˆ’105.50 W. decode uses this: it names the bug when the status says import and stays silent when it says export. In code:

use sml_kit::{Direction, StatusWord};

let negative = list.quantity(Obis::POWER).is_some_and(|p| p.mantissa < 0);
let dvs74_bug = negative && list.direction(StatusWord::Mme) == Some(Direction::Import);

Not deviations๐Ÿ”—

  • Reduced precision without PIN. Energy arrives in whole kWh (scaler +3) and power is left out until the PIN is entered on the meter. That is what the meter sends.
  • Itron OpenWay 3.HZ "CRC errors". A reported CRC bug turned out to be a serial port set to 7 data bits. Use 8N1.
  • A one-byte message CRC (ISKRA MT691). The specification lets a sender drop a leading zero byte; sml-kit accepts it strictly.

Tested captures๐Ÿ”—

The corpus test reads every CRC-valid frame of the public libsml-testing collection: 216 frames from EMH (eHZ, ED300L, mME40), ISKRA (MT175, MT631, MT691), DZG (DVS74, DWSB20), eBZ DD3, Holley DTZ541, Itron OpenWay 3.HZ, EasyMeter Q3A and Dr. Neuhaus SMARTY. All read strictly except the Holley DTZ541-ZDBA (bare_time). Three dumps in the collection are damaged (bad CRC, frame restarted mid-way); their damaged frames are rejected.

Have a meter that is not on this list? Please open an issue with a capture.

Edit this page on GitHub