Integration Solar inverter huawei 2000L

Congratulations Wrcls.
VERY GOOD integration

It works perfectly

About the update time…
Some of us have different hardware profile
And some of us will deactivate some sensors

So
The update time could be set by the user?
When we fill the IP, the Port, and the slave…

Is it possible to set it in seconds? From 1 to 60?

It will be great if we can change it like we need…

Grateful…

Installed the update via HACS and after a reboot the integration no longer works and I have the following error in my logs

Error setting up entry SUN2000-5KTL-M0 for huawei_solar

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/huawei_solar/__init__.py", line 65, in async_setup_entry
    port=entry.data[CONF_PORT],
KeyError: 'port'

Hi wlcrs,
I installed the latest version, but I get these errors :

  • Modbus client is not connected to the inverter.

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

What i’m doing wrong ??, With the SP115 firmware, i didn’t connect modbus and works fine … but with the new Firmware is impossible.
I connected the inverter to the router via Wifi, and the RP 3b+ to the router via ethernet.

thanks in advance !,

What firmware do you have? I had to revert back to the 115 for it to work

SPC117, I can’t download SPC115 … no me deja desde la página de Huawei !.

Hello every one, i’m following this post since a long, try to connect my inverter since a week though different repo, but none are working. I would like use the one of wlcrs :slight_smile:

  • install of repository OK
  • found integration OK
  • fill the IP of the inverter OK
  • final message of installation NOK :

I opened also the port forwarding for the 503 for the inverter :slight_smile:
In the terminal, Im able to ping the 192.168.1.189 (my IP adress inverter)

I have no idea of what i did wrong… any idea?

NB: the version of my software is the following :slight_smile:

Hi Thijs,
I just tried the integration. It does find both of my inverters and the power meter. However, the battery entities are missing. I have slave ids 1 and 16. 16 is the master inverter to which the battery is connected. Could it be that the battery entities are not created because it is connected to the inverter with the higher slave id?

Quick edit: When I enter the slave ids in reverse order, so “16,1”, then it finds the battery and creates the battery entities! However, “1,16” does not work.

1 Like

try to revert to 115

thks, do you know where i can find the version ?

do you think it could work in the furture thanks to update of integration ? i guess i’m not the only one…

I have no idea how to get the file from my inversor. When I look into the upgrade management tab it is there…

i’m a bit dedespered…

Update

I’ve reworked some things to move some of the complexity into the huawei-solar library (cfr. integration change and library change ) instead of in the integration. This will help to get the latter approved as an ‘official’ integration. While doing this, I’ve set the update interval to 30 seconds for everything.

This reworking will cause some entities to be renamed. So you will need to remove and re-add the integration to get rid of the old ‘unavailable’ entities. That’s why I’m keeping it into the develop-branch for now.

@ligeza @gfpinto In the meantime, you can change the update intervals yourself by editing the const.py file.


Write Support

I’ve worked out how to do the login on the inverter in the same way the FusionSolar app does. This enables write-support for some configuration options, all related to having a battery (maximum charge power, maximum discharge power, charging from the grid, …).

Who is interested in that can test my code using the login-and-write branch. Note that it requires the installer account to have the default password 00000a for now.

Example on how to use this branch:
git-checkout

I plan on using this to create a “peak shaving” automation, which only allows my battery to discharge when drawing more than 2.5kW from the grid (which is taxed via a “capacity tariff” in Belgium).

I’m currently testing the following automation:

- alias: 'Use battery for peak shaving'
  description: ''
  trigger:
  - platform: template
    value_template: '{{ [states("sensor.power_consumption")| float - 2.5, 0] | max
      }}'
  action:
  - service: number.set_value
    target:
      entity_id: number.maximum_discharging_power
    data:
      value: >-
        {{ [  
              [states("sensor.power_consumption")| float - 2.5, 0] | max,
              state_attr("number.maximum_discharging_power","max")
           ] | min }}"
  mode: single

Note: I haven’t been able to test this new functionality for long-term stability yet. Please report any unexpected behavior to me (here, or by creating an issue on GitHub)


Sidenote: this integration cannot be combined with Emilv2’s integration. They would steal the connection to the inverter from each other the whole time, resulting in neither working at all.

5 Likes

I have an error:

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py:211
First occurred: 13:31:18 (1 occurrences)
Last logged: 13:31:18
Modbus client is not connected to the inverter.

NoneType: None

Please be more specific when reporting issues. What version have you tried using? When did the error occur? During initial setup? Does the integration crash a few minutes after setup?
How does your solar setup look like? What is your type of inverter, batter, power meter, … ? Are you connecting to the Modbus-interface available on your local network, on the WiFi of the inverter, on the WiFi of an SDongle?

I’m using master version. I trying connect to SDongle available on my local network. telnet on port 192.168.8.122:502 is working
Inverter: **Huawei, SUN2000-6KTL-M1 without battery
On fusionSonar app, I can see all data.

How I can connect to mobus?

The integration works super for me and its simple to set up, excellent work! Is it possible to add more write options, like set operation mode and TOU parameters. And is it a more simple way och add your login-and write branch? I am not that great on ssh and coding :slight_smile:

All writeable fields can be added in theory. However, I want to avoid adding settings which are “dangerous”, like setting the minimum SoC of the battery. That’s something that you don’t need to be able to set outside of the admin interface of FusionSolar

TOU can be set, but it’s hard to put into a nice format for a service call. A lot of validation is needed to make sure there is no overlap between time ranges, etc. Not high on my priority list to be honest, but contributions are welcome of course.

Please add the following to your configuration.yaml:

logger:
  default: info
  logs:
    pymodbus: debug
    huawei_solar: debug
    custom_components.huawei_solar: debug

After restarting HA, try to initialize the integration again. Post all relevant log lines here, or create an issue on GitHub.

Did anyone manage how to count selfusage/autoconsumption or whatever it is officialy called from data provided by this integrtion? I have power meter. On speed I think it should be current production substracted by export to grid, but I am not sure if this formula is perfect for any scenario.