Integration Solar inverter huawei 2000L

Hi.

I have the FW 117 so I am trying to connect to the inverter through its WLAN to port 6607.

I am using Windows with the Home Assistant inside a VirtualBox image.

I can connect to all my devices, but, when I try to install the Huawei Solar integration, I have problems.

I am using two WIFI adapters: one connected to my home LAN (192.168.8.x) and another to connect to the inverter WLAN (192.168.200.1). From the Windows I can access both worlds. But, inside the HA in the virtual machine, I can only connect to my home LAN. In Virtual Box I assigned both WiFi adapters in Bridge Mode, but nothing.

Could anybody help me how to configure HA and/or Virtual Box to access both WLANs?

Thanks

I have installed a wireless/ethernet bridge connected to the inverter AP (SUN2000).
It’s a cheap tl-wr802n (20€ on Amazon) and in this way I can bridge SUN2000 net in my main network.

Thanks to the debugging logs you sent me, I’ve identified the problem: some configuration parameters are cached by Home Assistant, which is causing some wrong values (which I already bugfixed earlier) to stay stuck in your HA. I’ll have to investigate how to get those wrongly cached values out of there.

In the meantime, the following steps might work:

  • Remove the integration
  • Go to Configuration > Devices & Services > Entities > search for “Grid Active Power”. Explicitly remove it by checking the checkbox and then click on 'Remove Selected".
  • Add the integration again

The “Grid Active Power” should be recreated with the correct parameters.

/cc @MicheleMercuri

2 Likes

to those of you who requested openAPI credentials, do you all have installer accounts ? Got this reply from Huawei support when requested :

You have an owner account on fusion solar region02 platform.
The open api accounts are available only for installer accounts. Please ask the installer to do the request or add him in cc to accept an openAPI account to be created on his user name.

You need to ask your installer to send an email to Huawei. A template you can use can be found here: EnergyID - Huawei FusionSolar

1 Like

Hey,

I made some more investigation and the API-CLI you are refering in here is not targetting the device, which would be the ideal, it target the cloud service of Huawei which for what I have read is far from ideal. So far the only the only way to target the device directly seems to be the Modbus TCP.

I’m already searching for day, but could not get it working. I have upgraded my solar invertere firmware and the Sdongle firmware to the latest version and have the settings set, but can still not connect to the inverter.
I might miss something trivial?
dongle firmware: V100R001C00SPC127
inverter firmware: V100R001C00SPC140
I pretty sure my IP address is correct, I can ping to the adress as well.
My settings in HA:

  - platform: huawei_solar   
    host: 192.168.1.234
    optimizers: false
    battery: false
    slave: 1
    port: 6607    

however I recieve this in my log file:

2022-02-14 23:35:43 ERROR (MainThread) [huawei_solar.huawei_solar] failed to connect to device, is the host correct?
NoneType: None
2022-02-14 23:35:43 ERROR (MainThread) [custom_components.huawei_solar.sensor] could not connect to Huawei inverter: failed to connect to device, is the host correct?

hope someone can give me some directions.

Are the settings for your SDongle correct?

This is how I deal with it :

Actual Daily Yield = Daily Energy Yield - Battery Daily Consumption (= Battery Daily Discharge - Battery Daily Charge) + Battery Daily Correction

Where Battery Daily Correction = (Battery Daily Discharge - Daily Energy Yield) @ Time Input Power becomes > 0 W (sunrise)
This will also be Reset to 0 kWh at midnight.

solar_daily_production:
      friendly_name: "Actual"
      unit_of_measurement: 'kWh'
      device_class: energy
      state_class: total_increasing
      value_template: >-
        {% set solar_daily = (states('sensor.daily_energy_yield') | float(0) - states('sensor.battery_daily_consumption') | float(0) + states('input_number.battert_correction') | float(0)) | round(2) %}
        {% if solar_daily < 0 %}
            {{ 0 }}
        {% elif solar_daily < states('sensor.solar_daily_production') | float(0) %}
            {{ states('sensor.solar_daily_production') | float(0) }}
        {% else %}
            {{ solar_daily }}
        {% endif %}

Keeping the Battery charged takes about 35-65W, so in winter time from midnight till sunrise : 8hr x 35-65W = ± 0.5 kWh in ‘losses’
During midnight till sunrise the energy consumption is in most cases low ( < 1kWh) and at low rates the efficiency drops to 60-70% which is normal for inverters.

5 Likes

I strongly disadvice to charge a battery (EV) with an other battery (home)

Besides of the reduced efficiency (energy conversion : solar → electrical → chemical → electrical → chemical), it will reduce the lifetime and capacity of the home battery more rapidly → break-even point further into the future.
One should charge the EV with solar energy surplus

If at sunrise you have 50% SoC left, you can choose to only charge the home battery till 70% during the day (70%-50% = 20% SoC at sunrise / DoD should not exceed 80-85%) and have the surplus solar energy directed to the EV iso the Grid.
Of course, this is only possible if the EV is at home during the day


Thanks for your response, but already not comming there, I cannot install the Huawei Solar integration, probably because I cannot connect to the inverter?
The IP adress should be the IP adress of the Sdongle right?

Use an app like fing to see the ip
 Mine for example is 192.168.1.xxx

I tried, ping is working fine. I’m reading the complete forum, do I have to connect the dongle with a cable or can it be wireless?
I modified the IP to a fixed adress: 192.168.1.2
ping from HA works fine, also tried cabled network, no change, still not able to connect. Could it has something to do with the firmware version of the dongle? PC127?
My inverter model is: SUN2000-5KTL-M0
Also tried different slave versions. My config is:

  - platform: huawei_solar   
    host: 192.168.1.2
    optimizers: false
    battery: false
    slave: 1
    port: 6607       
   

is it correct that I also not see the sensor integration if it does not connect? Below my log information.

2022-02-15 23:05:18 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.2', 6607)
2022-02-15 23:05:19 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 200 ms before next connection attempt.
2022-02-15 23:05:19 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to tasmota/discovery/#, mid: 3
2022-02-15 23:05:19 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-02-15 23:05:19 ERROR (MainThread) [huawei_solar.huawei_solar] failed to connect to device, is the host correct?
NoneType: None
2022-02-15 23:05:19 ERROR (MainThread) [custom_components.huawei_solar.sensor] could not connect to Huawei inverter: failed to connect to device, is the host correct?
2022-02-15 23:05:19 WARNING (MainThread) [pymodbus.client.asynchronous.async_io] Failed to connect: [Errno 111] Connect call failed ('192.168.1.2', 6607)
2022-02-15 23:05:19 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Waiting 400 ms before next connection attempt.

Hope someone can point me in the right direction, have no clue what to do more.

I used a tool to scan ports, and there seems not to be an open port on the IP address, what to do?

Starting Nmap 7.92 ( https://nmap.org ) at 2022-02-15 23:41 West-Europa (standaardtijd)

Nmap scan report for 192.168.1.2

Host is up (0.021s latency).

All 1000 scanned ports on 192.168.1.2 are in ignored states.

Not shown: 1000 closed tcp ports (reset)

MAC Address: CC:05:77:BE:97:4B (Huawei Technologies)



Nmap done: 1 IP address (1 host up) scanned in 2.21 seconds

I have SUN2000-6KTL-M0 so a very close to you :slight_smile:
I am using SPC141 for inverter and 127 for dongle and I have a working TCP/Modbus connection using dongle and internal wifi.

I will repeat @wlcrs question: did you enabled TCP modbus port in inverter config?

This is my config, so Modbus is configured, but still no open port on the IP adres


Hello, but how to do it exactly, because i have this king of repetitor. Where is the ethernet port on the inverter? Could you please help me?? So many thks!!

GREAT THANKS to the help of this wonderful comunity I finally managed my two inverters to work (slaves: 1,16 btw). I can see now both inverters ( SUN2000-5KTL-L1 + SUN2000-3.68KTL-L1 + Power Meter). My installer company gave me (a consumer) “installer rights” and I could easily upgrade the SDongleA-05 to the right software version as per integration instructions. I must confess the integration is “not dead” by any means. It was clearly an exageration :slight_smile: . I have also see many creative ways to connect the dongle eventhough the port were not visible from the HA LAN with the latest firmware update. I did not try it, but suposedly this simple Amazon $20 device can make the connection (although i have not tested it). Will try to give back some support to the community with all the learning I got

1 Like

There is no ethernet port on the inverter.
The wr802 is a client device so it is connected via wifi to SUN2000xxx wireless network (the network generally used for “maintenance” purpose).
When the wr802 act as a client, the ethernet port becomes a bridge and all the wifi traffic is routed to its lan.
In order to route all the messages correctly, your main network must be able to handle VLAN.
If this is not possible, you have to change all the ip address in order to enter in the same subnet of Huawei.
Maybe this picture can help (VLAN 10 is my main net and VLAN200 is Huawei).

This seems how you get the correct data :

This applies to Daily, Monthly, Yearly and Total data.

Apparently you can’t get TCP working only over the smart dongle on the latest FW SPC117 (and on) according to Huawei EU support this morning, and as I don’t currently have that enabled (not got an installer account, waiting for my installer to change the config), is there any way to get the SUN inverter working with OpenAPI credentials?

I’ve got the OpenAPI creds, and can connect using postman or firefox webtools, but I can’t get it to work with Node Red or the RESTful add-ons on HA. Any thoughts?