Polish distribution system operators are replacing old electricity meters with remote-reading smart meters, called LZO (licznik zdalnego odczytu) or AMI meters. Most people only see the result in the operator's web portal. Many of these meters can also send their readings straight into your home, over a radio link the operators call the HAN port (Home Area Network). Once it is turned on, the meter broadcasts its energy registers, power and phase voltages at an interval the operator sets (10 seconds to an hour in Tauron's case), encrypted with a key you get from the operator. A cheap receiver and the open-source wmbusmeters turn that into live data for Home Assistant, openHAB or anything else that reads MQTT.

This article uses Tauron Dystrybucja as the main example because it publishes both the activation procedure and a technical description of the radio module. The receiving side works the same way for any meter that sends standard wireless M-Bus telegrams.

What the law requires

A regulation of the Minister of Climate and Environment of 30 May 2023 (Dz.U. 2023 poz. 1142) sets requirements for communication between a smart meter and devices in a household. The communication standards must, among other things:

  • give the household access to "unapproved data" (dane niezatwierdzone), defined as data available to the customer through the meter's communication interface;
  • encrypt the communication at least;
  • let the customer use devices of their own choice;
  • be reliable and interoperable.

Devices on the customer's side must not disturb the meter's communication or threaten its safe operation, and must protect the metering data from unauthorised access. The regulation does not name a radio technology. Tauron uses wireless M-Bus.

"Unapproved" matters here. The numbers from the HAN port are good for monitoring and automations, but the bill is still based on the data the operator collects.

What Tauron's meters send

Tauron's document "Opis modelu komunikacji modułu wireless M-BUS w licznikach AMI" (version 2.2, April 2021) was written for the AMIplus Smart City Wrocław installation, with meters from NES, Apator and Mitsubishi. They talk to the operator over power line communication (PLC), and a separate wireless M-Bus module (to PN-EN 13757-4) handles the home side. The document lists these parameters:

  • mode T1, 868-870 MHz;
  • AES-128 encryption with a built-in, random key;
  • transmit power 12 dBm, receive sensitivity -97 dBm;
  • typical indoor range 25-60 m, up to 300 m with line of sight;
  • a PCB antenna;
  • a transmit interval of 10 seconds to 1 hour, configured by Tauron.

The module is switched off after installation and is turned on at the customer's request. In the configuration Tauron uses, a telegram carries:

  • the meter's date and time and its serial number;
  • active energy imported, as a total for G11/C11 or per zone for G12/C12 and G13;
  • active energy exported, split the same way;
  • maximum active power imported;
  • active power imported and exported, given as the value at the end of the transmit interval;
  • the RMS voltage on each of the three phases, also at the end of the interval;
  • the power limit threshold.

The power figure is not an instantaneous reading in the sense of a CT clamp sampled every second. It is the value at the end of the interval the operator has set. If you need power for fast automations, such as switching a load the moment export starts, check how often your meter actually transmits before you build on it.

Tauron's HAN page currently names two groups of customers: residents of Wrocław, Szklarska Poręba and selected districts of Wałbrzych and Legnica (meters with a 13-character serial number and the wM-Bus logo), and all Tauron customers with remote-reading meters installed after 2024, which have a 13-character serial number and type MA309 or ST34U.

Turning on the HAN port at Tauron

Tauron's procedure runs through the eLicznik portal:

  1. Log in to eLicznik.
  2. Go to Licznik / HANplus.
  3. Under PORT HAN, choose Aktywuj HAN.
  4. Within one working day, your account shows the meter's factory number (for verification), the address for wireless M-Bus communication, the encryption key and a QR code with the same data separated by ;.

From then on the meter transmits until you choose Dezaktywuj HAN in the same place, which stops the transmissions and removes the parameters from your account within one working day.

For the other large operators (PGE Dystrybucja, Energa-Operator, Enea Operator and Stoen Operator), the sources used for this article do not describe a self-service activation like Tauron's. Ask your operator whether your meter has a wireless M-Bus module, whether it can turn on the HAN port and how it hands out the key. Write down the meter type from the label on the meter before you call.

A receiver for T1

Wireless M-Bus at 868 MHz needs a receiver that can handle T1 mode. The wmbusmeters documentation lists the supported ones: the im871a, iu891a, amb8465 (Metis), amb3665, CUL, RC1180 and a generic RTL-SDR dongle (RTL2832U), for which wmbusmeters starts rtl_sdr and rtl_wmbus in the background. The article on reading water and heat meters with wmbusmeters compares these receivers and antennas in more detail.

If you would rather put the receiver on an ESP32, the ESPHome external component from SzczepanLeon's esphome-components repository receives wireless M-Bus with a CC1101, SX1262 or SX1276 radio and reuses wmbusmeters code for decoding. Its README gives 868.95 MHz as the default frequency for the CC1101.

The meter is usually in a meter cabinet, on a staircase or outside the house, so placement matters more than the dongle. Tauron's 25-60 m indoor range is a typical figure, not a promise for a concrete cabinet in a basement.

Setting up wmbusmeters

Start by listening without any meter configured, for example wmbusmeters rtlwmbus or wmbusmeters /dev/ttyUSB0:iu891a:t1. wmbusmeters prints every telegram it hears with the sender's ID, manufacturer code and type. In a block of flats you will probably see several encrypted electricity meters, because the neighbours have smart meters too. Your key fits only one of them.

Then add a meter file, for example /etc/wmbusmeters.d/licznik_pradu:

name=licznik_pradu
driver=amiplus
id=12345678
key=00112233445566778899AABBCCDDEEFF

Use the address from eLicznik as id and the 32-character hex key as key. The values above are placeholders. The project recommends naming the driver explicitly rather than using driver=auto in production: a named driver keeps its JSON fields, while auto detection can switch to a newer driver after an upgrade.

The amiplus driver covers the electricity meters used in the Polish AMI rollouts. In wmbusmeters 3.1 it detects Apator (including Otus 1 and 3), NES and Elgama Gama 350 meters. Its default output fields include:

  • total_energy_consumption_kwh and total_energy_production_kwh;
  • current_power_consumption_kw and current_power_production_kw;
  • voltage_at_phase_1_v to voltage_at_phase_3_v;
  • energy per tariff, such as total_energy_consumption_tariff_1_kwh.

The Sanxing S34U28, used in Tauron's deployment, has its own sanxing driver since wmbusmeters 3.1.0. According to the driver's comments its telegrams match the amiplus family byte for byte, except for two bytes where the standard expects a decryption check value. The wmbusmeters changelog calls the separate driver a workaround for this buggy meter.

In Home Assistant the simplest route is the official add-on from the wmbusmeters-ha-addon repository. Since version 3.1.0 the add-on generates MQTT discovery messages from the driver itself, and the release notes warn that this changes sensor names in Home Assistant. Outside Home Assistant, the shell= line in wmbusmeters.conf can pass each telegram to mosquitto_pub, and any MQTT client can use the JSON.

The energy totals can go straight into an energy dashboard as grid import and export, which is handy with a PV installation.

Problems reported by users

Most of what goes wrong is documented in wmbusmeters issues opened by Tauron customers.

  • The ID does not match. Several users found that the address shown in eLicznik had its bytes in the reverse order compared with the ID in the telegram, so wmbusmeters ignored the telegrams as "not for me". In one example from the thread, 00079161 and 61910700 are the same number read in opposite byte order. If nothing matches, look among the IDs you heard while listening for your address with its two-digit pairs reversed.
  • "meter detection did not match the selected driver amiplus". Older versions printed this for NES (0x38b3) and Apator Otus meters even though --analyze decoded them correctly. The detection list now includes NES, version 0x03, and Apator Otus 1/3, so update wmbusmeters before you dig deeper.
  • Fields stay empty. One user with an NES 73331 saw voltages and power but Unknown for the energy totals in Home Assistant. Check the raw JSON from wmbusmeters first, then the sensor configuration.
  • Testing the key. wmbusmeters --analyze=amiplus:<key> <telegram> decodes a single telegram with a chosen driver and key. The project also runs an online analyser at wmbusmeters.org. A real key in a public bug report is a bad idea, so leave it out when you post logs.
  • The meter is heard but nothing is decoded. Without the right key, wmbusmeters sees that the meter transmits but cannot read the values. Check that the key has 32 hex characters and that you assigned it to your own meter, not a neighbour's.