wills106 / homeassistant-solax-modbus

SolaX Power Modbus custom_component for Home Assistant (Supports some Ginlong Solis, Growatt, Sofar Solar, TIGO TSI & Qcells Q.Volt Hyb)
315 stars 98 forks source link

[Bug]: 'Solis' - TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType' #886

Closed simondrake closed 6 days ago

simondrake commented 4 months ago

Describe the bug

Intermittently, the integration will stop and all the entities will zero out. Reloading the integration usually seems to fix it, so it sounds like a HA/integration issue as opposed to a inverter/modbus issue.

I've looked through the existing issues, and I don't think this is the same as some of them which have been reported.

Integration Version

2024.05.2

Homeassistant core version

2024.5.2

Inverter brand

Solis

Plugin used

plugin_solis.py

Serial prefix

603105

Connection Method

USR-TCP232-304 Serial RS485 to TCP/IP Ethernet Server Converter Module

Detailed Error Log

Logger: custom_components.solax_modbus
Source: custom_components/solax_modbus/__init__.py:615
integration: SolaX Inverter Modbus ([documentation](https://homeassistant-solax-modbus.readthedocs.io/), [issues](https://github.com/wills106/homsassistant-solax-modbus/issues))
First occurred: May 8, 2024 at 7:49:33 PM (1026 occurrences)
Last logged: 10:03:27 AM
Something went wrong reading from modbus

Traceback (most recent call last):
  File "/config/custom_components/solax_modbus/__init__.py", line 615, in async_read_modbus_data
    res = await self.async_read_modbus_registers_all(group)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solax_modbus/__init__.py", line 794, in async_read_modbus_registers_all
    self.data[descr.key] = descr.value_function(0, descr, self.data)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solax_modbus/plugin_solis.py", line 134, in value_function_pv1_power
    return  datadict.get('pv_voltage_1', 0) * datadict.get('pv_current_1',0)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType'

Additional context

No response

simondrake commented 3 months ago

@wills106 - Is this a known issue (I did look through previous issues)?

The frequency of this issue seems to be multiple times a day now.

Not 100% sure if this is an issue with the integration or the modbus box.

wills106 commented 1 week ago

Have the newer Integration versions resolved this issue?

simondrake commented 6 days ago

@wills106 - I had an automaton that automatically reloaded the integration, but I turned it off and I've not seen the issue for over 24 hours so I would say so.

Thanks very much!