The wire format
SML transport v1, the type-length encoding, messages and list entries, byte by byte.
On this page
Transport v1๐
1b 1b 1b 1b 01 01 01 01 start
76 โฆ SML messages
00 00 padding to a multiple of 4
1b 1b 1b 1b 1a 02 c1 c2 end: 1a, padding count, CRCAfter the start sequence the stream is read in 4-byte words. A word of four 0x1b is an escape, and the next word is a command:
| Command | Meaning |
|---|---|
1b 1b 1b 1b | The payload itself contains four 0x1b here |
01 01 01 01 | A new frame starts (the current one is lost) |
1a pp cc cc | End of frame: pp padding bytes, then the CRC |
The CRC is CRC-16/X-25 over every transmitted byte from the start sequence up to and including the padding count, sent low byte first. Every CRC-valid real-meter capture in the corpus agrees. (Some Holley DTZ541 compute CRC-16/KERMIT instead; see Meter quirks.)
Type-length encoding๐
Every value starts with a TL byte:
bit 7 6 5 4 3 2 1 0
more type length| Type bits | Type | Length means |
|---|---|---|
000 | octet string | bytes including the TL bytes |
100 | boolean | bytes including the TL byte (always 2) |
101 | integer | bytes including the TL byte (2โ9) |
110 | unsigned | bytes including the TL byte (2โ9) |
111 | list | number of elements |
When more is set, another TL byte follows. Its low nibble extends the length, most significant first. Two bytes are special:
0x01is an empty octet string: SML's marker for an absent optional field.0x00is the end of a message, not a value.
Examples: 07 01 00 01 08 00 ff is the OBIS code 1-0:1.8.0*255; 62 1e is unsigned 30 (the unit Wh); 52 ff is integer โ1 (the scaler 10โปยน); 76 is a list of six.
A message๐
76 List(6) SML_Message
05 41 42 43 01 transactionId
62 00 groupNo
62 00 abortOnError
72 messageBody: List(2)
65 00 00 07 01 tag: GetList.Res
77 โฆ body: List(7)
63 cc cc crc16 over the message up to here, low byte first
00 end of messageThe CRC field is an Unsigned16, but a sender may drop a leading zero byte: 62 cc is valid too (ISKRA MT691 does it).
A list entry๐
77 SML_ListEntry: List(7)
07 01 00 01 08 00 ff objName 1-0:1.8.0*255
01 status absent
01 valTime absent
62 1e unit 30 = Wh
52 ff scaler โ1
59 00 00 00 00 07 5b cd 15
value 123456789
01 valueSignature absent123456789 ร 10โปยน Wh = 12345678.9 Wh, which Quantity keeps exact.
A value can also be a time (SML_ListType, choice 1): 72 62 01 followed by an SML_Time. sml-kit reads it as SmlValue::Time.
SML_Time๐
72 62 01 65 00 01 02 03 secIndex: seconds since a device epoch
72 62 02 65 65 5f 1c 00 timestamp: seconds since 1970 (UTC)
72 62 03 73 65 โฆ 53 โฆ 53 โฆ localTimestamp: timestamp, local and season offset (minutes)Server ID๐
A German meter's 10-byte server ID is type ยท medium ยท manufacturer (3 letters) ยท block ยท serial (u32): 0a 01 49 53 4b 00 04 7a 55 44 is printed on the meter as 1 ISK00 75126084, and ServerId displays it that way.
A typical telegram๐
A basic meter's push telegram is one frame with three messages:
OpenResponsewith the server ID,GetListResponsewith the readings,CloseResponse.
A parameter tree๐
73 SML_Tree: List(3)
07 81 81 c7 82 01 ff parameterName device identification
01 parameterValue absent: a node
73 child_List: List(3)
73 SML_Tree
07 81 81 c7 82 03 ff manufacturer
72 62 01 04 45 4d 48 value: choice 1 (SML_Value), "EMH"
01 no children
โฆSML_ProcParValue is List(2) { choice, value }: 1 value, 2 period entry, 3 tupel entry, 4 time, 5 list entry.