Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.38 KB

File metadata and controls

45 lines (33 loc) · 1.38 KB

OpenSSF Scorecard

python-em511

python-em511 provides a simple, Pythonic interface for reading and writing data from Carlo Gavazzi EM511 series energy meters over Modbus RTU. It builds on top of pymodbus.

Example usage:

from em511 import Em511
from pymodbus.client import ModbusSerialClient

# Configure the Modbus client
client = ModbusSerialClient(
   port="COM3",  # or "/dev/ttyUSB0" on Linux
   baudrate=9600,
   parity="E",
   stopbits=1,
   bytesize=8,
   # datasheet specifies maximum response timeout of 500ms (typical 40ms)
   timeout=0.5,
)

# Device Modbus address
device_address = 1

# Initialize the EM511 driver
meter = Em511(device_address=device_address, client=client)

# Read voltage
voltage = meter.V
print(f"Voltage: {voltage} V")

# Example of writing a password-protected parameter
meter.password = 1234

Report issues

If you run into problems, you can ask for help in our issue tracker on GitHub.

Contributing

See CONTRIBUTING.MD and DEVELOPMENT.MD.