nmakel / solaredge_modbus

SolarEdge Modbus data collection library
MIT License
141 stars 33 forks source link

reading inverter.meters() is not working #67

Open Seeelefant opened 1 year ago

Seeelefant commented 1 year ago

Dear all, trying to setup a connection to my inverter and read the meter I get the following results:

C:\Dev\Python\Solaredge>python
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import solaredge_modbus
>>> inverter = solaredge_modbus.Inverter(host="192.168.0.3", port=1502)
>>> inverter.connect()
True
>>> inverter.connected()
True
>>> inverter
Inverter(192.168.0.3:1502, connectionType.TCP: timeout=1, retries=3, unit=0x1)
>>> inverter.read("current")
{'current': False}
>>> inverter.read_all()
{}
>>> inverter.registers["current"]
(40071, 1, <registerType.HOLDING: 2>, <registerDataType.UINT16: 1>, <class 'int'>, 'Current', 'A', 2)
>>> inverter.registers["status"]
(40107, 1, <registerType.HOLDING: 2>, <registerDataType.UINT16: 1>, <class 'int'>, 'Status', ['Undefined', 'Off', 'Sleeping', 'Grid Monitoring', 'Producing', 'Producing (Throttled)', 'Shutting Down', 'Fault', 'Standby'], 2)
>>> inverter.meters()
{}
>>>

Please advice.

nmakel commented 1 year ago

Are you sure the modbus ID of your inverter, the unit, is actually 1?

Seeelefant commented 1 year ago

In that direction I have no idea, the only thing I got from my craftsman is that IMG_4101 Is there anything I should do different or tell him to change?

nmakel commented 1 year ago

Try:

inverter = solaredge_modbus.Inverter(host="192.168.0.3", port=1502, unit=2)

Increase the unit value by 1 until you get results.

Seeelefant commented 1 year ago

Well, this looks much better:

Inverter(192.168.0.3:1502, connectionType.TCP: timeout=1, retries=3, unit=0x2)
>>> inverter.read("current")
{'current': 0}
>>> inverter.read_all()
{'c_id': 'SunS', 'c_did': 1, 'c_length': 65, 'c_manufacturer': 'SolarEdge', 'c_model': 'SE9K-RW0TEBEN4', 'c_version': '0004.0016.0025', 'c_serialnumber': '7E1C2EDC', 'c_deviceaddress': 2, 'c_sunspec_did': 103, 'c_sunspec_length': 50, 'current': 0, 'l1_current': 0, 'l2_current': 0, 'l3_current': 0, 'current_scale': -2, 'l1_voltage': 4066, 'l2_voltage': 4069, 'l3_voltage': 4080, 'l1n_voltage': 2348, 'l2n_voltage': 2355, 'l3n_voltage': 2347, 'voltage_scale': -1, 'power_ac': 0, 'power_ac_scale': 0, 'frequency': 4998, 'frequency_scale': -2, 'power_apparent': 0, 'power_apparent_scale': 0, 'power_reactive': 0, 'power_reactive_scale': 0, 'power_factor': 0, 'power_factor_scale': 0, 'energy_total': 7498561, 'energy_total_scale': 0, 'current_dc': 0, 'current_dc_scale': -32768, 'voltage_dc': 0, 'voltage_dc_scale': -1, 'power_dc': 0, 'power_dc_scale': 0, 'temperature': 2404, 'temperature_scale': -2, 'status': 2, 'vendor_status': 0, 'rrcr_state': 0, 'active_power_limit': 80, 'cosphi': 0, 'commit_power_control_settings': 0, 'restore_power_control_default_settings': 0, 'reactive_power_config': 0, 'reactive_power_response_time': 200, 'advanced_power_control_enable': 1, 'export_control_mode': 1, 'export_control_limit_mode': 0, 'export_control_site_limit': -36972037258107420672}
>>> inverter.registers["current"]
(40071, 1, <registerType.HOLDING: 2>, <registerDataType.UINT16: 1>, <class 'int'>, 'Current', 'A', 2)
>>> inverter.registers["status"]
(40107, 1, <registerType.HOLDING: 2>, <registerDataType.UINT16: 1>, <class 'int'>, 'Status', ['Undefined', 'Off', 'Sleeping', 'Grid Monitoring', 'Producing', 'Producing (Throttled)', 'Shutting Down', 'Fault', 'Standby'], 2)

Let me check it when there are some photons working ;-)

vinivinilos commented 4 months ago

Hi! I'm facing the same problem. Got two meters, but no data. Increased the unit until 3 with no luck. Do you have any other clue?