Skip to main content

obis-parser

PyPI version Python versions License

Dependency-free OBIS parser and measurement catalog for smart meters and energy gateways.

Extracts, parses, and normalizes OBIS (Object Identification System) codes (A-B:C.D.E*F) across smart meters (eHZ / mME), optical IR readouts (SML / IEC 62056-21), P1/DSMR meters, and Smart Meter Gateways (SMGW).


Features

  • Zero External Dependencies: Built entirely with standard library Python (dataclasses, re, string, typing).
  • Universal Ingestion: Auto-detects and parses:
    • Canonical strings: 1-0:1.8.0, 1-0:1.8.0*255, 1-1:1.7.0
    • Shorthand display strings: 1.8.0, 16.7.0, 81.7.4 (defaults to electricity A=1, channel B=0)
    • Bare COSEM 12-hex: 0100010800ff, 0100100700ff, 010001080000 (F=0)
    • COSEM logical names with meter suffixes: 0100010800ff.1lgz0067285558.sm
    • Dot-separated hex: 01.00.01.08.00.FF
  • Single Domain Model (OBIS): Everything is accessed directly on the OBIS instance (.canonical, .name, .slug, .placeholders, .decode()).
  • Channel & Tariff Qualifiers: Treats Channel ($B \neq 0$) and Tariff ($1 \le E < 255$) as name qualifiers on $(C, D)$ base measurements.
  • 4-Variant Localization Slugs: Generates variant slugs (base, _channel, _tariff, _channel_tariff) with placeholder maps, ready for Home Assistant, Prometheus, or UI localization.
  • Curated Catalog: 39 standard German electricity registers (DIN EN 62056-6-1 / DIN 43863-3) with units, device classes, state classes, and icons.

Installation

pip install obis-parser

or with uv:

uv add obis-parser

Quick Start

1. Basic Parsing & Properties

from obis_parser import OBIS

# Parses strings, bare-hex, dot-hex, or COSEM logical names
obis = OBIS.parse("0100010800ff")
if obis:
    print(obis.canonical)  # "1-0:1.8.0" (or str(obis))
    print(obis.name)  # "Active energy import"
    print(obis.slug)  # "active_energy_import"
    print(obis.is_electricity)  # True
    print(obis.channel)  # 0
    print(obis.tariff)  # 0

2. Multi-Meter Channels & Tariffs

# Multi-meter behind one gateway (Channel 1, Tariff 2)
obis = OBIS.parse("1-1:1.8.2")
if obis:
    print(obis.canonical)  # "1-1:1.8.2"
    print(obis.name)  # "Active energy import (Channel 1, Tariff 2)"
    print(obis.slug)  # "active_energy_import_channel_tariff"
    print(obis.placeholders)  # {"channel": "1", "tariff": "2"}

3. Full Metadata Decode (obis.decode())

obis = OBIS.parse("0100200700ff")  # Voltage L1 (32.7.0)
if obis:
    m = obis.decode()
    print(m.name)  # "Voltage L1"
    print(m.unit)  # "V"
    print(m.device_class)  # "voltage"
    print(m.state_class)  # "measurement"
    print(m.icon)  # "mdi:sine-wave"

Supported Registers (Catalog Overview)

(C, D, E) Measurement Slug Unit Device Class State Class
(1, 8) Active energy import active_energy_import kWh energy total_increasing
(2, 8) Active energy export active_energy_export kWh energy total_increasing
(3, 8) Reactive energy import reactive_energy_import kvarh reactive_energy total_increasing
(4, 8) Reactive energy export reactive_energy_export kvarh reactive_energy total_increasing
(9, 8) Apparent energy apparent_energy kVAh None total_increasing
(1, 7) Active power import active_power_import W power measurement
(2, 7) Active power export active_power_export W power measurement
(3, 7) Reactive power import reactive_power_import var reactive_power measurement
(4, 7) Reactive power export reactive_power_export var reactive_power measurement
(9, 7) Apparent power apparent_power VA apparent_power measurement
(16, 7) Active power total (net sum) active_power_total W power measurement
(15, 7) Absolute active power (|P|) absolute_active_power W power measurement
(36/56/76, 7) Active power L1/L2/L3 (signed) active_power_l1..3 W power measurement
(21/41/61, 7) Active power import L1/L2/L3 (+P) active_power_import_l1..3 W power measurement
(22/42/62, 7) Active power export L1/L2/L3 (-P) active_power_export_l1..3 W power measurement
(32/52/72, 7) Voltage L1/L2/L3 voltage_l1..3 V voltage measurement
(12, 7) Voltage (total/RMS) voltage V voltage measurement
(31/51/71, 7) Current L1/L2/L3 current_l1..3 A current measurement
(11, 7) Current (neutral/total) current A current measurement
(13, 7) Power factor ($\cos \varphi$) power_factor None power_factor measurement
(14, 7) Frequency frequency Hz frequency measurement
(81, 7, 0) Phase angle phase_angle ° None measurement
(81, 7, 1/2) Phase angle U(L2)/U(L3) to U(L1) phase_angle_u_l2..3_l1 ° None measurement
(81, 7, 4/15/26) Phase angle L1/L2/L3 (U to I) phase_angle_l1..3 ° None measurement
(0, 2, 0) Firmware version firmware_version None None None
(96, 1, 0) Meter identification / Serial meter_identification None None None

License

Apache 2.0. Copyright 2026 Jannick Fahlbusch.

Metadata

Release files for obis-parser 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obis-parser 0.0.4
File Size Uploaded Provenance Actions
obis_parser-0.0.4.tar.gz 16.4 kB Without provenance Details for obis_parser-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for obis-parser 0.0.4
File Interpreter ABI Platform Actions
obis_parser-0.0.4-py3-none-any.whl Python 3 none any Details for obis_parser-0.0.4-py3-none-any.whl

Total release size: 29.5 kB

Release files / obis_parser-0.0.4.tar.gz

Download URL obis_parser-0.0.4.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9da25d59785c151adf69f5bac7b5125ce81ac2a506e92a6ffc5a237a80102c12
BLAKE2b-256 checksum
How to use checksums
11af26938afabe054580e0b1e4e1471d60a6b1e1107df7a92640b420dc909003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / obis_parser-0.0.4-py3-none-any.whl

Download URL obis_parser-0.0.4-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d17e8416e181ecd015247419be7552356f3a6ee218c2db86ed065dbff39c129f
BLAKE2b-256 checksum
How to use checksums
66915975017e7746cb9aeb26e7fa3d3955190782ec9ed9ac6213bc3c13250f04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for obis-parser 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page