pyFroniusReg/examples/read_regs.py

21 lines
999 B
Python
Raw Normal View History

2024-10-08 16:32:55 +11:00
#!/usr/bin/env python3
2024-10-14 20:26:50 +11:00
from pyfroniusreg import gen24_registers
from pyfroniusreg.froniusreg import RegisterReadError
2024-10-08 16:32:55 +11:00
from pymodbus.client.tcp import ModbusTcpClient
fronius1 = ModbusTcpClient("172.19.107.211", port=502, timeout=10)
fronius1.connect()
2024-10-14 20:26:50 +11:00
print(" Manufacturer: %s" % gen24_registers.Mn.get(fronius1))
print(" Model: %s" % gen24_registers.Md.get(fronius1))
print(" Version: %s" % gen24_registers.Vr.get(fronius1))
2024-10-16 21:33:28 +11:00
print(" SOC: %s%%" % gen24_registers.scaledChaState.get(fronius1))
2024-10-14 20:26:50 +11:00
print("Max DCharg Rate: %d%%" % gen24_registers.scaledOutWRte.get(fronius1))
print("Max Charge Rate: %d%%" % gen24_registers.scaledInWRte.get(fronius1))
2024-10-16 21:33:28 +11:00
print(" Reserve: %d%%" % gen24_registers.scaledMinRsvPct.get(fronius1))
2024-10-14 20:26:50 +11:00
print("Max Charge rate: %dW" % gen24_registers.scaledMaxChaRte.get(fronius1))
2024-10-16 21:33:28 +11:00
print(" Current charge: %dW" % gen24_registers.scaledmodule_3_DCW.get(fronius1))
print(" Current dCharg: %dW" % gen24_registers.scaledmodule_4_DCW.get(fronius1))