Skip to main content

Library to parse Dutch Smart Meter Requirements (DSMR)

Project description

https://img.shields.io/pypi/v/dsmr-parser.svg

A library for parsing Dutch Smart Meter Requirements (DSMR) telegram data. It also includes a serial client to directly read and parse smart meter data.

Features

DSMR Parser currently supports DSMR versions 2.2 and 4.x. It has been tested with Python 3.5 and 3.4.

Examples

Using the serial reader to connect to your smart meter and parse it’s telegrams:

from dsmr_parser import telegram_specifications
from dsmr_parser.obis_references import P1_MESSAGE_TIMESTAMP
from dsmr_parser.serial import SerialReader, SERIAL_SETTINGS_V4

serial_reader = SerialReader(
    device='/dev/ttyUSB0',
    serial_settings=SERIAL_SETTINGS_V4,
    telegram_specification=telegram_specifications.V4
)

for telegram in serial_reader.read():

    # The telegram message timestamp.
    message_datetime = telegram[P1_MESSAGE_TIMESTAMP]

    # Using the active tariff to determine the electricity being used and
    # delivered for the right tariff.
    tariff = telegram[ELECTRICITY_ACTIVE_TARIFF]
    tariff = int(tariff.value)

    electricity_used_total \
        = telegram[ELECTRICITY_USED_TARIFF_ALL[tariff - 1]]
    electricity_delivered_total = \
        telegram[ELECTRICITY_DELIVERED_TARIFF_ALL[tariff - 1]]

    gas_reading = telegram[HOURLY_GAS_METER_READING]

    # See dsmr_reader.obis_references for all readable telegram values.

Installation

To install DSMR Parser:

$ pip install dsmr-parser

TODO

  • add unit tests

  • verify telegram checksum

  • improve ease of use

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

dsmr-parser-0.3.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file dsmr-parser-0.3.tar.gz.

File metadata

  • Download URL: dsmr-parser-0.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dsmr-parser-0.3.tar.gz
Algorithm Hash digest
SHA256 63e0adec2910645dc1c8cfc4eb28b165bab80d99eb43c7c25a1ab5a52a35a486
MD5 2ecec108f413aae64c1fd3ed23869dbe
BLAKE2b-256 1517506cb882c3a2aaf3720a331b654178f89c4f74c091e3b6854e1de3b508f0

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