Skip to content

Repository files navigation

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.

About

Driver for Carlo Gavazzi EM511 Series Single Phase Energy Meters using Modbus RTU

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages