Integration Solar inverter huawei 2000L

Hello, and thanks for a wealth of information on integrating Huawei inverters to HA in this thread. I have just completed a self-install of a Sun2000-5ktl-L1, a DDSU666-H power meter, with a previously-existing Shelly 3EM Pro also still in use.

I was initially using the Shelly to monitor power before ever installing solar, and found it to be extremely accurate, and once I tweaked it, it always registered exactly what my utility meter was reading. I’m therefore very happy with its accuracy, and to satisfy myself of the accuracy of the huawei inverter, DDSU meter and solar, I have created a side-by-side view of each for comparison purposes.

I’m hoping to get some advice here on discrepancies that I am noticing. Please see screenshot below.

For clarity, “PowerMon-A” is the shelly 3em (I’m single phase, but using the three channels for different monitors - the “Active Power” is phase A sensor, and is installed on my main grid live tail at the meter box.
The “Inverter Power Meter” is the DDSU666-H, monitored through the fantastic Huawel Solar integration by wlcrs (thank you!), as is the “Inverter”. The DDSU CT is also installed on my main grid live tail, but approx 400mm away from the shelly CT, so there should not be any electromagnetic interaction. The inverter is communicating via the sdongle using wired ethernet. As an aside, and contrary to what many have found on this forum, the reliability of the wired ethernet connection has been 100% since I connected it, and much more reliable than the wireless connection to the inverter I was using previously. The minor discrepancies between the active power numbers is mostly due to the a very short (3seconds) update time from the Shelly, vs a 30sec update time on the DDSU/Inverter figures.

My queries are as follows:-

  1. The DDSU power meter (see pic) is showing a positive active power of 2192w. However, this should be negative as currently generating PV of approx 2550w. Strangely, if I look at the DDSU display, the active power is displayed as -2192w. So it has the figure as negative, but the integration reading is positive. What might be happening here? The DDSU CT clamp has the arrow pointing away from the grid, as per the meter instructions, and the wiring of the CT into the DDSU us correct. Should the DDSU CT be reversed? I realise this is only convention, and it only changes the sign of the figures, but would like to understand the fdifference between the actual meter, and what the integration is displaying.

  2. Im trying to work out the actual house consumption - am I correct that this is inverter_active_power - meter_active_power?

  3. From the inverter stats, is the “input power” the actual PV generated, and the active_power the power delivered from this, minus inverter losses?

Thanks very much in advance - once I get everything settled I’ll add my configuration to the firmwares here.

Today my integration stopped working.
can someone look at the logs?

Did not update or anything, exactly 3pm it stopped working

Log Details (ERROR)
This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/huawei_solar/init.py:88
Integration: Huawei Solar (documentation, issues)
First occurred: 20:01:25 (2 occurrences)
Last logged: 20:12:37

Error setting up entry SUN2000-10KTL-M1SUN2000-12 for huawei_solar
Traceback (most recent call last):
File “/usr/local/lib/python3.11/asyncio/tasks.py”, line 490, in wait_for
return fut.result()
^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/locks.py”, line 213, in wait
await fut
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 178, in create
await huawei_solar._initialize()
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 107, in _initialize
self.time_zone = (await self.get(rn.TIME_ZONE)).value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 241, in get
return (await self.get_multiple([name], slave))[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 276, in get_multiple
response = await self._read_registers(registers[0].register, total_length, slave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 396, in _read_registers
async with self._communication_lock():
File “/usr/local/lib/python3.11/contextlib.py”, line 204, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 145, in _communication_lock
raise err
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 141, in _communication_lock
await asyncio.wait_for(self._client.connected_event.wait(), WAIT_FOR_CONNECTION_TIMEOUT)
File “/usr/local/lib/python3.11/asyncio/tasks.py”, line 492, in wait_for
raise exceptions.TimeoutError() from exc
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/huawei_solar/init.py”, line 201, in async_setup_entry
raise err
File “/config/custom_components/huawei_solar/init.py”, line 88, in async_setup_entry
primary_bridge = await HuaweiSolarBridge.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/bridge.py”, line 66, in create
client = await AsyncHuaweiSolar.create(host, port, slave_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/huawei_solar/huawei_solar.py”, line 187, in create
await client.close()
TypeError: object NoneType can’t be used in ‘await’ expression

Hey, this Solution worked with my second inverter, but I have to move the HA-server to the inverters … (perhaps I will try the DD-WRT solution in the future) - HA-Server over Wlan is not that stable as with cable …

Thanks @Argogma !

you mean the integrate wifi of your inverter or you have add a dongle?

My first inverter is connected via Dongle and Modbus TCP (together with Smart Power Meter and Luna-Battery).
The second inverter is connected via internal wifi.

This way I connected both inverters to my home assistant. Now I am looking for a good Power-Flow Frontend which integrates both inverters :slight_smile:

1 Like

Since a few days my HA energy dashboard is showing weird things on the solar production side.
It “senses” that there’s some production all the time.

Deleted the HA database, thinking that there’s a hiccup, but it didn’t help.

Given the time that is 8AM here in NZ, the production is reporting production during the night while the energy distribution calculated 5.2kWh already. That’s wrong. During the night I was using the battery, so the Home value should be ~5.9kWh.

image
image

The apex charts generate chart, using the entities is not showing any irregularity NOR production during the night:
image

The “inverter daily yield” is constantly increasing after it is being reset at midnight.

Fusion Solar is not seeing those values, so the issue is local, within the integration or HA somewhere.

Hi ukro,

I have 2 inverters. They seem to be connected as they show the same IP address from my LAN when I login with Sun2000 App. The Dongle is connected via LAN and also via WLAN.

As outlinied in
Connecting to the inverter · wlcrs/huawei_solar Wiki · GitHub thte dongle connection is not very stable, I could also us a TP-Link AP.
I was able to set it up and connect it to one of the inverters, but as I have 2 inverters, my question is: Does this help me?

[Edit on Aug 9]
I just noted that even I am connected to the LAN IP of the SDongle (192.168.1.196), HA is only showing the daily yield values of my 4KTL inverter, not of both. I just verified the values with the fusion solar app.
10KTL 8.64 kWh
4 KTL 0.92 kWh
grafik

[Edit Aug 9]
Figured it out: Each inverter has its own Modbus ID. My have 1 and 16. I just counted up till I got a reply.
There seem to be/or were some tools available, to scan for one of the modbus ports (1-255 are possible)
Once set up correctly, all the sensors I need show up :slight_smile:

To set both inverters up in Home Assistant, just add IP, Port and all IDs comma separated:

2023-08-09 21_37_32-Settings – Home Assistant — Mozilla Firefox

Take care!
Markus

1 Like

Anyone with a non default (00000a) installer password that has elevated permissions working? My father in law doesnt have the default password and he can only add the inverter without elevated permissions…

Hi everyone.

I had been using the integration via the Dongle for many months. Today I decided to try the direct connection to the Inverter AP. To this end I got a Wifi USB Stick, connected my Inverter to HA through that and it all worked pretty easily.

Now here’s the thing…instead of being more stable, it seems like this mode of connection is actually less stable for me. Also, the integration appears to be behaving weirdly, for example I can’t reload it from the HA Settings, as soon as I change anything I need to restart HA completely.

Did I make a mistake somewhere? I can’t really get this to behave consistently at the moment. The Update Interval…I can set it to whatever I like, but it will often just ignore the setting or crash. With the connection through the Dongle I could get it to reliably Update every 12-15 Seconds, now it will theoretically Update every 3 Seconds, but sometimes also takes almost 30…:thinking:

I have noticed that my sun2000 is offering a sdongle upgrade to V200R022C10SPC107 - has anyone tried this with home assistant yet?

Yes, I have been running the V200 107 for quite a few weeks. It seems to be no better or worse than earlier version for me.

I’ll give it a go then!

1 Like

@wlcrs we have changed the password to 0000000a (00000a is not possible as new password because of the length restrictions) it works, so there’s a bug in the integration that doesn’t like other passwords besides the default ones.

2 Likes

Hello. I’ve restarted several times HA trying to depurate some problems with some automations and now the integration states:

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

Tried to reload it with same result, and tried to disable it, restart HA and then enable it again. Can’t get it working again. Any help?

Hi Peaceduck,

Using WLCRS integration and see that it provides a sensor.inverter_efficiency_1 (Primary Inverter in a chain) and sensor.inverter_efficiency_2 (Secondary inverter).

image

Wonder if instead of using the rough calculation that gives a 90% / 95% / 98% efficiency value, would it be more accurate/simpler to query this sensor and multiple by each individual inverters Input Power.

image

i.e. something like:

state: "{{ (states('sensor.inverter_input_power_1') | float (0) ) * (states('sensor.inverter_efficiency_1') | float)}}"

In NZ too and don’t have that issue, my yield is 0.
So likely does relate to the battery output as I don’t have a battery.

I thought about the same, but mine is always 100% as soon as the inverter turns on

Good afternoon…

I have problems connecting to the module that I have via cable… the ip is correct, it responds to ping, but if I telnet to the ip with ports 502 and 6607, neither of them answer me… those are those ports, right? I think 502 for wifi and 6607 for cable.

Thanks in advance

1 Like

Hi Fredrik,

I’ve looked around (finally managed to change my Huawei installer password today and gained access to the battery configs) and it appears I want to do the same as you did regarding the timed charge and discharge of the battery. My reason is that we have a 4 hour period of cheap electricity at night and if I want to charge my battery from the grid I don’t want my EV to take all that charge when the battery SOC state is reached first. Hence I can see that setting the max discharge parameter to 0 during that 4 hour period would work well. My question to you though is whether the TOU mode needs to be set for this to occur? or can this be achieved despite the battery working mode being set to “Maximise Self-Consumption”?

Thanks,
Mike.

Somehow it reverted and is reporting better values.

Since you’re in NZ too, do you struggle with the time offset and NMS vs NTP time source?
It looks like Huawei doesn’t want me to stick with NTP and reverts the time server to their faulty NMS server every time I set it to NTP.