Closed markusdunckert closed 1 month ago
Hi,
Try with this
>>> from deye_controller import HoldingRegisters
>>> from pysolarmanv5 import PySolarmanV5
>>> gen_total_p = HoldingRegisters.GeneratorTotalPower
>>> sol = PySolarmanV5('192.168.100.138', 27123456789, auto_reconnect=True)
>>> gen_total_p.value = sol.read_holding_registers(gen_total_p.address, gen_total_p.len)[0]
>>> gen_total_p.format()
0
With #15 it should be even easier
>>> from deye_controller import HoldingRegisters
>>> from deye_controller.utils import monkey_patch
>>> from pysolarmanv5 import PySolarmanV5
>>> monkey_patch()
>>> gen_total_p = HoldingRegisters.GeneratorTotalPower
>>> sol = PySolarmanV5('192.168.100.138', 27123456789, auto_reconnect=True)
>>> sol.read_holding_registers(gen_total_p)
>>> gen_total_p.format()
0
Thank you for the advice, but unfortunately it doesnt work. The first one breaks with: gen_total_p = HoldingRegisters.GeneratorTotalPower AttributeError: type object 'HoldingRegisters' has no attribute 'GeneratorTotalPower'
The second example: there is no function monkey_patch.
Any ideas?
Hi,
Ensure that you are at the latest version 0.1.5 (pip3 install --upgrade deye-conroller
). The grenerator related register were added after 0.1.4
As for the monkey_patch call it is not even merged in the main branch yet. It will be available in the next PyPI release.
great, that was the solution!
Hi,
I cannot access the GeneratorTotalPower in the Class HoldingRegisters. Could you please explain how to access the values here? Thanks in advance