Integration Solar inverter huawei 2000L

Thank you Thijs. Happy to contribute. I guess most of us rarely explore the uncharted and risky territories of Off-grid mode :slight_smile:

I could only see the stack trace after “mimicking” the high-level “bridge.update()” method into a low-level client code. I imagine there is a “try” somewhere that captured the exception.

1 Like

I’m having a planned outage starting in 1 hour, lasting up to 5 hrs. I could do some testing.

Hope that someone here can help me out with my issue.
I have a SUN2000-6KTL-M1 Inverter with a SDongleA-05.

I have followed this guide on enabling Modbus TCP: MODBUS TCP Guide - Huawei Enterprise Support Community

All the requirements are met and I was able to find the modbus TCP option and enable it.

However, the Huawei Solar Integration failed to connect with errors:

Could not read register value, has another device interrupted the connection?
Modbus client is not connected to the inverter.

This made me look further and trying out with QModMaster on Windows, I was able to ‘connect’ to the inverter IP adress on port 502, with it also stating the port is opened.
However, reporting on the slave ID 0 or 1 or any further polling fails completely.

Anyone got a clue what’s going on?

Many thanks!

Thanks John.
Yes, ping from Home Assistant Terminal to the wifi IP of the inverter works properly.
I have also rebooted both HA and Inverter, but it doesn’t work.

In the end I tweaked with all the settings in the inverter.
Slave ID seemed to have been 1, but in the end rebooting HA did the trick. Don’t know why.

Thank you, @wlcrs , for the great integration. I have set up a SUN2000-20KTL-M2 (Ver. V100R001C00SPC150) and successfully used your integration via the network.

Does anyone have a solution to display a graph (in Dashboard) like the one in the FusionSolar app (as shown in the picture below)? The app updates every 5 minutes, but I want to use data from the integration to display data in Home Assistant every 30 seconds.

Hello Thijs,

I just submitted another tiny merge request. I use the opportunity of my inverter running in grid-off mode because of maintenance work to “robustify” huawei_solar.

I added a simple test of the power-meter status in the update() function of the bridge class instead of relying on a previous initialization of the meter type. With this, when the grid-off mode starts (possibly automatically), the power meter disappearance does not kill huawei_solar and when the inverter gets gried-tied again, the power-meter comes back to life.

2 Likes

Somethings like this?

1 Like

I have finally recovered the connection between my inverter and my HA.
As indicated here (Connecting to the inverter · wlcrs/huawei_solar Wiki · GitHub) the connection is now made through port 6607.
I had to reset the installer password -it was not the default password of 00000a- by following this video (Reiniciar contraseña Huawei SUN2000-2/3/3.68/4/4.6/5/6KTL-L1 - YouTube)
Enabling the “Local O&M” option is misleading as indicated here (Integration Solar inverter huawei 2000L - #2206 by malakudi). To check it, telnet to the IP of the inverter and port 6607.
After following all these steps, the integration works again, now through port 6607 (before through 502).
Hope it helps.

1 Like

Sometimes I realise the port just gets locked with an older connection after HA restart. You have to restart the connection of the AP on the inverter and it always connects then. Very flaky but it works.

Hi there,

For me, using the latest Huawei firmware and the latest mobile app, the “Local O&M” option is not visible anymore.

Do you have it? How did you enabled it?

Thanks

2 Likes

Thanks! I’d actually experienced this but I didn’t suspect it as being an issue with the integration, rather I thought it was weird my power meter went offline when off-grid mode was in play. Glad you picked up on it! :slight_smile:

service: huawei_solar.set_tou_periods
data:
  periods: |-
    00:00-05:59/1234567/-
    06:00-17:59/1234567/+
    18:00-23:59/1234567/-
  device_id: c462283aeff083125abdba712ee38510

Answering my own question, this is the correct format.

Hello MIchele (I’m Marco also from Italy) I have read all the article and set it up.
But why I can’t find the sensor “solar_energy_riemann” to put in the solar energy of the energy tab in my homeassitant?
I have missing somthing?

It’s not created by default, search further up the thread (just look for “solar_energy_riemann” to find it) for the configuration needed to add it!

I have found it in the post #1483
but following the guide, i can’t find it in the energy tab.

you have to create it, go to ‘settings–>integration–>helpers’. click on ‘create helpers’.

is it correct?

@wlcrs Do you plan a new release so that I can use the off-grid patch in huawei-solar library?

Hi, first you have to create this sensor:

template:
  - sensor:
    - name: "input_power_with_efficiency_loss"
      unique_id: "input_power_with_efficiency_loss"
      unit_of_measurement: "W"
      device_class: power
      state_class: measurement
      state: >-
        {% set inverter_rating = 3000 %} {# adjust this value to the rated power of your inverter #}
        {% set inpower = states('sensor.inverter_input_power')|float(0) %}
        {% if inpower < (inverter_rating*0.1) %}
          {{ inpower * 0.90 }}
        {% elif inpower < (inverter_rating*0.2) %}  
          {{ inpower * 0.95 }}
        {% else %}
          {{ inpower * 0.98 }}
        {% endif %}

then this: (put this one in HA energy dashboard)

sensor:
  - platform: integration
    source: sensor.input_power_with_efficiency_loss
    name: solar_energy_riemann
    round: 3
1 Like