Hello everyone and happy christmas!
First and foremost: congratulations for the outstanding work @Emilv2 ! really great component and library: easy to read and comprehensive; thank you so much!!
As you might imagine, I’m the owner of yet another SUN2000-5TKL L1 (the SUN2000L I believe!) and have been trying stuff on how to integrate it to my domestic Home Assistant. So far I’ve reached similar conclusions to the different described by jaslo in post 136 (sorry I can only refer two users and two links in a post). I would point out, though, that there is yet another way to gather information, by using the upload functionality of the inverter to huawei’s cloud.
I’ve been having problems trying to have the integrated wlan (not the internal, but the “external” one, that connects to my home wifi) together with the ethernet dongle, as a way to have other means to access the TCP Modbus. It seems so far not to be compatible; for some reason, when we get both to work, the RS485 connection to the power meter (gavazzi E112) stops working all together… go figure.
Roaming the internet for that and other issues, I came up with some interesting links:
The second link led me to believe that, what the inverter is doing on connecting to the fusionsolar.huawei.com Management System server, is opening a TCP channel for a Modbus TCP connection. It is a “reversed” scheme from the regular: in which the Master acts as a TCP server (instead of the usual TCP client) to which the different Slaves connect to as clients (instead of acting as TCP servers). This is not the first time I see one of this schemes, is pretty common whenever you have to deal with ECG-NAT for SIM based connections.
This could lead us to have yet another alternative way of tapping into the TCP modbus stream, even perhaps keeping the original connection with Huawei’s Management System by proxying those requests, or creating a modbus map replica locally, so that Huawei can read from.
For now, I’m using socat to proxy the connection between my inverter and huawei, and check that the assumption is right, even check what and how is being read from the inverter by huawei.
In other order of business, looking at Emil’s code, I can see that the different parameters form the inverter, are read as individual calls. I think some work could be done to improve latency and throughput, by reading large chunks of information all at once, keeping those chunks stored locally and then splitting those into individual parameters upon request. If there is interest in that regard, I could provide some help in doing it .
And I think that’s all for now!
Best regards and happy christmas!