from sun2000_modbus import inverter
from sun2000_modbus import registers
inverter = inverter.Sun2000(host='192.168.15.40')
inverter.connect()
if inverter.connected:
input_power = inverter.read_formatted(registers.InverterEquipmentRegister.InputPower)
print(input_power)
And I get this error:
> python3 ReadPower.py
Traceback (most recent call last):
File "/var/www/html/PFV_Sun2000/ReadPower.py", line 1, in <module>
from sun2000_modbus import inverter
File "/usr/local/lib/python3.9/dist-packages/sun2000_modbus/inverter.py", line 7, in <module>
from . import datatypes
File "/usr/local/lib/python3.9/dist-packages/sun2000_modbus/datatypes.py", line 32
match data_type:
^
SyntaxError: invalid syntax
I install sun2000_modbus
Then I create the file ReadPower.py with code:
And I get this error: