StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
510 stars 190 forks source link

Sofar 8.8KLT-X - all entities unavailable #215

Open darth-aragoth opened 1 year ago

darth-aragoth commented 1 year ago

Integration (sofar_lsw3.yaml) worked for a long time, but after last update all entities became unavailable. In logs I see warnings and errors:

Logger: custom_components.solarman.solarman
Source: custom_components/solarman/solarman.py:175
Integration: Solarman ([documentation](https://github.com/StephanJoubert/home_assistant_solarman/blob/main/README.md), [issues](https://github.com/StephanJoubert/home_assistant_solarman/issues))
First occurred: 12:14:21 (94 occurrences)
Last logged: 12:31:52

Querying registers [261 - 276] failed, aborting.
Logger: homeassistant.helpers.entity
Source: custom_components/solarman/solarman.py:234
Integration: Solarman ([documentation](https://github.com/StephanJoubert/home_assistant_solarman/blob/main/README.md), [issues](https://github.com/StephanJoubert/home_assistant_solarman/issues))
First occurred: 12:27:14 (81 occurrences)
Last logged: 12:31:52

Update for sensor.solarman_pv1_power fails
Update for sensor.solarman_pv2_power fails
Update for sensor.solarman_pv1_voltage fails
Update for sensor.solarman_pv2_voltage fails
Update for sensor.solarman_pv1_current fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 548, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_device_update
    raise exc
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/solarman/sensor.py", line 140, in update
    self.inverter.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 190, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/solarman/solarman.py", line 175, in update
    self.get_statistics()
  File "/config/custom_components/solarman/solarman.py", line 234, in get_statistics
    sock.close()
UnboundLocalError: local variable 'sock' referenced before assignment

I rolled back to v1.4.1 and entities are available again.

maslyankov commented 10 months ago

For me this issue was due to wrong modbus mapping config selected.