Closed j1mco closed 1 year ago
There's an issue in the underlying library that causes occasional glitches when fetching data (that's the Did not receive expected response type
you're seeing in the logs. Sometimes this can happen on the very first try, in which case HA will report this error. This is expected to be sorted in the near future, but in the mean time, could you try to connect a few more times and see if you can get past this stage of the process?
Tried a few more times. Logs maybe more legible:
Error while setting up givenergy_local platform for sensor 20:24:20 – (ERROR) Sensor (custom integration) Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse 20:24:19 – (ERROR) /usr/local/lib/python3.9/site-packages/givenergy_modbus/modbus.py - message first occurred at 20:24:16 and shows up 2 times Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 164 bytes (0 received) 20:24:19 – (ERROR) /usr/local/lib/python3.9/site-packages/givenergy_modbus/modbus.py Transaction failed 20:24:19 – (ERROR) /usr/local/lib/python3.9/site-packages/givenergy_modbus/transaction.py Returned base register (60) does not match that from request (120). 20:24:17 – (ERROR) /usr/local/lib/python3.9/site-packages/givenergy_modbus/modbus.py
I'm getting the same issue, I cannot connect. I've tried dozens of times. I also have GivTCP running on the network, and that is working (mostly) fine, so the inverter is online and available.
Logs:
Logger: givenergy_modbus
Source: /usr/local/lib/python3.9/site-packages/givenergy_modbus/modbus.py:82
First occurred: 10:40:33 (14 occurrences)
Last logged: 10:45:39
Returned base register (60) does not match that from request (0).
Returned base register (0) does not match that from request (180).
Returned base register (0) does not match that from request (60).
Returned base register (60) does not match that from request (120).
Returned base register (60) does not match that from request (180).
Logger: givenergy_modbus
Source: /usr/local/lib/python3.9/site-packages/givenergy_modbus/modbus.py:94
First occurred: 10:40:14 (18 occurrences)
Last logged: 10:45:40
Did not receive expected response type: ReadInputRegistersResponse != ModbusIOException
Did not receive expected response type: ReadHoldingRegistersResponse != ModbusIOException
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Did not receive expected response type: ReadInputRegistersResponse != ReadHoldingRegistersResponse
There's definitley some improvements pending in the underlying givenergy_modbus
library, however I'd expect it to work most of the time, with just occasional errors.
Something I noticed today was that it's far more reliable in my Python 3.10 development environment. Having just upgraded my HA install to 2022.7, which introduces 3.10 for the first time, it now seems more stable on there.
Anyone want to try upgrading and see if that improves things?
I'm running 2022.7, it's still not working:
Logger: givenergy_modbus
Source: /usr/local/lib/python3.10/site-packages/givenergy_modbus/transaction.py:100
First occurred: 00:08:20 (4 occurrences)
Last logged: 00:09:13
Transaction failed
Logger: givenergy_modbus
Source: /usr/local/lib/python3.10/site-packages/givenergy_modbus/modbus.py:52
First occurred: 00:08:20 (8 occurrences)
Last logged: 00:09:13
Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 164 bytes (0 received)
Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
NoneType: None
Just to add here, I find a connection will fail if there is something else polling the device (givtcp for example)
Sorry my repo is private so you wont see the error. I saw this in my logs yesterday, I have not seen the error since and my HA is showing up to date data today. I will monitor if this occurs again and under what circumstances.
Closing for now as I don't think there's anything that could be changed in this project to reduce connectivity issues.
Version of the custom_component
V1.0.0
Describe the bug
Will not connect
Debug log