Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bgetech_modbus

A asynchronous Modbus library for B+G e-tech energy meters.

Usage

Here is a simple example, how to use this lib. In general there are only a few simple steps:

  • create an instance
  • connect
  • build a list with all parameters you want to read from the meter
  • call the read_data() method
import asyncio

from bgetech_modbus.client import BGEtechClient
from bgetech_modbus.devices.ds100 import DS100


async def main():
    client = BGEtechClient(host="127.0.0.1", port=502, device_id=1)
    await client.connect()

    config = [DS100.active_energy_import, DS100.active_energy_export]
    data = await client.read_data(config)

    for entry in data:
        print(f"{entry.name}: {entry.value} {entry.unit}")
        print(f"Last received: {entry.last_received}")
        print(f"[{entry.address}, {entry.count}, {entry.data_type.value}]")
        print()

    client.close()


if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nExit!")

VS Code or any other IDE will show you the possible values that can be retrieved:

Release files for bgetech-modbus 0.1.0b8

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

Source distribution (sdist)

Source distribution for bgetech-modbus 0.1.0b8
File Size Uploaded
bgetech_modbus-0.1.0b8.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bgetech-modbus 0.1.0b8
File Interpreter ABI Platform
bgetech_modbus-0.1.0b8-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / bgetech_modbus-0.1.0b8.tar.gz

Download URL bgetech_modbus-0.1.0b8.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d31c50aebcd6c4d8c00ef051c4bb3f55022e23dfcb5fd7ee1d43f82d445aaf24
BLAKE2b-256 checksum
How to use checksums
eef10349d740e7a1fe9bb11a685eec7e1680cca4258c9939742cf1858e8a503e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / bgetech_modbus-0.1.0b8-py3-none-any.whl

Download URL bgetech_modbus-0.1.0b8-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f890de91075ac56bdad8f98ec5f485c6f25485ea2a08dd41ba85f6b7073a3ca7
BLAKE2b-256 checksum
How to use checksums
86f4045a4418ec45629689e5e82862716e62bb329b82fa9fbec7b42c423cd466
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7
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