cdpuk / givenergy-local

Home Assistant integration for local access to GivEnergy inverter and battery systems
MIT License
47 stars 14 forks source link

Unable to connect to inverter #65

Closed stefanwest1 closed 8 months ago

stefanwest1 commented 9 months ago

Hi all,

Had my system fitted today. Looking to link it with HA. I have confirmed I can connect locally from the givenergy app.

Installed the custom integration today, added the IP address from the givenergy app, and I'm getting a "Failed to connect error". Below are the logs from HA

2023-10-13 17:14:18.857 ERROR (SyncWorker_11) [givenergy_modbus] Transaction failed 2023-10-13 17:14:18.858 ERROR (SyncWorker_11) [givenergy_modbus] Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 164 bytes (0 received) NoneType: None 2023-10-13 17:14:18.858 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException 2023-10-13 17:14:21.360 ERROR (SyncWorker_11) [givenergy_modbus] No decoder for function code 57 2023-10-13 17:14:21.360 WARNING (SyncWorker_11) [givenergy_modbus] Unable to decode request 2023-10-13 17:14:21.361 ERROR (SyncWorker_11) [givenergy_modbus] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response NoneType: None 2023-10-13 17:14:21.362 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException 2023-10-13 17:14:23.865 ERROR (SyncWorker_11) [givenergy_modbus] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response NoneType: None 2023-10-13 17:14:23.866 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException 2023-10-13 17:14:25.701 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse 2023-10-13 17:14:26.854 ERROR (MainThread) [custom_components.givenergy_local] Failed to validate inverter configuration Traceback (most recent call last): File "/config/custom_components/givenergy_local/config_flow.py", line 25, in read_inverter_serial await hass.async_add_executor_job(client.refresh_plant, plant, True) asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/givenergy_local/config_flow.py", line 48, in async_step_user serial_no = await read_inverter_serial(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/givenergy_local/config_flow.py", line 24, in read_inverter_serial async with async_timeout.timeout(10): File "/lsiopy/lib/python3.11/site-packages/async_timeout/init.py", line 141, in aexit self._do_exit(exc_type) File "/lsiopy/lib/python3.11/site-packages/async_timeout/init.py", line 228, in _do_exit raise asyncio.TimeoutError TimeoutError 2023-10-13 17:14:28.204 ERROR (SyncWorker_11) [givenergy_modbus] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response NoneType: None 2023-10-13 17:14:28.205 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException 2023-10-13 17:14:30.708 ERROR (SyncWorker_11) [givenergy_modbus] Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response NoneType: None 2023-10-13 17:14:30.709 ERROR (SyncWorker_11) [givenergy_modbus] Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException

cdpuk commented 8 months ago

Since this is a new install the underlying cause is probably the outdated givenergy_modbus library - see #61, which also manifests itself in issues such as #31 and #64. Unfortunately, this is not a quick fix to this integration, but rather a complete rethink about how the underlying comms is done.