Integration Solar inverter huawei 2000L

I just want to add that you don’t need a VLAN for this (it is of course nice to have but not every one have a managable switch in a house) - any router which have two interfaces - one for SUN2000 and the other for the rest of your home network should handle this.
You need to use a NAT for this - as the SUN2000 is exposing it’s own DHCP and it is “talking” only to a client which get a single address from it in network 192.168.200.0/24.
It can be done using OpenWRT, DD-WRT or whatever is capable of this. There are some tricks however to make it properly:
https://skyboo.net/2021/07/how-to-connect-to-sun2000-from-dd-wrt/

1 Like

Is there any chance you could provide a small tutorial how you did setup Openwrt? I have an old TP-Link access point where I installed Openwrt, but I can not get the connection from my home network to the inverter going. I can connect to the WLAN of the inverter and I can of course connect to my home network, but the network bridge part just doesn’t work. Any help here would be greatly appreciated!

I think it should not differ much from my “tutorial”. First of all you need to make sure that your OpenWRT successfully connects using WiFi to the inverter. If it gets the IP address in network 192.168.200.x then you’re a good to go.
One think you need to know is you need to disable bridge between your home LAN and a wifi Interface! Then you are using a NAT rules to expose the SUN2000 port to your home network.

1 Like

Unfortunately, it does differ. I have tried to follow your tutorial, but this doesn’t work in Openwrt. So I would really really appreciate if someone how has used Openwrt would provide a hint.

This part I did get to work. It’s the NAT part that doesn’t work on my end.

In this case just login eg. using telnet/ssh to your openwrt and add the iptables rules (adjusting) your addresses, eg:

iptables -I PREROUTING -t nat -p tcp -d 192.168.1.250 --dport 6607 -j DNAT --to-destination 192.168.200.1:6607
iptables -I POSTROUTING -t nat -d 192.168.200.1 -p tcp --dport 6607 -j MASQUERADE

Where 192.168.1.250 is the address of your router in your LAN.

Then you are connecting in HA to 192.168.1.250:6607 and it is transposing it using NAT to the inverter.

2 Likes

Thank you! Finally all is clear to me! Just a “final” question about your setting. You say that you use internal inverter wifi to use TCP modbus… The question is: do you also use Huawei cloud? Is it useful in some way or we can totally get rid of it? What is your suggestion about?

This part I also tried. But it didn’t work…

@Veletax : I would really appreciate if you could provide some hints how you set it up in Openwrt.

Thks, now I can see it, 12 hours after… no explanation…

Hello again, so I bought this mini router WR802. I did the following :

1- configured it as “client mode”.
2- Select the AP of the inversor, put the password (wrote on the inversor by default)
3- chose “static IP” in order to configured it on the same kind of IP than the invertor ( 192.168.200.XX)
4- as the invertor is 192.168.200.1, I put for the mini router the following IP : 192.168.200.2
5- reboot and refresh

In Home assistant, while configuring the integration Huawei solar, I’m still have the same error messsage (Failed to connect).

I m not able neither to ping the 192.168.200.1 / 192.168.200.2
I’m not able to go in the mini routeur configuration page (Which should be 192.168.200.2 I guess…).

Any idea of what I did wrong ? sure that will be helpful for other newbie :rofl:

Many thanks!!!

Ok. I tried it again this morning. It seems as if I’m one step further. If I now try to read the inverter name using python then it returns the error message “could not read register value, is an other device already connected?”. Previously, I always received a connection failed message. So somehow it now seems to connect, but what other device could be blocking the access? Do I have to disconnect the dongle? The HA integration is of course not connected anymore.

Dear Manio, I would like to differ :

You don’t need a dongle for connecting to the portal…huawei made sure they can monitor you…

But indeed, if you are connected to the inverter AP , the connection to the portal drops…

So if you want have data from the inverter and use the portal at the same time, you will need the dongle.

Hi!

I have a similar problem as @ffm777.

I have ping to 192.168.200.1. The 6607 port is open, and the slave device ID is 1. (I have tried with 0, with the same result). The connection is done, but, it reports “Reading from the inverter failed”. Logs say the following:

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:227
First occurred: 12:21:38 (2 occurrences)
Last logged: 12:21:48

could not read register value, is an other device already connected?

Logger: pymodbus.client.asynchronous.async_io
Source: /usr/local/lib/python3.9/site-packages/pymodbus/client/asynchronous/async_io/init.py:307
First occurred: 12:21:00 (19 occurrences)
Last logged: 12:21:53

Failed to connect: [Errno 111] Connect call failed (‘192.168.8.200’, 6607)

➜ ~ nmap -v -p 6607 192.168.200.1
Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-20 12:15 CET
Initiating ARP Ping Scan at 12:15
Scanning 192.168.200.1 [1 port]
Completed ARP Ping Scan at 12:15, 0.13s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 12:15
Completed Parallel DNS resolution of 1 host. at 12:15, 3.02s elapsed
Initiating SYN Stealth Scan at 12:15
Scanning 192.168.200.1 [1 port]
Discovered open port 6607/tcp on 192.168.200.1
Completed SYN Stealth Scan at 12:15, 0.05s elapsed (1 total ports)
Nmap scan report for 192.168.200.1
Host is up (0.027s latency).

PORT STATE SERVICE
6607/tcp open unknown
MAC Address: 6C:44:2A:11:EC:B0 (Huawei Technologies)

Read data files from: /usr/bin/…/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 3.79 seconds
Raw packets sent: 2 (72B) | Rcvd: 2 (72B)

Nobody except the Raspberry Pi 3 I am using is connected to the inverter WiFi.

Any hints? Thanks!

This is why I immediately downgraded the firmware back to 115 after the update…I couldn’t get it to work neither on the new firmware 117

1 Like

The inverter has its own detailed database apparently , which the portal can download, as I just noticed :

The inverter wasn’t connected to the portal for a while (my intention), but once it connects again, history data starts to show up.

I’m definetly interrested to retrieve this data from the inverter…

Hello… I see in fusionsolar the possibility to change the WiFi iP address.
My home network has 192.168.1.x
The inverter has 192.168.200.1

I could manually change it.
I have change it to 192.168.1.100

And it was possible to have modbus communication on port 6607
With a router as a WiFi repeater (repeating inverter WiFi) … And a lan cable from lan side to my main router.

But, when the sun goes down… I lost communication. And today after the inverter goes On-grid… Still closed the 6607 port

And now… I’m not being able to Commissioning inverter with Fusionsolar.

Anyone help?

Probably it’s because you have now 2 dhcp servers active on 192.168.1.x : Home and Inverter.
And your home router is also found on 192.168.1.1 ?
Unplug your homenetwork from the socket and try again.

The home router is 192.168.1.254
The repeater is .1.1 (dhcp disabled)
The inverter. 1.100

Can the internal inverter WiFi be a client?

Yes, that’s how its connecting to the portal in my setup

“The repeater is .1.1 (dhcp disabled)”

The app is trying to connect to 1.1 …

Quick update from my side: I now managed to setup Openwrt so that I can connect to the inverter via the TP-Link router using python with the following commands:

>>> inverter = huawei_solar.HuaweiSolar('192.168.178.30',6607)
>>> inverter.get("model_name")

The inverter does report back the inverter name. So far so good. However, I cannot setup the HA component using the IP and port from above. When I enter the data into the configuration window and hit “submit” then I get the following message:

The log shows the following error message:

Does anyone have an idea why I can connect to the inverter in python but the component fails?

Quick follow-up: I think connecting directly to the inverter via its internal Wifi doesn’t work with cascaded inverters. With the direct connection to the inverter, one can only read data from this specific inverter and not from a cascaded one. That would require a separate connection (and of course a modified integration which could support multiple IPs)…

2nd follow-up: It is indeed as described above. With the direct connection to the inverter Wifi I can use the integration only with slave id 0 and get data only from this specific inverter. It is not possible to read data from the cascaded inverter. So I would need a second router to connect to the second inverter Wifi directly… What a mess…