wills106 / homeassistant-solax-modbus

SolaX Power Modbus custom_component for Home Assistant (Supports some AlphaESS, Growatt, Sofar, Solinteg, Solis, SRNE, Swatten)
317 stars 101 forks source link

[BUG] Polling stops over night and sometimes every 4-6h #106

Closed tremmer99 closed 2 years ago

tremmer99 commented 2 years ago

Describe the bug Every 4-6h hours and always overnight polling stops and I have to restart home-assistant to be working again.

Mandatory details

  1. Integration version: 0.6.0b4
  2. HA version: 2022.8.1
  3. First 4 digits of Serial: H34T
  4. Connection Method: Modbus via Waveshare TCP/Modbus

Detailed Error Log no error i guess

wills106 commented 2 years ago

Have you managed to try it out? Did the issue go away? Or did it just error on another register instead?

tremmer99 commented 2 years ago

Just updated today - keep you updated - thank you!

tremmer99 commented 2 years ago

Stalled again - 4 errors:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.solax_modbus Source: custom_components/solax_modbus/init.py:363 Integration: SolaX Inverter Modbus (documentation, issues) First occurred: 23. August 2022, 18:43:43 (2 occurrences) Last logged: 05:41:16

Something went wrong reading from modbus Traceback (most recent call last): File "/config/custom_components/solax_modbus/init.py", line 319, in read_modbus_data return self.read_modbus_holding_registers_0() and self.read_modbus_holding_registers_1() and self.read_modbus_holding_registers_2() and self.read_modbus_input_registers_0() and self.read_modbus_input_registers_1() and self.read_modbus_input_registers_2() File "/config/custom_components/solax_modbus/init.py", line 363, in read_modbus_holding_registers_1 firmwareversion_modbustcp_major = decoder.decode_16bit_uint() File "/usr/local/lib/python3.10/site-packages/pymodbus/payload.py", line 402, in decode_16bit_uint return unpack(fstring, handle)[0] struct.error: unpack requires a buffer of 2 bytes

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.solax_modbus Source: custom_components/solax_modbus/init.py:374 Integration: SolaX Inverter Modbus (documentation, issues) First occurred: 23. August 2022, 16:30:27 (1432 occurrences) Last logged: 08:26:01

Something went wrong reading from modbus Traceback (most recent call last): File "/config/custom_components/solax_modbus/init.py", line 319, in read_modbus_data return self.read_modbus_holding_registers_0() and self.read_modbus_holding_registers_1() and self.read_modbus_holding_registers_2() and self.read_modbus_input_registers_0() and self.read_modbus_input_registers_1() and self.read_modbus_input_registers_2() File "/config/custom_components/solax_modbus/init.py", line 374, in read_modbus_holding_registers_1 rtc_seconds = str(decoder.decode_16bit_uint()) File "/usr/local/lib/python3.10/site-packages/pymodbus/payload.py", line 402, in decode_16bit_uint return unpack(fstring, handle)[0] struct.error: unpack requires a buffer of 2 bytes

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.solax_modbus Source: custom_components/solax_modbus/init.py:383 Integration: SolaX Inverter Modbus (documentation, issues) First occurred: 23. August 2022, 18:44:13 (1195 occurrences) Last logged: 08:26:16

Something went wrong reading from modbus Traceback (most recent call last): File "/config/custom_components/solax_modbus/init.py", line 319, in read_modbus_data return self.read_modbus_holding_registers_0() and self.read_modbus_holding_registers_1() and self.read_modbus_holding_registers_2() and self.read_modbus_input_registers_0() and self.read_modbus_input_registers_1() and self.read_modbus_input_registers_2() File "/config/custom_components/solax_modbus/init.py", line 383, in read_modbus_holding_registers_1 self.data["rtc"] = datetime.strptime(date_string, '%d/%m/%y %H:%M:%S') File "/usr/local/lib/python3.10/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/local/lib/python3.10/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '00/00/00 00:00:02' does not match format '%d/%m/%y %H:%M:%S'

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.solax_modbus Source: custom_components/solax_modbus/init.py:718 Integration: SolaX Inverter Modbus (documentation, issues) First occurred: 23. August 2022, 18:43:58 (1196 occurrences) Last logged: 08:26:31

Something went wrong reading from modbus Traceback (most recent call last): File "/config/custom_components/solax_modbus/init.py", line 319, in read_modbus_data return self.read_modbus_holding_registers_0() and self.read_modbus_holding_registers_1() and self.read_modbus_holding_registers_2() and self.read_modbus_input_registers_0() and self.read_modbus_input_registers_1() and self.read_modbus_input_registers_2() File "/config/custom_components/solax_modbus/init.py", line 718, in read_modbus_holding_registers_2 disch_cut_off_point_different_s = decoder.decode_16bit_uint() File "/usr/local/lib/python3.10/site-packages/pymodbus/payload.py", line 402, in decode_16bit_uint return unpack(fstring, handle)[0] struct.error: unpack requires a buffer of 2 bytes

wills106 commented 2 years ago

I think you are having some communications error. It's just failing on the previous / next set of registers after the ones I have blocked out.

tremmer99 commented 2 years ago

Is it possible to integrate a wait for 2-5 seconds and retry or something like this if it fails to pull a former working register?

infradom commented 2 years ago

I am more and more convinced that you have a wiring/communication problem. I have a H34T running for almost a year without any communication problems of this kind. The length of the serial cable between solax and waveshare is in my case around 12 meter. The waveshare settings may also play a role (see the Wiki page for my waveshare settings).

wills106 commented 2 years ago

Closing due to no further reports of this issue / feedback.