pyFroniusReg/examples/read_regs.py

17 lines
625 B
Python
Raw Normal View History

2024-10-08 16:32:55 +11:00
#!/usr/bin/env python3
2024-11-03 11:11:40 +11:00
from pyfroniusreg import gen24_primo_symo_inverter_register_map_float as gen24_registers
2024-10-14 20:26:50 +11:00
from pyfroniusreg.froniusreg import RegisterReadError
2024-10-08 16:32:55 +11:00
from pymodbus.client.tcp import ModbusTcpClient
2024-11-03 11:11:40 +11:00
fronius1 = ModbusTcpClient("172.19.107.249", port=502, timeout=10)
2024-10-08 16:32:55 +11:00
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-11-03 11:11:40 +11:00
print(" AC Power: %s" % gen24_registers.W.get(fronius1))
print(" DC Power: %s" % gen24_registers.DCW.get(fronius1))