Integration Solar inverter huawei 2000L

Great to hear that you are actively working on the integration. Do you think that there is a way to extract data from 2 inverters? My inverters are slave 1 and 16, but the existing integrations can only read data from 1 inverter. I’m currently using a mix of the integration from this thread and the kiosk integration, but being able to read data from both inverters would really be great.

I’m not familiar with how two inverters are interconnected with each other.

What I do know is that it is possible to configure the modbus unit to which requests are sent by setting the 4th parameter in the configuration screen to the proper number:

image

With 2 inverters, one inverter is the master and the other the slave. The dongle is plugged into the master inverter (and in my case also a battery is plugged into the master inverter). So it is possible to reach both inverters via Modbus TCP of the dongle on a single IP address. In my case when connecting to 192.168.20.190:502 with a slave id of 1, I get the data from the second inverter (the slave). When I connect to 192.168.20.190:502 with a slave id of 16, then I get the data from the master inverter. The data from the master inverter also includes the data from the smart meter and the battery. I would really love to dig into the code, but I’m not familiar with Python at all…
One question in that regard: Is the slave id necessery to initialize the connection to the modbus interface of the dongle? Or does the integration connect with the IP and the port and then just listens on that port for any information that is published (which in the case of 2 inverters would mean that data from both inverters is published and could therefore be used with a single connection)?

It’s the default value, just in case the provided value is not parseable

Yupe, just noticed this… and seems in the newest firmware (SPC140) the ModBus port for internal AP has changed from TCP/502 to TCP/6607…

>>> import huawei_solar
>>> inverter = huawei_solar.HuaweiSolar('192.168.200.1', port=6607, slave=0)
>>> inverter.get("system_time").value
datetime.datetime(2022, 1, 13, 20, 53, 29, tzinfo=<UTC>)
1 Like

I have tried your integration and Emilv2’s and I’m not yet being able to configure the Energy dashboard correctly.
I have some sensors available but some others (defined in the same yaml) not, it is a very frustrating process.
I’ll give yours another try before giving up.

Hi again trying to get this working .

But getting many error message on connecting to inverter ?

This error originated from a custom integration.

Logger: custom_components.huawei_solar.sensor
Source: custom_components/huawei_solar/sensor.py:185
Integration: huawei_solar (documentation)
First occurred: 12 January 2022, 14:14:17 (1 occurrences)
Last logged: 12 January 2022, 14:14:17

could not connect to Huawei inverter: failed to connect to device, is the host correct?

But when im using nmcli con show i can see that its connected but still getting thoose errors ??

Logger: pymodbus.client.asynchronous.async_io
Source: /usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/__init__.py:307
First occurred: 15:41:17 (9 occurrences)
Last logged: 15:41:47

Failed to connect: [Errno 111] Connect call failed ('192.168.200.1', 502)
Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:416
First occurred: 15:41:22 (1 occurrences)
Last logged: 15:41:22

failed to connect to device, is the host correct?
NoneType: None

I have SPC 124 on the dongle and SPC140 on the inverter could that be any problem ??

Anyone else that having this kind of trouble ?

It was posted yesterday.

is there any way to change the port back to old ?
have you managed to get this working ??

is there a fix on its way do you know that ?

You can go back to older firmware or you can edit file huawei_solar.py (src/huawei_solar/huawei_solar.py · master · Emil Vanherp / HuaweiSolar · GitLab) it should be somewhere in your system and changing port to 6607. This file is used by this integration.

I have homeassistant OS so i cant find it by the file editor .

Is there any other way ?
im not that good on this

I often receive a warning like:
Update of sensor.sun2000_6ktl_l1_xxx is taking over 10 seconds
Is there any eventual configuration I could work on to speed up the updates? this is because I would like to have a more frequent update but if it is often overcoming 10 secs it’s impossible.
I’m wondering whether this slowness may depend from CPU, network, or other causes. Ideas?
Thanks.

If you want faster updates you should think about connecting directly to internal AP.

So, is it not solved by adding the integration 2 times: once with slave 1 and once with slave 16?

What is the problem that you are currently facing by doing it this way?

I made a Pull Request to Emilv2 repo for the “port=” parameter, but you can also manually update sensor.py file.

1 Like

best friends,

I finally managed to read the data from my HUAWEI inverter (in an unusual way ?).

HUAWEI 17KTL-M0 / V100R001C00SPC140
SDdongleA-05 / V100R001C00SPC123

I connected an ELFIN EW11A to the MODBUS.

pin 1 485A1-1 to connector A of the EW11A
Pin 2 485B1-1 to connector B of the EW11A

I was only able to make the connection after removing the dongle.

Now I actually still want to forward my data to the fusion solar cloud.
But I suspect that if I plug the dongle back,no more data goes to HA.
I don’t understand why I can’t do it via the dongle.

At V100R001C00SPC123 the MODBUS is on by default I understand.
If I install SPC124 or > I have to enable it via an android app according to the description.
I have an iPhone where the option to switch on modbus is not present… :unamused:.

According to the helpdesk of HUAWEI:
The modbus could be switched on via the fusion solar cloud at the end of the month…

Does anyone have any ideas for me to still get data to HA and Fusion Solar Cloud through the dongle?
I have no knowledge of this and managed it to read and try it out.
Your help is much appreciated

I do not understand it at all.
My configuration:

HUAWEI 17KTL-M0 / V100R001C00SPC140
SD dongleA-05 / V100R001C00SPC123
And I can’t get it done.
Is it the combination of the inverter firmware and the dongle firmware?
I have now temporarily solved it differently, but I am not satisfied with that solution.

In firmware V100R001C00SPC140 is changed port from 502 to 6607 so if you want connect to internal AP you can try to use MODBUS integration. In firmware V100R001C00SPC123 you should be able to connect via LAN and WiFi. But you have to remember that you must also add in config slave=1 or sometimes it also could be other number. And it only can be connected one device at the time.

I see update in @Emilv2 integration and now you can also specify port number when connecting to inverter internal AP.

Good morning,

The inverter has SPC140 and the Dongle has SPC123.

When I now log in to the inverter, I see that the port number is on port 502 (slave=1).
With the EWLINK I can connect to port 502 (slave=1) .
And it works with Emil V2.
So I guess the problem is with the dongle ?