The LSW-3 series of wifi loggers allow external programs to perform MODBUS queries via a TCP connection port 8899. I believe this is a variant of the MODBUS/TCP protocol that is assigned TCP port 502.
To perform MODBUS queries, I used pysolarmanv5. To connect to the logger pysolarmanv5 requires the logger serial number and IP address. Initially I read the serial number off the label of the logger, and looked up the IP address from the admin page of my router. Later I noticed solarman_scan.py, which sends a broadcast UDP packet which the data logger replies to. I sometimes had to run it more than once before the logger responded to the scan packet.
The Solis 4G-US series inverters are Sunspec MODBUS certified, and have the well-known 32-bit ‘SunS’ identifier (0x53756e53) at address 40001. This means it should be possible to read the registers by decoding the SunSpec information models and inverter device IDs. SunSpec shares some example code, however I haven't been able to figure it all out.
I couldn't figure out the Solis registers using SunSpec, but I was able to find the register documentation from Ginlong. The AC output power and DC input power are 32-bit registers at address 3005 using MODBUS function code 4 (input registers). I wrote a python program to read the output and input power and calculate the efficiency. It also reads the inverter temperature, and outputs the data every 5 minutes. I also wrote a small AWK program to calculate the weighted average of multiple samples. The code can be found in my github repo.
Over multiple days of output in the spring of 2023 including sunny and cloudy days, I observed an overall efficiency of 94% for a Solis 1P4K-4G-US. For a Solis 1P6K-4G-US I observed an average efficiency of 95%. This compares to respective advertised CEC weighted efficiencies of 97.5% and 97.0%.