Skip to main content

Parsing P1 serial to Influx DB

Reason this release was yanked:

Version incorrectly bumped

Project description

p1-influx-db

A python implementation for pushing data to influxDB from a P1 meter

This packages uses the HTTP api from influxDB to store the given data of the P1 meter The package contains a python module named p1_influx_db which requires a path towards the config as input. An example config can be found in the package. This config is a toml which let's the module know what kind of behaviour you want to use. In order to process the DSMR p1 information the config requires a [p1] clause. Depending on the method of transmission either a [influx2] block or a [mqtt] block. Both are valid protocols for transmitting the data. The keys are the given fields that you want to receive data on; these can be changed depending on the type of meter available and the interest in the values.

Getting started

To start the module just use python -m p1_influx_db --config <path_to_config>

For which the following is an example config:

# TOML-based config
[influx2]
url = "http://localhost:8086"
org = "my-org"
token = "my-token"

[mqtt]
broker = "localhost"
port = 433
client_id = "client_id"
ca_certs = "/etc/certificate/abc"
certfile = "/etc/certificate/abc"
key = "etc/certificate/key"

[p1]
device = "/dev/serial0"

[p1.electricity]
keys = ["ELECTRICITY_USED_TARIFF_1",
        "ELECTRICITY_USED_TARIFF_2",
        "ELECTRICITY_DELIVERED_TARIFF_1",
        "ELECTRICITY_DELIVERED_TARIFF_2"]

[p1.electricity_current]
keys = ["CURRENT_ELECTRICITY_USAGE",
        "CURRENT_ELECTRICITY_DELIVERY",
        "INSTANTANEOUS_ACTIVE_POWER_L1_POSITIVE",
        "INSTANTANEOUS_ACTIVE_POWER_L2_POSITIVE",
        "INSTANTANEOUS_ACTIVE_POWER_L3_POSITIVE",
        "INSTANTANEOUS_ACTIVE_POWER_L1_NEGATIVE",
        "INSTANTANEOUS_ACTIVE_POWER_L2_NEGATIVE",
        "INSTANTANEOUS_ACTIVE_POWER_L3_NEGATIVE"]

[p1.voltage]
keys = ["INSTANTANEOUS_VOLTAGE_L1",
        "INSTANTANEOUS_VOLTAGE_L2",
        "INSTANTANEOUS_VOLTAGE_L3"]

[p1.current]
keys = ["INSTANTANEOUS_CURRENT_L1",
        "INSTANTANEOUS_CURRENT_L2",
        "INSTANTANEOUS_CURRENT_L3"]

[p1.gas]
keys = ["HOURLY_GAS_METER_READING"]

Instalation

The package has multiple modes of installation namely full, influxdb or mqtt. In other to save space it is advised to use the extra install fields just for the protocol required so either. pip install p1-influx-db[mqtt] or pip install p1-influx-db[influxdb]

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

p1_influx_db-2.6.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

p1_influx_db-2.6.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file p1_influx_db-2.6.1.tar.gz.

File metadata

  • Download URL: p1_influx_db-2.6.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for p1_influx_db-2.6.1.tar.gz
Algorithm Hash digest
SHA256 0c88216b55f180c42da3bc1bf235a2fe9af5be91ba11c02ca32e35dbf144f68c
MD5 e8c996db4405502a9c389319927650ef
BLAKE2b-256 f5a94436ed91dc92ed2eb6a9a900141ca9e0acff30d898bee50fe4d9b2693fdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for p1_influx_db-2.6.1.tar.gz:

Publisher: python-package.yml on yfredrix/p1-influx-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file p1_influx_db-2.6.1-py3-none-any.whl.

File metadata

  • Download URL: p1_influx_db-2.6.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for p1_influx_db-2.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da67fb100262db4a0f4e011a9f16b686ad3a4324e2d18f292261b71ac9632ef9
MD5 7cc5a36e975b1a5366e29f8c9382c043
BLAKE2b-256 1e28e29994f49ead86bbe3403e1403409ac391c6a7551c4418fe3a7165315742

See more details on using hashes here.

Provenance

The following attestation bundles were made for p1_influx_db-2.6.1-py3-none-any.whl:

Publisher: python-package.yml on yfredrix/p1-influx-db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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