Skip to main content

Library to parse IEC62056/IEC1107/DSMR telegrams

Project description

iec62056

a robust IEC1107/IEC62056 parser in Python.

This library is meant to parse IEC1107/IEC62056 telegrams in Python. You'll need this to process information from your smart meter (e.g. DSMR P1). The code differs from other libraries in several ways:

  • It actually parses the messages using a (EBNF) grammar. This makes the parsing robust and extendable.
  • It is designed as an external library instead of being inseperable with other software components (such as P1 serial readers).
  • It aims to handle all IEC 62056 formatted telegrams, not only DSMR. I needed this, because of my IEC 1107 speaking district heat meter, which resembles DSMR.

Compatibility

This module is targeted to be compatible with all kinds of digital meters outputting IEC62056 formatted telegrams. It implements several (sub)standards.

Standards

The module implements the following standards:

  • IEC 1107/IEC 62056-21 (COSEM, OBIS). IEC 1107 was superseded by IEC 62056
  • DSMR (versions 2.2, 4.0, 4.0.5, 4.0.7, 4.2, 5.0)

Data types

These data types are recognised:

  • Standard COSEM OBIS register
  • COSEM OBIS timestamped register (e.g. gas via M-Bus)
  • Profile Generic (e.g. power failure logs)

Equipment

Testing was done with sample telegrams from the following meters:

  • Kamstrup Multical 66C (district heating meter)
  • Kaifa MA 105
  • Iskra AM 550
  • Iskra MT 382
  • Landis + Gyr E350/ZCF110
  • ZIV 5CTA3 (aka Enexis ESMR5)

Usage

$ pip install iec62056
$ python3
>>> import iec62056
>>> p = iec62056.parser.Parser()
>>> t = p.parse(b'... your telegram ')
>>> print(t.keys())
>>> for k in t.keys():
...   o = t[k]
...   if isinstance(o, iec62056.objects.Register):
...     print('  {} = {}'.format(k, o.value))
>>>

Thanks

Since specs on IEC 62056/1107 and DSMR can sometimes be tough to find or interpret, I used a lot of concepts from other projects. I've used knowledge from these projects:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iec62056-0.5.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iec62056-0.5.1-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file iec62056-0.5.1.tar.gz.

File metadata

  • Download URL: iec62056-0.5.1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for iec62056-0.5.1.tar.gz
Algorithm Hash digest
SHA256 c97379c2d8056f77e40d903e840ad81d4bc3baf2d1f70e2d0343b720dbbe5304
MD5 95aad2eafadcbe06d6811e5de1de2e2b
BLAKE2b-256 977921c304827cb3008b4ac62d29b4ea4199c195be705576d2c700024773d19b

See more details on using hashes here.

File details

Details for the file iec62056-0.5.1-py2.py3-none-any.whl.

File metadata

  • Download URL: iec62056-0.5.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for iec62056-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 68fee5843a89b399dfea99276b7975c42c73c17dbce191e063815c3e3ba0139c
MD5 da6bff12b4db633948dcea5ce37fd851
BLAKE2b-256 f021447ed64322e18dc99c72b2b2f96b0440dc98851d2d2394b3c1bcbb030418

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page