Closed DevOpsFu closed 2 months ago
I'm not sure this is an issue related to the integration itself. It looks like it's either a local problem on my network or an issue with the givenergy_modbus
library. I'm doing some basic tests, pulling the battery percentage every few seconds and the results are very flaky.
100
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Returned base register (0) does not match that from request (60).
Returned base register (60) does not match that from request (120).
100
Did not receive expected response type: ReadInputRegistersResponse != ReadHoldingRegistersResponse
Did not receive expected response type: ReadInputRegistersResponse != ReadHoldingRegistersResponse
Returned base register (120) does not match that from request (0).
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
100
Did not receive expected response type: ReadInputRegistersResponse != ReadHoldingRegistersResponse
Returned base register (120) does not match that from request (180).
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
100
Did not receive expected response type: ReadInputRegistersResponse != ReadHoldingRegistersResponse
Returned base register (120) does not match that from request (0).
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
Did not receive expected response type: ReadHoldingRegistersResponse != ReadInputRegistersResponse
From v2.x onwards the integration uses a newer (but unreleased) version of the givenergy_modbus
code. If you're running a standalone debug script against the library, you're using the old code. There were a few teething issues with early 2.x versions, but these seem largely resolved for everyone else now.
The debug logs certainly suggest the inverter isn't responding within a timely manner. I can see each request is hitting the 1 second timeout before being attempted a couple more times.
Nothing else trying to read data in parallel? Sometimes I've seen that cause problems.
Does it work any better against v1.9.1?
You could also try a tweak to this line to add a timeout=2.0
(or similar) to extend the timeout of individual requests. Though in my experience, either you get a response in <200 milliseconds, or not at all. This timeout value can't be too large - if the total time to perform a refresh exceeds 10 seconds, you'll hit another timeout.
Thanks for responding @cdpuk . I have downgraded to 1.9.1 as you suggested, and it's perfect - no unavailable periods on any entities. Looking at the givenergy_modbus
repository, it seems that the responses I was seeing when using the library directly are unfortunately expected and need to be worked around.
FWIW, my inverter updated to newer firmware last week and that immediately fixed this issue issue. According to the changelog this isn't even the most recent firmware (no idea what's going on there), but at least it's fixed.
I suspect this issue was something to do with the inverter, since I get regular timeouts even when going via https://givenegy.cloud
Great to hear. I get the feeling there must be some underlying design problems that GE seem to be fighting with, and this seems to manifest itself in connection reliability issues every now and then.
Hardware and versions
Describe the bug
I've noticed that the entity statuses will become unavailable for 10-20 seconds every 2-3 minutes. This does not appear to be related to dropouts in the inverter connectivity - running a continuous ping to the inverter does not show any loss of connectivity or increased latency during the periods when the entity statuses become unavailable.
Debug log
I have tried tweaking the interval up to 30 seconds as mentioned in issue https://github.com/cdpuk/givenergy-local/issues/76 but this has had no effect.