solaredge-modbus-multi
solaredge-modbus-multi copied to clipboard
TODO: Research how async timeout context interacts with pymodbus timeout
Research how async timeout context for reads added in PR #820 interacts with pymodbus timeout and retries. Adjust the async context timeout if needed.
Feedback should be added to this issue. To adjust the timeout value, edit file const.py and adjust the value of Read = 6000 in class SolarEdgeTimeouts(IntEnum) then restart Home Assistant. If the affected entities are going unavailable too often, try a value of Read = 9000.
https://github.com/WillCodeForCats/solaredge-modbus-multi/blob/d7026ef709ca2e6efad2c358d1d8e0543266fce0/custom_components/solaredge_modbus_multi/const.py#L87
May need to disconnect and reconnect to the modbus device if a context timeout is triggered, or enable pymodbus built in reconnect.
Reconnect in pymodbus was disabled intentionally in PR #360 but that was many versions past and it should probably be tested to see if it works with current versions of pymodbus.
Testing with the following settings in configuration.yaml:
solaredge_modbus_multi:
modbus:
reconnect_delay: 1.0 # Minimum in seconds.milliseconds before reconnecting.
reconnect_delay_max: 16.0 # Maximum in seconds.milliseconds before reconnecting.
Pymodbus 3.9 raises ModbusIOException in an asyncio timeout context. See PR #864