Skip to main content

Energymeter Python Module

This is a Python module that implements the communication to several electricity meters and related equipment.

At the moment, the following meters are supported:

  • ABB B21, B23, A43 and similar ABB meters (Modbus Serial)
  • SMA SunnyBoy (Modbus TCP)
  • MultiCube meters

Some base classes are also provided for you to implement new meter variants.

Installation

git clone https://github.com/ElaadNL/python-energymeter
cd python-energymeter
pip3 install .

Usage

To read all registers from a meter:

from energymeter import ABBMeter

meter = ABBMeter(port="/dev/ttyUSB0", baudrate=38400, slaveaddress=1, model="B23")
data = meter.read()

This returns a dictionary with all key-value pairs of data.

To read a single register:

data = meter.read('current_l1')

This returns just the value (usualy a float or int).

To read multiple registers:

data = meter.read(['current_l1', 'voltage_l1_n'])

This returns a dictionary with the requested keys and values.

Metadata

Release files for energymeter 1.3.0

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

Source distribution (sdist)

Source distribution for energymeter 1.3.0
File Size Uploaded
energymeter-1.3.0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for energymeter 1.3.0
File Interpreter ABI Platform
energymeter-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / energymeter-1.3.0.tar.gz

Download URL energymeter-1.3.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cfb6802a1222bcb4cefe1aaefa48b0218109bd7e619a7426b1cd95a6df5fb725
BLAKE2b-256 checksum
How to use checksums
6a5eb24293af8a2f758f4c7903884e35373baa459ce16db5a9ddb6c7aebf71b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / energymeter-1.3.0-py3-none-any.whl

Download URL energymeter-1.3.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19cee10b6e4516c57d027ab9aa18b904b3fcf122ef8a07a12ed671b51cffcb1f
BLAKE2b-256 checksum
How to use checksums
dcbc26489b97db12f041470ab5af139e07a3df3b8c17993e2d4e253ea34a133e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.1.0

2 release files

1.0.5

1 release file

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