EDL21 smart home integration, free and open source

Read your EDL21 / SML smart electricity meter through an infrared read head.
This integration reads the German EDL21 / eHZ smart electricity meters (EMH, EasyMeter, Iskra, Itron, Landis+Gyr, DZG, Holley, Logarex…) through their optical interface, in the SML (Smart Message Language) format. It works 100 % locally: no cloud, no account.
An EDL21 meter is a measuring instrument: nothing on it can be switched. The integration therefore reads it — import and export indexes, grid power, per-phase values — and builds scene triggers, scene actions and dashboard widgets on top of those readings.
What you need
- An infrared read head placed on the optical interface of the meter (the round window with the IR LED, held by a magnet).
- A way for Gladys to reach it over your network. The Gladys
integrations run in a sandboxed container: they cannot open a USB port,
so the read head must be reachable on the LAN, in one of two ways:
- raw SML over TCP (recommended): the head forwards the bytes of the
meter unchanged on a TCP port. Examples: a Wi-Fi read head
(Volkszähler, Hichi, bitShake) with a TCP serial bridge, Tasmota with
TCPStart 8888, or a USB read head plugged into another machine and shared withser2net(8888:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT); - Tasmota with an SML script: the head decodes the SML itself, and
the integration polls its
Status 10over HTTP.
- raw SML over TCP (recommended): the head forwards the bytes of the
meter unchanged on a TCP port. Examples: a Wi-Fi read head
(Volkszähler, Hichi, bitShake) with a TCP serial bridge, Tasmota with
Configuration
- Open the Configuration tab of the integration.
- Fill in Read heads, separated by commas:
192.168.1.50:8888— raw SML over TCP;http://192.168.1.60— Tasmota read head;- an optional name before an equal sign:
Garage=192.168.1.50:8888.
- Optional settings:
- Tasmota web password, only if your Tasmota protects its web UI;
- Publication interval (10 s by default): the minimum time between two readings sent to Gladys. Unchanged values are not re-sent;
- High consumption threshold (3000 W by default, 0 to disable): used by the "Consumption threshold" scene trigger;
- Offline after (60 s by default): a read head without valid data for this long is reported offline.
- Save, then click Test the read heads: the integration waits for a reading of every head and shows what it received.
- Open the Discovery tab and add your meter(s).
Devices and features
Each meter becomes one device, identified by the server id the meter sends (it survives a change of read head or IP address). Only the values the meter actually sends become features:
| OBIS code | Feature | Unit |
|---|---|---|
| 1.8.0 | Grid import index | kWh |
| 2.8.0 | Grid export index | kWh |
| 1.8.1 / 1.8.2 | Import index tariff 1 / 2 | kWh |
| 16.7.0 | Grid power (export is negative) | W |
| 36.7.0 / 56 / 76 | Power L1 / L2 / L3 | W |
| 32.7.0 / 52 / 72 | Voltage L1 / L2 / L3 | V |
| 31.7.0 / 51 / 71 | Current L1 / L2 / L3 | A |
Most EDL21 meters only send the import index until the extended data set is unlocked. Ask your metering operator (Messstellenbetreiber) for the 4-digit PIN, enter it with a flashlight on the optical sensor, then set
InFtoOn. The new values appear by themselves: an Update button shows up in the Discovery tab.
The read head connection is shown as a local badge on the device, or unreachable when no data arrives.
Tasmota read heads
Tasmota names the values after your SML script. The integration recognizes
the OBIS code in the name (1_8_0, 16_7_0…) and the usual labels of the
Tasmota examples: Total_in, Total_out, Power_curr, Power_L1…L3,
Volt_p1…p3, Amperage_p1…p3 and Meter_Number (the meter id). Name
the values of your script this way for them to be picked up.
Actions (Configuration screen)
- Test the read heads — waits up to 15 s for a reading of each head and reports the index and power received.
- Reconnect the read heads — re-opens every session (after moving or rebooting a head).
Scenes
The integration adds its own cards to the scene editor (Gladys 5.1 or later).
Triggers:
- Energy flow reversed — the meter switched between drawing from and
feeding into the grid (a 20 W dead band avoids flip-flops). Variables:
direction(import/export),power,meter_name. - Consumption threshold — the grid power rose above the configured
threshold (
above), or fell back 10 % under it (below). Variables:state,power,threshold,meter_name. - Read head connection changed — a read head went silent (
offline) or came back (online). Variables:status,meter_name.
Actions:
- Read a meter — outputs
online,power,import_kwh,export_kwh,today_import_kwh,today_export_kwhandmeter_name. - Read all meters — outputs the total
power, today's totals and how many meters answer. - Reconnect a read head — re-opens the session of a meter's head and
outputs
online: whether fresh data arrived within 10 s.
For a simple threshold on a value (voltage, phase power…), the native device-feature triggers of Gladys also work on every feature.
Dashboard
- Electricity meter — live grid power and indexes, today's import and export, read head status, energy flow direction and a Reconnect button. Pick the meter in the widget settings (the first one otherwise).
- All meters — total power, today's totals and one line per meter.
"Today" counts from local midnight (the time zone of the container), or from the first reading on the day the integration starts.
Troubleshooting
- No data: check that the head sits right on the optical window, that
the TCP port answers (
nc 192.168.1.50 8888 | xxdmust show1b1b 1b1b 0101 0101every few seconds) and that the speed is 9600 baud 8N1. - CRC errors in the logs: the head is misaligned or exposed to ambient light.
- Only the import index: unlock the extended data set with the PIN (see above).
- Check the integration logs from the Gladys UI with
LOG_LEVEL=debugfor the full detail.
Configuration settings
These are the settings EDL21 asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Getting started | section | No | Put an infrared read head on the optical interface of the meter and make it reachable on your network: raw SML over TCP (ser2net, Tasmota serial bridge, Wi-Fi read head) as host:port, or a Tasmota head running an SML script as http://address. Several heads are separated by commas. |
| Read heads | string | Yes | host:port for raw SML over TCP, http://address for Tasmota. Optional name before an equal sign: Garage=192.168.1.50:8888. |
| Tasmota web password | secret | No | Only if your Tasmota read head protects its web interface (user admin). |
| Publication interval (s) | number | No | Minimum time between two readings sent to Gladys. Unchanged values are not re-sent. |
| High consumption threshold (W) | number | No | Grid power above which the "Consumption threshold" scene trigger fires. 0 disables it. |
| Offline after (s) | number | No | A read head that sends no valid data for this long is reported offline. |
How to install EDL21 in Gladys
- In Gladys, open Integrations: EDL21 appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/gboulvin/gladys-edl21:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/gboulvin/Gladys-EDL21.
EDL21 requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
EDL21 is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by gboulvin, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation