Tasmota Smart Meter Interface (SML/Modbus Energy Reader) - image 1
Tutorialadvanced

Tasmota Smart Meter Interface (SML/Modbus Energy Reader)

Read electricity, gas, and water meters with Tasmota using IR optical heads, RS485 Modbus, or SML protocol. Supports 50+ meter types including Landis+Gyr, ABB, EasyMeter, and Kamstrup for utility monitoring.

Boards:ESP8266ESP32
Firmware:Tasmota
Use Cases:Utility MonitoringEnergy MonitoringSolar MonitoringSmart Meter ReadingZero Export

Tasmota Smart Meter Interface

Read your electricity, gas, and water utility meters with Tasmota using an IR optical head, RS485 adapter, or direct serial connection. Supports SML, OBIS, Modbus RTU, EBus, and other protocols for 50+ meter types.

Why This Project

  • Real utility data — read actual consumption from your official meters
  • Solar optimization — zero-export control with real-time grid feed-in data
  • Billing verification — compare your readings with utility bills
  • Multi-meter — read electricity, gas, and water from one ESP board
  • Non-invasive — IR optical head attaches magnetically, no wiring changes

Supported Meter Protocols

Protocol Connection Common Meters
SML IR optical head eHZ, EasyMeter, EMH, ISKRA, Landis+Gyr E350
OBIS IR / serial Many European smart meters
Modbus RTU RS485 ABB B23, Eastron SDM230/630, DDS238
EBus EBus adapter Heating systems (Vaillant, Wolf)
CANBus CAN adapter Some industrial meters

Option 1: IR Optical Head (Most Common)

Components

Component Purpose Est. Cost
Wemos D1 Mini (or ESP32) WiFi controller $3
IR read/write optical head (TTL) Reads meter via IR port $5-10
Magnetic holder Attaches to meter's IR port Often included

Wiring

IR Optical Head    Wemos D1 Mini
───────────────    ─────────────
VCC            →   3.3V
GND            →   GND
TX             →   GPIO14 (D5) — Tasmota RX
RX             →   GPIO12 (D6) — Tasmota TX (if bidirectional)

Option 2: RS485 Modbus

Components

Component Purpose Est. Cost
Wemos D1 Mini (or ESP32) WiFi controller $3
MAX485 or RS485-to-TTL module Serial level converter $1-2
Modbus cable (twisted pair) RS485 bus connection $1

Wiring

RS485 Module       Wemos D1 Mini
────────────       ─────────────
DI             →   GPIO12 (D6) — Tasmota TX
RO             →   GPIO14 (D5) — Tasmota RX
DE + RE        →   GPIO4 (D2)  — Direction control
VCC            →   3.3V
GND            →   GND
A/B            →   Meter RS485 A/B terminals

Tasmota Setup

Important: Smart Meter Interface requires custom firmware compilation with USE_SCRIPT and USE_SML_M flags enabled.

Compile Custom Firmware

Add to user_config_override.h:

#define USE_SCRIPT
#define USE_SML_M

SML Script Example (Landis+Gyr E350)

>D
>B
=>sensor53 r
>M 1
+1,3,s,0,9600,SML
1,77070100010800ff@1000,Total,kWh,Total_in,4
1,77070100020800ff@1000,Export,kWh,Total_out,4
1,77070100100700ff@1,Power,W,Power_curr,0
1,77070100200700ff@1,Voltage,V,Volt_curr,1
#

Modbus Script Example (Eastron SDM230)

>D
>B
=>sensor53 r
>M 1
+1,3,m,0,9600,SDM230,1,1,01030000,01030006,01030012,0103001E
1,010304ffffffff@i0:1,Power,W,Power,2
1,010304ffffffff@i1:1,Voltage,V,Voltage,2
1,010304ffffffff@i2:1,Current,A,Current,3
1,010304ffffffff@i3:1,Frequency,Hz,Frequency,2
#

Solar Zero-Export

Combine with the HoymilesZeroExport project to limit solar inverter output based on real-time grid consumption:

# Read grid power from smart meter
# If exporting > 0W, reduce inverter output
# If importing, increase inverter output up to solar capacity

Project: github.com/reserve85/HoymilesZeroExport

Compatible Boards

  • Wemos D1 Mini — most common for IR optical builds
  • ESP32 — for multi-meter setups (multiple serial ports)
  • Olimex ESP32-POE — wired Ethernet for critical utility monitoring

Resources