Integration Solar inverter huawei 2000L

Blockquote
PS: at this step, not able to ping the inverter through HA (I guess it’s normal)

You can’t ping inverter from HA right now, bcz port forwarding isn’t enabled yet. which we will do in next steps.

1 Like

ok done, I don’t have choice to setup the subnet mask but I guess this is automatic :

@trevee Now start Step 3

  1. Download and install the latest Winscp from WinSCP :: Official Site :: Download

  2. Run WinScp
    *select Scp as protocol.

    • login with your OpenWrt’s ssh credentials e.g
      image
    • accept the terms etc etc
  3. You will be presented with these windows with OpenWRT folders. In these folders/paths, you will find the files mentioned by @wlcrs in his GitHub page. Connecting to the inverter · wlcrs/huawei_solar Wiki · GitHub
    double click on three dots icons


    you will be presented with

  4. Navigate to the first file by double-clicking etc and then config. Here you will find all the three files “network” “wireless” and “firewall”

  5. double click on the “network” and copy-paste the following code at the end of the files. remember to set defaultroute '0" as mentioned in the github wiki.

config interface 'wlan'
        option proto 'dhcp'
        option defaultroute '0'

  1. repeat the process with “wireless” files by adding the following code to the end of the wireless file. changing according to your inverter’s AP’s Name and BSSID
config wifi-iface 'wifinet0'
        option key 'Changeme'
        option ssid 'SUN2000-HV0123456789'
        option device 'radio0'
        option mode 'sta'
        option bssid '94:25:33:12:34:56'
        option encryption 'psk2'
        option network 'wlan'
  1. Add the following code to the “firewall” file.
config zone
        option input 'ACCEPT'
        option name 'sun'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option masq '1'
        option network 'wlan'

config forwarding
        option dest 'sun'
        option src 'lan'

config forwarding
        option dest 'lan'
        option src 'sun'
  1. Copy the following code by @manio and modify it according to your inverter IP. Integration Solar inverter huawei 2000L - #1365 by manio and paste it in the network – firewall – custom rules.
iptables -I PREROUTING -t nat -p tcp -d 192.168.1.2 --dport 6607 -j DNAT --to-destination 192.168.199.1:6607
iptables -I POSTROUTING -t nat -d 192.168.199.1 -p tcp --dport 6607 -j MASQUERADE

it will look like this, but obviously, IP will be different

  1. save everything and restart your OpenWrt router.
  2. Ping from HA terminal and it will look like thisimage

And report back. for step 4 and 5.

1 Like

ok, so I put the rule on :

network => OK
firewall => OK
Custom rules => OK
Wireless => ?? i did it also with my SSID and BSSID but strange results.

After rebooted I got :

What do you think?

@trevee only use it with wifinet0

try pinging from HA now. It seems to be connected, but the link speed is low, move openwrt router closer to your inverter.

seems to loosing the connection :

but the BSSID that I put in wireless is the same than my mac adress of the WR802. Should I put the mac adress of the inverter as BSSID in the wireless file ?

In my configuration, it is the mac address of the inverter.

config wifi-iface 'wifinet0'
	option device 'radio0'
	option mode 'sta'
	option network 'wlan'
	option ssid 'SUN2000-HV2xxxxxxxx'
	option bssid 'C0:XX:XX:XX:XX'
	option encryption 'psk2'
	option key 'Changeme'


why are your radios disabled?
See the mac address starting with A0 is the mac address of the router while one starting with C0 is of the inverter.

ok, on the file wireless, if I let the initial configuration, i get back the wifi connexion with the inverter.

If I change option network ‘wwan’ to => option network ‘wlan’

I got :

and when I had the BSSIS (the one of the router or the MAC adress of inverter, I got a lost of connexion total

okay, leave it as initially, and post the screenshot of the connection you got. Ping 192.168.199.1 from HA after that.

so here are my wireless file :

here the status (seems good but not work):

I’m able to ping the 192.168.199.1 from my router with Openwrt but not from HA

signals are too weak, isn’t the inverter mac address ending with FD instead of FE? isn’t this single radio device, the OpenWrt router?

Thanks for your help!

It’s a good question, the mac adress in my inverter (physically) is ending by FD but ending by FE in open wrt as wifi.

I will try to increase the signal

move the OpenWrt router closer to the inverter.

done

noise

EDIT : I don’t know if it cans perturb the configuration but I have a router ISP with the raspberry in ethernet. Then, I have in my garage a repetitor TL-WA860RE 2.4GHZ (with ethernet plug) of wich I connected in ethernet my router WR802N.

The SSID 2.4GHZ (Name) of the wifi network on my repetidor is diferent than the SSID 2.4GHZ (Name) of the ISP router. Doesnt change no?

I change the name of my SSID repetitor to match with the ISP one. But wifi 2.4GHZ and 5GHZ don’t have the same name.

Inverter and repeater are both in the garage?

yes both of them

try placing the OpenWrt router in the garage connected via ethernet to your ISP router/modem.

I finally get your configuration I think :

Ping of 192.168.199.1 possible from openwrt, imporssible from HA

impossible

now add the following command to the custom rules section beneath the already added rules

iptables -I PREROUTING -t nat -p tcp -d 192.168.1.2 --dport 502 -j DNAT --to-destination 192.168.199.1:502
iptables -I POSTROUTING -t nat -d 192.168.199.1 -p tcp --dport 502-j MASQUERADE

and reboot the openwrt router. wait for it to connect with inverter and then ping from HA.