It seems after moving from requests-async to the httpx library, gathering inverter data sometimes fails.
The httpx documentation says The protocol was violated by the server. While I've seen a reference to this occurring when the endpoint is overwelmed. In my case, I don't think it is the latter, as I was not seeing this issue when using the requests-async library.
In any case, I have added a retry mechanism when getting inverter data. If after 3 retries we still get the same httpx.RemoteProtocolError, than the library will raise the exception. When using the library in Home Assistant the retry will hopefully minimize the values sometimes bouncing from a value to 0/None/Unavaiable back to a value. On my Envoy running firmware D3.15.7, the Protocol error does not occur on the second retry.
It seems after moving from requests-async to the httpx library, gathering inverter data sometimes fails.
The httpx documentation says
The protocol was violated by the server.
While I've seen a reference to this occurring when the endpoint is overwelmed. In my case, I don't think it is the latter, as I was not seeing this issue when using therequests-async
library.In any case, I have added a retry mechanism when getting inverter data. If after 3 retries we still get the same
httpx.RemoteProtocolError
, than the library will raise the exception. When using the library in Home Assistant the retry will hopefully minimize the values sometimes bouncing from a value to 0/None/Unavaiable back to a value. On my Envoy running firmware D3.15.7, the Protocol error does not occur on the second retry.