Asynchronous Modbus library for B+G e-tech energy meters.
Project description
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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bgetech_modbus-0.1.0b4.tar.gz.
File metadata
- Download URL: bgetech_modbus-0.1.0b4.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b430e21f6d9bfc362595335ad84b057987cd9846a4503e31298b626ab72d64de
|
|
| MD5 |
c5112e9ddd8fbc757b2feb06eb59b94e
|
|
| BLAKE2b-256 |
f7ba992443f5024eee926257bf95e03d0ee1e8993827c097153db1de505e1f3f
|
File details
Details for the file bgetech_modbus-0.1.0b4-py3-none-any.whl.
File metadata
- Download URL: bgetech_modbus-0.1.0b4-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff4ab1758f6f45a2a22662b0be293ad6d61f1257e1736a7e04e74bf5e1895f8a
|
|
| MD5 |
b2f80e1429fe883f27e80cdf85417e87
|
|
| BLAKE2b-256 |
e4b861f1e2986caf7e16f6402907c2287443d496e0693ee146a23bcb6362deab
|