← Back to Jeff Tarimo Portfolio
Designed by Jeff Tarimo • Head of Technology

DL/T 645-2007 MQTT Meter Payload Workbench

Encode meter commands, wrap them as MQTT JSON, and decode MQTT responses, telemetry, and raw 645 frames.

1. MQTT / meter settings

12 decimal digits. DL/T 645 transmits address bytes low-byte first.
Automatically generated as a unique 16-digit timestamp-style ID for every encoded command.
Default: /v1/device/{meter}; command topic is /cmd, response is /response.

2. Function

Generated MQTT command

Publish topic
Choose a function and click Encode payload.

Raw message

Frame details

Paste response or raw frame

The decoder strips spaces and FE wake bytes, validates the frame checksum, subtracts 0x33 from every DATA byte, and recognizes supported identifiers.

Decoded result

Paste periodic MQTT telemetry JSON

Telemetry fields

Supported functions

FunctionControl / DIInput handling
Read any data itemC=11, user DI4-byte DI entered as DI3..DI0; encoder transmits DI0..DI3 and adds 33H.
Generic writeC=14, user DIPassword authority + 3 password bytes, 4 operator bytes, raw DATA.
MQTT relay shortcutmessage=relayon / relayoffNo 645 frame; sent exactly as documented by the MQTT layer.
645 relay controlC=1CPassword/operator bytes + N1 command + reserved N2 + N3..N8 validity bytes.
Amount initializationC=03, 070103FFOperator 11223344, preset amount as 32-bit cents, fixed MAC / purchase-count fields.
Sales orderC=03, 070102FFAmount as 32-bit cents; order no. exactly 8 bytes; meter/table number 6 BCD bytes.
Return orderC=03, 070108FFSame field structure as sales order, per document.
Parameter 1C=03, 070104FFAll documented fixed-width fields are exposed. Because the document does not state decimal scaling for every parameter, exact raw unshifted bytes are accepted per field.
Parameter 2C=03, 070105FF116-byte DATA builder matching the supplied example (L=0x74): DI + operator + four 3-byte zone entries + four schedules of 8×3-byte sessions.
Extended meter snapshotC=11, 028011FFDecodes the documented 65-byte aggregate response and status word.

Important encoding rules

645 DATA bytes are encoded by adding 0x33 before transmission and decoded by subtracting 0x33. The checksum is the modulo-256 sum from the first 68 through the final DATA byte. The 6-byte address is BCD and transmitted low-byte first.