DLMS/COSEM is the international standard that determines how a smart electricity meter organises and communicates its data. If the HAN port is the physical socket on your meter, DLMS/COSEM is the language being spoken through it. Without understanding this standard, the raw bytes streaming out of your meter are meaningless. With it, every reading — watt consumption, voltage, cumulative kilowatt-hours — maps to a precise, globally defined structure.
The acronym combines two complementary specifications. DLMS stands for Device Language Message Specification — it defines the communication protocol: how a client requests data from a meter and how the meter responds or pushes data out autonomously. COSEM stands for Companion Specification for Energy Metering — it defines the data model: what objects exist inside the meter, what attributes each object has, and how values are encoded. Together they form IEC 62056, the standard maintained by the DLMS User Association. Norwegian AMS meters implement a specific profile of this standard, using the push mode where the meter transmits telegrams automatically without being polled.
In practice, a DLMS/COSEM telegram arriving from a Norwegian AMS meter is structured as an HDLC frame (High-Level Data Link Control) containing a serialised COSEM data object. Each object in the telegram is identified by its OBIS code — a six-part numeric identifier that maps to a specific physical measurement. The data is encoded using ASN.1 BER (Abstract Syntax Notation, Basic Encoding Rules), which means the raw byte stream is binary-packed and not human-readable until decoded. Libraries like gurux-dlms (available for Python, Java, and C#) handle this decoding automatically, and the AmsToMqttBridge firmware does the same on ESP32/ESP8266 hardware connected directly to the HAN port.
Pro Tip: You Don’t Need to Decode It Manually
If you’re using an AMS-to-MQTT bridge or the Tibber Pulse with local MQTT, the DLMS/COSEM decoding is handled transparently by the firmware. What arrives in Home Assistant is clean JSON — watt values, voltage, kWh — with no binary parsing required on your end. You only need to understand DLMS/COSEM if you’re building your own reader from scratch or debugging a parsing failure.
The Norwegian implementation follows the “Norwegian HAN interface” specification published by REN (Rasjonell Elektrisk Nettvirksomhet), which defines exactly which COSEM objects must be present in the telegram and at what transmission intervals. List 1 (every 2 seconds) carries instantaneous active power. List 2 (every 10 seconds) adds voltage and current per phase. List 3 (every hour) adds cumulative meter readings and meter identification data. This tiered structure is a Norwegian-specific profile layered on top of the base DLMS/COSEM standard.
⚡ Fun Fact: DLMS/COSEM was originally developed in the 1990s for automated meter reading over telephone modems — long before WiFi or smart homes existed. The standard’s explicit goal was meter-brand interoperability, so a utility company could replace meters from different manufacturers without changing their billing software. That same interoperability is why your Home Assistant setup works identically whether your meter is made by Aidon, Kaifa, or Kamstrup.