bohdan-s / SunGather

GNU General Public License v3.0
152 stars 64 forks source link

SH8.0RT-V112 (connected with LAN): model auto detection not working #145

Open pejobo opened 11 months ago

pejobo commented 11 months ago

I've got to configure the model to SH8.0RT manually. Without this I get that output:

$ ../bin/python3 sungather.py --runonce
2023-11-06 14:59:27 INFO     Starting SunGather 0.5.1
2023-11-06 14:59:27 INFO     Need Help? https://github.com/bohdan-s/SunGather
2023-11-06 14:59:27 INFO     NEW HomeAssistant Add-on: https://github.com/bohdan-s/hassio-repository
2023-11-06 14:59:27 INFO     Loaded config: config.yaml
2023-11-06 14:59:31 INFO     Loaded registers: registers-sungrow.yaml
2023-11-06 14:59:31 INFO     Registers file version: 0.2.3
+----------------------------------------------+
| Inverter Configuration Settings              |
+----------------------------------------------+
| Config             | Value                   |
+--------------------+-------------------------+
| host               | 192.xxx.xxx.xxx         |
| port               | 502                     |
| timeout            | 10                      |
| retries            | 3                       |
| RetryOnEmpty       | False                   |
| model              | None                    |
| serial_number      | xxxxxxxxx              |
| level              | 1                       |
| scan_interval      | 30                      |
| use_local_time     | False                   |
| smart_meter        | False                   |
| connection         | modbus                  |
| slave              | 1                       |
| start_time         |                         |
+----------------------------------------------+
2023-11-06 14:59:34 ERROR    index out of range
index out of range
2023-11-06 14:59:34 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 14:59:34 WARNING  Modbus connection failed
Modbus connection failed
+----------------------------------------------------------------------+
| Address | Register                            | Value                |
+---------+-------------------------------------+----------------------+
| ----    | device_type_code                    | None                 |
| vr001   | run_state                           | ON                   |
| vr003   | last_reset                          | 2023-11-6 14:59:33   |
| vr006   | daily_export_to_grid                | 0.0 kWh              |
| vr007   | daily_import_from_grid              | 0.0 kWh              |
| 5003    | daily_power_yields                  | 14.8 kWh             |
| 5004    | total_power_yields                  | 35142 kWh            |
| 5008    | internal_temperature                | 35.9 °C              |
| 5019    | phase_a_voltage                     | 231.3 V              |
| 5006    | start_stop                          | Start                |
| vr002   | timestamp                           | 2023-11-6 14:59:33   |
| vr004   | export_to_grid                      | 0 W                  |
| vr005   | import_from_grid                    | 0 W                  |
+----------------------------------------------------------------------+
Logged 13 registers to Console

This is the output with hard coded model:

$ ../bin/python3 sungather.py --runonce
2023-11-06 15:09:06 INFO     Starting SunGather 0.5.1
2023-11-06 15:09:06 INFO     Need Help? https://github.com/bohdan-s/SunGather
2023-11-06 15:09:06 INFO     NEW HomeAssistant Add-on: https://github.com/bohdan-s/hassio-repository
2023-11-06 15:09:06 INFO     Loaded config: config.yaml
2023-11-06 15:09:10 INFO     Loaded registers: registers-sungrow.yaml
2023-11-06 15:09:10 INFO     Registers file version: 0.2.3
+----------------------------------------------+
| Inverter Configuration Settings              |
+----------------------------------------------+
| Config             | Value                   |
+--------------------+-------------------------+
| host               | 192.xxx.xxx.xxx         |
| port               | 502                     |
| timeout            | 10                      |
| retries            | 3                       |
| RetryOnEmpty       | False                   |
| model              | SH8.0RT                 |
| serial_number      | A231060426              |
| level              | 1                       |
| scan_interval      | 30                      |
| use_local_time     | False                   |
| smart_meter        | False                   |
| connection         | modbus                  |
| slave              | 1                       |
| start_time         |                         |
+----------------------------------------------+
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
2023-11-06 15:09:13 ERROR    index out of range
index out of range
2023-11-06 15:09:13 ERROR    Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/transaction.py", line 208, in execute
    self.client.framer.processIncomingPacket(response,
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 153, in processIncomingPacket
    self._process(callback)
  File "xxxx/SunGather/lib/python3.11/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
2023-11-06 15:09:13 WARNING  Modbus connection failed
Modbus connection failed
+----------------------------------------------------------------------+
| Address | Register                            | Value                |
+---------+-------------------------------------+----------------------+
| ----    | device_type_code                    | SH8.0RT              |
| vr001   | run_state                           | ON                   |
| vr003   | last_reset                          | 2023-11-6 15:09:12   |
| vr006   | daily_export_to_grid                | 0.008366666666666666 kWh |
| vr007   | daily_import_from_grid              | 0.0 kWh              |
| 5003    | daily_power_yields                  | 14.9 kWh             |
| 5004    | total_power_yields                  | 35143 kWh            |
| 5008    | internal_temperature                | 36.1 °C              |
| 5019    | phase_a_voltage                     | 230.8 V              |
| 6100    | pv_power_of_today                   | 0 W                  |
| 6196    | daily_pv_energy_yields              | 14.8 kWh             |
| 13003   | total_pv_generation                 | 3508.0 kWh           |
| 13005   | daily_pv_export                     | 13.2 kWh             |
| 13006   | total_pv_export                     | 3247.3 kWh           |
| 13008   | load_power_hybrid                   | 99 W                 |
| 13010   | export_power_hybrid                 | 1004 W               |
| 13012   | daily_battery_charge_from_pv        | 0.0 kWh              |
| 13013   | total_battery_charge_from_pv        | 0.0 kWh              |
| 13017   | daily_direct_energy_consumption     | 1.6 kWh              |
| 13018   | total_direct_energy_consumption     | 260.7 kWh            |
| 13022   | battery_power                       | 0 W                  |
| 13023   | battery_level                       | 0.0 %                |
| 13029   | self_consumption_of_day             | 10.8 %               |
| 13030   | grid_state                          | None                 |
| 13034   | total_active_power                  | 1103 W               |
| 13036   | daily_import_energy                 | 1.8 kWh              |
| 13037   | total_import_energy                 | 508.5 kWh            |
| 13045   | daily_export_energy                 | 13.2 kWh             |
| 5006    | start_stop                          | Start                |
| vr002   | timestamp                           | 2023-11-6 15:09:12   |
| vr004   | export_to_grid                      | 1004 W               |
| vr005   | import_from_grid                    | 0 W                  |
+----------------------------------------------------------------------+
Logged 32 registers to Console
HubertusH commented 7 months ago

i have the same sungrow - and the same output :-( can we help to fix this? BR Hubertus