pysml
Python library for EDL21 smart meters using Smart Message Language (SML)
What it is and what it does
pysml is a Python library that reads and decodes Smart Message Language (SML) protocol data from EDL21 smart electricity meters. It abstracts away low-level SML parsing and provides access to OBIS meter values. The library supports multiple transport mechanisms—direct serial connections, serial-over-TCP bridges, and HTTP endpoints—making it flexible for different deployment scenarios.
The package is actively used by Home Assistant's EDL21 integration and includes example code for publishing meter readings to MQTT. It depends on aiohttp, bitstring, and serialx for async HTTP, binary protocol handling, and serial communication. With MIT licensing and support for Python 3.11 through 3.14, it suits home automation, energy monitoring, and utility data collection workflows.
Use it for:
- Read energy consumption data from EDL21 meters in Home Assistant or other home automation systems.
- Build an MQTT bridge to publish smart meter OBIS values to a message broker for real-time monitoring.
- Collect meter readings over serial-over-TCP links in remote or networked meter deployments.
- Parse and log SML protocol data from HTTP-accessible meter endpoints for analytics or billing systems.
- Integrate smart meter data into custom Python applications for demand-side energy management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and parses Smart Message Language (SML) data from EDL21 smart meters via serial ports, serial-over-TCP, or HTTP connections.
Yes, if you need to read EDL21 smart meters. The library is actively maintained, has low install friction, carries no known vulnerabilities, and is proven in Home Assistant. MIT license is unrestrictive. Main consideration: ensure your meter model and transport method are supported, and your Python environment is 3.11 or later.
Install
pysml on PyPI
pip
pip install pysmluv
uv add pysmlpoetry
poetry add pysmlInstalling pysml
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release 75 days ago. Requires Python 3.11 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install pysml
import pysml
# Read SML data from serial port, serial-over-TCP, or HTTP endpoint
# See examples/sml-mqtt-bridge.py for MQTT publishing pattern
Requires Python 3.11 or later; meter must be accessible via serial, serial-over-TCP, or HTTP.
Verify before relying
- Whether aiohttp, bitstring, and serialx are stable and well-maintained for production use.
- Performance characteristics when reading from high-frequency meter streams or concurrent connections.
- Completeness of SML protocol support and compatibility with specific meter models.
- Whether example code for MQTT publishing is production-ready or demonstration-only.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiohttp, bitstring, serialx |
| Maintenance | actively maintained — 75 days since the last release |
| First released | |
| Downloads | 77,848/month — #14,488 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pysml-0.1.8-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
dlms-cosemA Python library for implementing DLMS/COSEM…
permissive · top 15,000 on PyPI
dsmr-parserParses Dutch Smart Meter Requirements (DSMR)…
permissive · top 15,000 on PyPI
pysmaConnects to SMA solar inverters via their…
permissive · top 15,000 on PyPI
pydiscovergyAsynchronous Python client for querying…
permissive · top 15,000 on PyPI
p1monitorAsynchronous Python client library for reading…
permissive · top 15,000 on PyPI
pysmappeeWrapper library for the Smappee energy…
permissive · top 15,000 on PyPI
python-homewizard-energyAsyncio client library for communicating with…
permissive · top 15,000 on PyPI
ovoenergyA Python client library for querying energy…
permissive · top 15,000 on PyPI
HATasmotaParses and constructs Tasmota MQTT messages,…
permissive · top 15,000 on PyPI
pymysensorsPython API for communicating with MySensors…
permissive · top 15,000 on PyPI