MatterVN / ModbusTCP2MQTT

Sungrow & SMA Solar Inverter addon for Home Assistant using mobusTCP
MIT License
69 stars 52 forks source link

Connection Failed: TypeError: not all arguments converted during string formatting #79

Open rmcastelao opened 5 months ago

rmcastelao commented 5 months ago

After installation and configuration using HTTP, I get a successful connection but no data is being fetched. Seems to be a parsing error:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/__init__.py", line 1160, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/sungather.py", line 596, in <module>
    main()
  File "/sungather.py", line 530, in main
    if not inverter.checkConnection():
  File "/sungather.py", line 80, in checkConnection
    return self.connect()
  File "/sungather.py", line 63, in connect
    try: self.client.connect()
  File "/usr/lib/python3.12/site-packages/SungrowModbusWebClient/SungrowModbusWebClient.py", line 101, in connect
    logging.warning("Connection Failed", payload_dict['result_msg'] )
Message: 'Connection Failed'
Arguments: ('I18N_COMMON_INTER_ABNORMAL',)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/__init__.py", line 1160, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/sungather.py", line 596, in <module>
    main()
  File "/sungather.py", line 530, in main
    if not inverter.checkConnection():
  File "/sungather.py", line 80, in checkConnection
    return self.connect()
  File "/sungather.py", line 63, in connect
    try: self.client.connect()
  File "/usr/lib/python3.12/site-packages/SungrowModbusWebClient/SungrowModbusWebClient.py", line 101, in connect
    logging.warning("Connection Failed", payload_dict['result_msg'] )
Message: 'Connection Failed'
Arguments: ('I18N_COMMON_INTER_ABNORMAL',)