Integration Solar inverter huawei 2000L

So your inverter is connected to your home wifi?

The inverter is connected to wifi via a smartdongle. The HA is connected via wifi to the built-in AP in the inverter. I cannot read the information. The FusionSolar Kiosk add-on has not worked for some time, huawei has changed something. I tried like some people to connect via the HA built-in modbus but I get this error.

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:203
Integration: Modbus (documentation, issues)
First occurred: 8:20:16 (1 occurrences)
Last logged: 8:20:16

Pymodbus: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer

Could you show your config (modbus and huawei_solar)? Do you have optimizers or battery? Iif you can ping inverter, then must be error in modbus config or something else is connected to internal AP. Do you have HA core or hassio?

The inverter is connected to the dtsuh666-h meter, and the HA that runs on the Rb4 hassio. It’s a setup:

sensor huawei:
  - platform: huawei_solar   
    host: 192.168.200.1
    optimizers: false
    battery: false

modbus:
  name: solar
  type: tcp
  host: 192.168.200.1
  port: 502

sensor:
  - platform: modbus
    scan_interval: 14400
    registers:
      - name: Solar Model name
        hub: solar
        register: 30000
        count: 15
        data_type: string

It should be:

sensor:
  - platform: huawei_solar   
    host: '192.168.200.1'

not

sensor huawei:

Settings for modbus integration seems to be OK. But do not use both at the same time. How did you check pings? Did you use Ping (ICMP) - Home Assistant

binary_sensor:
  - platform: ping
    host: 192.168.200.1

I have a ping from HA to the inverter. When I disconnect the communication between HA and the inverter, I get such a message

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.8/site-packages/huawei_solar/huawei_solar.py:174
First occurred: 21:05:59 (1 occurrences)
Last logged: 21:05:59

failed to connect to device, is the host correct?
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/huawei_solar/huawei_solar.py", line 172, in read_register
    response = self.client.read_holding_registers(register, length)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
    return self.execute(request)
  File "/usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py", line 108, in execute
    raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.200.1:502)]

I am still struggling with getting this component up and running, I am stuck at trying to bridge the connection between my inverters modbus, over my RPI and to HA. Not very skilled in RPI, Linux and Network so any newbie tips here would be much appreciated.

Another question though: Can this integration give me the individual Voltage and Current of the different PV strings connected to my system? (I have two installed). I want to see how they change over the course of the day individually.

Hi Rafał, How can I call u? my email kania.marcin(at)gmail.com

It seems i have found the issue. The time reset issue is from the inverter.
if you turn on the DST timezone or sync the time with ntp, there should be some minutes difference.
atm i’ve turn DST timezone off and put my zone +1. So now it will be reset at e.g. 23:01 instead of 00:01

Try pip install huawei_solar

Yes it can

3 Likes

That is great, thanks! Now I only need to figure out how to connect HA through my RPi and on to Modbus on my inverter.

1 Like

What is your inverter model number?

It is a SUN2000-10KTL-M1 and I have figured out so much that I need to connect to the modbus through the local wifi generated by the inverter. Since I am not running HA anywhere nearby the inverter I need to use a RPi as some kind of bridge between the inverter WiFi and my local LAN. I have my RPi set up with connection to the inverter WiFi and my local LAN. I just need to understand how I should configure the network routing on the RPi.

I have a SUN2000-5KTL-L1 and I used the Solar Fusion app to login and connect it to my wifi.
Then I checked my router to see what its IP address is and set that into HA.

Is your setup different, and why?

Hi guys, yesterday I installed HA on my raspberry pi4 on docker but I can’t see the battery data. Do you know why?

Schermata 2021-06-28 alle 10.59.35

AFAIK the different inverters have a bit different setup yes. I have a separate dongle on my inverter that connects to my home wifi and that is used for the Solar Fusion app data but the modbus is only available through the internal wifi setup from the inverter directly. But I will try once more to use the dongle-IP and see if this works.

EDIT: I get the below error when using the dongle-IP for my integration.
“pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] ModbusTcpClient(192.168.10.35:502): Connection unexpectedly closed 0.005144 seconds into read of 8 bytes without response from unit before it closed connection”

This seems to be similar to this issue here: Can't get your component to work ¡ Issue #6 ¡ Emilv2/huawei_solar ¡ GitHub

I get the same error if I try to use the add-on while the FusionSolar app is connected to the inverter, but I’m guessing your inverter is way different, because mine doesn’t have a wifi dongle, everything is built in.

Have a look and see if it displayed in the SUN2000 sensor attributes.

is not present among the attributes but if I try from cli:
Schermata 2021-06-28 alle 15.55.28