Reading data from Huawei inverter SUN 2000 (3KTL-10KTL) via modbus TCP and RTU

Nope. Are we talking hours or minutes?

Editing Things files is a “legacy” technique really (even though it is more practical for us when dealing with Modbus, than PaperUI) and is not expected to be very “dynamic”.
Bear in mind that because of polling, the binding would need to cancel and stop scheduled independent poller jobs and build new ones to incorporate changes.
In particular, small edited changes to text Things (rather than wholesale additions and deletions) can be missed.
Standard advice is to restart the Modbus packages after editing, both to ensure new changes are picked up and old ones taken out.

It’s the openHAB framework that detects when a xxx.things file has been edited and needs working with. I believe it uses a file watcher, with a default period of 5 seconds or so from some setting somewhere. You get a message in your openhab.log when a file change has been spotted. Sometimes more than one, if whatever editor you are using saves in stages.

Hi thanks for the info,
but there be some delays for a long time before some change come visible in paperui
i think this come like you expalined from different basic delays in the base system.

I see the same delays when i update html page that i use in habpanel widgets.
When i inspect these widgets in the browser, it takes a while befoe the last version is used.

So it can also be a browser relate delay.

Regards
Ronny

Hi,

I’ve read this information, using the SmartLogger 3000 (I think the other smartlogger can work too), with modbus tcp.
With this, I can read, the smartlogger information, the meter information and the inverter information. If anyone wants the modbus configuration, please tell me.

Best Regards,
Fernando Gomes

Hi,
reading the data from my Huawei SUN2000 17KTL-M0 is working perfect. But the inverter shuts down at night to save energy. So the Modbus-Binding spams to the logs because it can’t read data. Is there a way to stop this?

Hello,

When there is no sunlight my inverter goes to status No irradiation.
And i dont get these logs that say can’t read data.
Does yours go to the same status when there is no sunlight?
But he always reads E-total and E-day also when there is no sunlight.

Methods shown here to cease polling can be adapted

1 Like

Hi Rado1, great post!

I Have a SUN2000- 4KTL-L1, I’m totally new on this items.

Do your have newby proof tutorial how to set this up on a Raspberry Pi?

Hello Tony,

Welkom to the community.
I think you better start with installing openhabian on a sd card.


And go from there. If you read the doc’s you will come al long way.

If it doesn’t work you can always ask here on the forum according to your problem if you have problems with the configuration of the inverter let me know.

1 Like

Thanks for the feedback, meanwhile i have installed the whole setup, only waiting on a USB to RS485 dongle to finisch the installation.

1 Like

Hi, i have installed the whole setup, where can you check if there is any data transfer on the serial connection.

Kind regards,
Tony

Hello the cable blinks red and green when communicating.In paper ui all the modbus things should be green online.

Hi Levi,

Thanks for the info, now i can read soms info from the invertor! I have missed the modbus thing in the openhab.

Tnx

Tony

Hi Guys,

I don’t have this kind of inverter but hopefully will have a SUN2000-8KTL-M0 in a few months. So I haven’t got a chance to see an inverter in real life.
I would like to connect to the inverter via wifi dongle and modbus tcp. Is it working or just with cable?
How will I get the numbers for the poller bridges (start, lenght)? How will I know which data can I get from the inverter?
I want to keep the data in local network and not use huawei api.

Thanks

It does, there is no need for extra hardware connected to your inverter. Some models will only accept TCP connections when connected to the wifi AP, but others will accept connections from your router. The models that only accept TCP modbus connections through the AP are the SUN2000L and the ones that accept connections through the client are SUN2000L I think.

I have a Python package for Home Assistant that does the TCP modbus connections: Emil Vanherp / HuaweiSolar · GitLab

Emilv2 you can update information step by step how install you TCP modbus connections project to Home Assistant?

First of all, many thanks for sharing the know how here in the community.
I connected my SUN2000-(3KTL-10KTL)-M1 via a serial modbus USB-RS485-WE-1800-BT

I had issue to get serial modbus working stable but i got a fix from the modbus binding team resolving the OH3 issues with serial.
I am still struggling with stability as i by far get to much CRC error and re-try.
My cable is 1.8m long, so i would guess it should not be a big issue.

Here a few question i am still working on:

  1. I saw that some inverter also support modbus tcp connections through the WLAN / ethernet dongle. Emilv2 has mentioned it. Is there any official statement from Huawei which model are supported or do you know which inverter model would support it? Or maybe a step by step tutorial?
  2. I am trying to indicate the startup and shutdown time. The time is coming as a integer. Do you have a working transformation to transform the integer to a Datetime format on the item?
  3. i do also get error messages from the binding when the inverter is shutting down. What would be the best way to gt ride of these? Is it possible to offline the things based on some information from the inverter in a rule?

cheers

Hello,

I also have a SUN2000-(3KTL-10KTL)-M1 and i never managed to connect them by TCP.

You can use %s as transformation for date time.

Number  Start_up_time       "Start up time [%s] "                                                                                                 { channel="modbus:data:slave100:slave105holding:Start_up_time:number" }
Number  Shutdown_time    "Shutdown time [%s] "                                                                                                    { channel="modbus:data:slave100:slave105holding:Shutdown_time:number" }

You have to remove the wifi or ethernet module of de inverter and reboot openhab and the crc error’s would be gone.i have not been able to solve this yet i have already pulled a shielded cable and bought an ethernet module but if i plug in all 2 i get errors.

So i am not working with de huawei dongle.
I do have a battery now (luna 2000 huawei) i will update de modbus config with battery storage soon.

Greetz

many thanks for the responds.
i unplugged the Dongle and see how stable the stuff is.
maybe it makes sense to get support from Huawei. I will try to make a feedback on the support line and share info

I implemented the transformation and get 2021-04-08T08:11+02:00
When i lookup the startup time in the fusion app from huawei i do get 7:11 .
so i guess the string represents UTC plus the daylight saving time.

any good way to make the transformation presenting the time in my actual time?
if i use [%1$tR] i do get 8:11, which does not include the day light saving.

You can switch daylight saving time off when you log in to the inverter or change the time of the inverter.

I am not sure if this applies with the dongle discussed here but it certainly applies to generic serial-ethernet converters.

These converters introduce tcp fragmentation (modbus message is not aligned to tcp packets, meaning that one message might spread to two tcp packets)

Turned out fairly recently that tcp fragmentation is not handled properly in the modbus library used by the binding. Fix is still pending merge, but you can access it already here.

It would show up as crc errors in logs.

See github pr Changed read to readFully in TCP transports to get rid of fragmented packets by denis-ftc-denisov · Pull Request #11 · openhab/jamod · GitHub

It might even possible to patch the library with the fixed jar (jamod library, that is “net.wimpi” package)