Hi Johan,
when the inverter is off, I have a lot of these in the logs. Obviously I expect connection errors, but I think there’s some other issues. Hope it helps.
2021-06-17 01:04:39 ERROR (MainThread) [custom_components.sunspec] Socket write error: [Errno 32] Broken pipe
2021-06-17 01:04:42 ERROR (MainThread) [custom_components.sunspec] Unexpected error fetching sunspec data: Connection error: [Errno 113] Host is unreachable
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/modbus.py", line 515, in _read
self.socket.sendall(req)
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/sunspec/__init__.py", line 118, in _async_update_data
data[model_id] = await self.api.async_get_data(model_id)
File "/config/custom_components/sunspec/api.py", line 88, in async_get_data
return await self.read(model_id)
File "/config/custom_components/sunspec/api.py", line 91, in read
return await self._hass.async_add_executor_job(self.read_model, model_id)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sunspec/api.py", line 126, in read_model
model.read()
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/client.py", line 85, in read
data = self.model.device.read(self.model.model_addr + self.offset, self.len)
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/client.py", line 317, in read
return self.client.read(addr, count, op)
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/modbus.py", line 584, in read
data = self._read(addr + read_offset, read_count, op=op)
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/modbus.py", line 517, in _read
raise ModbusClientError('Socket write error: %s' % str(e))
sunspec2.modbus.modbus.ModbusClientError: Socket write error: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/modbus.py", line 481, in connect
self.socket.connect((self.ipaddr, self.ipport))
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/sunspec/__init__.py", line 123, in _async_update_data
self.api.reconnect()
File "/config/custom_components/sunspec/api.py", line 108, in reconnect
client.connect()
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/client.py", line 308, in connect
self.client.connect()
File "/usr/local/lib/python3.8/site-packages/sunspec2/modbus/modbus.py", line 483, in connect
raise ModbusClientError('Connection error: %s' % str(e))
sunspec2.modbus.modbus.ModbusClientError: Connection error: [Errno 113] Host is unreachable