Integration Solar inverter huawei 2000L

Yes. As far as I know at least.

1 Like

Hi all,

I have the SUN2000-10KTL-M1 installed, in combination with the SDongle.
I used this integration the passed year and it was very stable and useful.

I recently purchased a Flexbox from Lifepowr (only used in Belgium), which is a system that will dynamically charge/discharge my battery. It checks variables as projected sun hours and cost of electricity and can then make decisions on what is best.

For this system to work, it needs to read from the Huawei Inverter. This connection is now using the modbus connection through the SDongle. I needed to disable the HA Huawei integration for it to work.

This confirms that multiple systems cannot read modbus from a single Inverter. I created a ticket for this, and it was also confirmed by Huawei support.

I am now looking for a way to still get the Huawei Solar info into my HA.
Does anybody have any experience with this? It would be grately appreciated.

Some scenarios to maybe research are:

  • using Sdongle Modbus for Flexbox and try Internal AP connection with HA.
  • using Sdongle Modbus for Flexbox and try RS485 connection with HA.
    On Wlcrsā€™s github it states that this causes unstability, but maybe this was the case with
    older firmwares ?

I would look into running a Modbus proxy like GitHub - Akulatraxas/ha-modbusproxy: Hassio Addon packaging modus-proxy and connecting both the integration and your 3rd party device through there. That way you have only one Modbus connection with the inverter.

1 Like

I currently trying to use this integration and I am facing same issue as @MirceaD above. Was wondering whether anyone has found a solution or whether @MirceaD managed to solve the issue.

Add double quotes to the ā€œbelowā€ and remove the value_template.

below: "50"

Iā€™m wanting to make use of capacity control so that I never pull more than 4kW from the grid (we have a tarif which limits us to this, any more and the power meter will cut our power!).

Iā€™d also like to take advantage of periods of cheap power overnight, to charge the battery and flatten our usage curve (and minimise our electricity bill!).

My question is if I set a capacity control period for 24/7 with a limit of 3900W, can I also let the battery charge with a limit of 4kW and trust the inverter to keep the total power drawn from the grid to the limit of 3900W?

In testing so far, this doesnā€™t seem to have worked, but I wondered if others have had better luck.

Also, does anyone know how to properly pass multiple lines into the set_tou_periods service? Iā€™ve tried a variety of formats but Iā€™m struggling!

service: huawei_solar.set_tou_periods
data:
  periods: 00:00-01:59/1234567/-
  periods: 02:00-04:59/1234567/+
  periods: 05:00-23:59/1234567/-
  device-id: c462283aeff083125abdba712ee38510

After upgrade to release 1.2.4 my Huawei Solar integration stopped working.
It says ā€œFailed to Connectā€.
I am accessing to the inverter (SUN2000-5KTL-L1) via wifi without dongle. I have tried with ports 502 and 6607 but no success. I have activated (I guess) the O&M option in the Conection to Router Setting page of the Fusion Solar Application. No success.
I have power off and power on the inverter, no success.
I donā€™t know what to do. Any ideas please?

same for me, fw 125, O&M activated, no success connecting to the inverter wifi (not the 200.1 one)

Thanks, that has done the trick. Itā€™s frustrating when the UI canā€™t create an automation properly!

1 Like

Not had an issue here, no changes to the ports should have happened with a version update. Can you ping the IP of the inverter? 192.168.100.1 by default, I think.

I find a reboot can sometimes cause the wifi to lose connection, so best to start with the basics!

Today, our electricity provider needed to stop the main in our small countryside area. I decided to take the opportunity to try the ā€œOff Gridā€ mode of the inverter (yes, I did carefully switch off our connection to the provider before doing anything).

I tested this for a short period of time (worked fine) but I noticed that while the Huawei App (connected to the inverterā€™s wifi) continued to work flawlessly, the home-assistant integration fails when the inverter is working in ā€œOff Gridā€ modeā€¦ I activated the debug mode on the log, I assume that some ModBus registers have unexpected values and the process fails overall. The integration it self display ā€œCould not update HV20A0038813 valuesā€. Here is what the log showed, repeatedly (each time the integration tries to start over):

2023-02-14 12:50:40.791 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2023-02-14 12:50:40.914 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2023-02-14 12:50:41.037 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30000
2023-02-14 12:50:41.203 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30071
2023-02-14 12:50:41.384 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37200
2023-02-14 12:50:41.510 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37100
2023-02-14 12:50:41.633 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2023-02-14 12:50:41.756 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47089
2023-02-14 12:50:42.026 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47954
2023-02-14 12:50:42.181 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064

and then it stopsā€¦ but all sensors report ā€œunavailableā€. Restarting the integration produces the exact same behavior.

I donā€™t expect to use my inverter in this mode, but it would be nice to have the integration work even in such ā€œdegradedā€ mode.

AFAIK the inverter forcibly closes the Modbus connection after a few seconds when in Off-grid mode. The integration is thus unable to poll all the Modbus registers to update the state of the sensors in HA. It will periodically retry to connect and request all the necessary registers.

Until such a polling is successful, the correct state for each sensor is ā€˜Unavailableā€™: the integration is unable to communicate with the inverter and cannot establish the latest values. This can be caused by network problems, the inverter being off-grid, etc. No way of knowing what exactly causes the problems.

Thanks Thijs your the super quick reaction.
I will possibly try one of these days (using your huawei-solver python package :-)). I would tend to think the ModBus connection is still alive. The HA extension does say it read registersā€¦ and then gets stuck. What I suspect is that some registers become unaccessible/generate error. If we could identify which ones are off, it would probably remain possible to keep updating the remaining measures. Well, thatā€™s only weird guesses.

I will report if/when I try this.
Thomas

2 Likes

Couldnā€™t resist having a look. In off-grid mode, I looked into my Modbus RTU-to-TCP bridge statistics, and both the sent/received serial frames/byte count do increase. So, I tried the simple python code below (adapted from the README.md of the python package)

from huawei_solar import AsyncHuaweiSolar, register_names as rn
import asyncio

slave_id = 1
async def readfew():
    client = await AsyncHuaweiSolar.create("192.168.xxx.xxxx", 8899, slave_id)
    result = await client.get(rn.NB_PV_STRINGS, slave_id)
    print("Number of PV strings: ", result.value)
    results = await client.get_multiple([rn.LINE_VOLTAGE_A_B, rn.LINE_VOLTAGE_B_C, rn.LINE_VOLTAGE_C_A], slave_id)
    print("A-B voltage: ", results[0].value)
    print("B-C voltage: ", results[1].value)
    print("C-A voltage: ", results[2].value)

asyncio.run(readfew())

And it does produce meaningful results:

Number of PV strings:  2
A-B voltage:  230.0
B-C voltage:  0.0
C-A voltage:  0.0

So, ModBus is working fine. If there is anything else I should try, just tell me.

1 Like

@wlcrs I added some optimizers to my inverters and want to change config to also scan the optimizers. What is the proper way to do it in order to not loose all configuration I have done?
Want to remind you that I have 3 separate inverters so 3 separate instances of huawei-solar.

edit: never mind, just saw that optimizers were detected automatically after restarting integration. I didnā€™t expect that!

I tried the ā€œhigh-levelā€ bridge interface:

from huawei_solar import HuaweiSolarBridge
import asyncio

async def highlevel():
    bridge = await HuaweiSolarBridge.create(host="192.168.xxx.xxx", port=8899,slave_id = 1)
    print(await bridge.update())
    
asyncio.run(highlevel())

and I just get:

Modbus client is not connected to the inverter.
NoneType: None

So, I imagine one of the ā€œfailsafeā€ tests in the high-level layer of huawei-solar is too requiring.

1 Like

I have experienced similar behavior and I use tcp modbus connection with dongle (port 502). I thought the problem was that the digital meter does not work (goes offline) when grid is off. But probably there are more issues. It would be great to fix this and see details when in off-grid mode.

Thanks, Panagiotis. Yes, the power meter effectively reports itā€™s not there.

(await client.get(rn.METER_STATUS, slave_id)).value == rv.MeterStatus.NORMAL does returns False.

Thijs, I have identified at least one cause of the issue: in the ā€œINVERTER_REGISTERSā€ list, the entry rn.DEVICE_STATUS generates an error:

Traceback (most recent call last):
File ā€œhuawei_solar/registers.pyā€, line 92, in decode
result = self.unit[result]

Looking into DEVICE_STATUS_DEFINITIONS in register_values.py, there is no match for the returned code. I went to the modbus reference manual I mentioned above and there is a missing code in the DEVICE_STATUS_DEFINITIONS dictionary for off-grid mode.

I tried to submit a tiny merge request on GitLab :slight_smile:

1 Like

And changing this on the home assistant installed huawei_solar package does solve all issues: the extension now works in off-grid modeā€¦

3 Likes

Hi Thomas,

Thank you for debugging this issue. Iā€™ve never seen that stack trace showing the root issue before.

Iā€™ve merged your request in the huawei-solar library and will do a proper release later this week.

2 Likes