Integration Solar inverter huawei 2000L

It seems stable at the moment, no errors at the moment, but i had it going for a few hours before so i don’t know, but I get these errors, but it should not have anything to do with the huawei inegration



Hi guys, after som reading, could someone please confirm what the easist way to integrate one of these would be?

Is it to use this integration: GitHub - wlcrs/huawei_solar: Home Assistant integration for Huawei Solar inverters via Modbus

Or the one emil did: GitHub - Emilv2/huawei_solar: Home Assistant custom component for Huawei inverters

Or something else?

I want to see the daily solar production and I want it to integrate into the energy dashbord for statistics and so on. I will not have a battery at the moment.

@wlcrs Thanks for a super job with the integration. I have problems with my optimizer and it makes the integration not to load. Is it possible to make the integration to set optimizer to false and not to detect them?

Please create a (properly filled in) bugreport with the necessary error/debug logs to let me assess the problem.

New release: v1.1.4

New Features

Bugfixes

  • Always enable ‘advanced permissions’ when connecting over serial
  • Handle Timeout as a retry-able error during integration setup
  • Upgrade backoff dependency
  • try to fix erroneous readings by checking number of received registers

Other

  • Automatically retry operation when an “Abnormal Slave Response” ModBus error message is received
1 Like

Hi,

I can’t conect with my HA to my Huawei KTL30M3.

I got always: Reading from the inverter failed.
I use the IP from my inverter in my home network
I use ID: 0 , 1 or 2
Modbus is activate and the Port 502 is open.

Can anybody help me please?



hi @wlcrs can you add this sensor to your integration? maybe it calculate remaining time in min. (before End-of-discharge) when Luna switch to “back-up mode” (in case of power outage), many thanks again 4 your great work :wink:

This value is not exposed over Modbus, sorry. I guess you can compute it from the values already exposed by the integration?

1 Like

ok many thanks, I think as below maybe work ok (in backup mode or grid connected I think battery discharge will be the same :grin: ):

####################### Battery Time Left Till End Discharge ######################################
template:
  - sensor:
      - name: "Battery Power Left"
        unique_id: battery_power_left
        unit_of_measurement: "kW"
        state: >-
          {% set inpower = states('sensor.charge_discharge_power')|float(2) %}
          {% if inpower < 0 %}
            {{ (inpower * -1) / 1000 }}
          {% else %}
            {{ '%.2f' | format(states('sensor.average_kw_discharged_from_battery_last_24_hour') | float / 1000 ) }}
          {% endif %}
  - sensor:
      - name: "Luna2000 Time Left To End Disc."
        unique_id: battery_time_left
        state: >-
          {% set percent = states('sensor.battery_state_of_capacity') | float(1) /100 %}
          {% set energy = 20.0 %}
          {% set reserve = 0.1 %}
          {% set charge = (percent - reserve) * energy %}
          {% set current_power = states('sensor.battery_power_left') | float(0) %}
          {% set decimal_hours = charge / current_power %}
          {% set minutes = (decimal_hours % 1 * 60) | round(0) %}
            {{ decimal_hours | int(0) ~ 'h ' ~ minutes ~ 'min' }}

# average of discharge in last 24h
sensor:
  - platform: statistics
    name: "Average kW discharged from Battery Last 24 Hour"
    entity_id: sensor.power_batt_disch_kwp
    state_characteristic: mean
    max_age:
      hours: 24
    sampling_size: 7200
    precision: 3

3 Likes

Hello everybody

One question, but now the wired network connection doesn’t work anymore?

Do I have to connect via modbus to get back to receiving data?

New release: v1.1.6

Bugfixes

  • Fix regression for inverters that don’t support optimizers
  • Fix missing unique_id for working mode select entity (which was botched in 1.1.5)

New Features

  • Add “Excess PV energy use in TOU” select entity

Thank you!

A big thanks to all my current and past sponsors. Your contributions keep me motivated to maintain this integration to a high standard! :heart:

5 Likes

Hello,
I have a new Huawei SUN2000-6KTL-1, I am using Huawei FusionSolar Android App to setup and configure inverter. The inverter integrated WiFi is configured and connected to my house WiFi.

Firmware is updated (software version V200R001C00SPC124 and MBUS firmware is to V100R001C00SPC320). Modbus TCP is enabled unrestricted. The installer password is set.

I can open TCP connection from computer to port 6607. Slave ID is 1. Additional Huawei power sensor is connected and visible in the app.

After HACS and wlcrs/huawei_solar installation. I am unable to initially connect - “Reading from the inverter failed” . In logs I see:

logger: custom_components.huawei_solar.config_flow
Source: custom_components/huawei_solar/config_flow.py:114
Integration: huawei_solar

Could not read register value, has another device interrupted the connection?
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py”, line 356, in _do_read
response = await self._client.protocol.read_holding_registers(
File “/usr/local/lib/python3.10/site-packages/pymodbus/client/asynchronous/async_io/init.py”, line 35, in execute
resp = await asyncio.wait_for(req, timeout=self._timeout)
File “/usr/local/lib/python3.10/asyncio/tasks.py”, line 445, in wait_for
return fut.result()
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Connection lost during request

What other devices / connections is possible to have / how to disable them?
Should I disable Huawei cloud connection inside FusionSolar app (“Management System” connection to EU / global servers)?
I can use the mobile app and device commissioning as installer with password on the same/home network. If this “device commissioning” needs to be disabled, how to do it?

Are you connecting to the inverter hotspot?
It Only accepts one connection

today after instaling Home Assistant 2022.11.0 ,Huwai solar integration stop working .all time in log I received this message :Logger: homeassistant.setup
Source: setup.py:184
First occurred: 10:43:27 AM (1 occurrences)
Last logged: 10:43:27 AM

Setup failed for custom integration huawei_solar: Requirements for huawei_solar not found: [‘huawei-solar==2.0.1’].

:warning: UPDATE REQUIRED: Home Assistant 2022.11 and above requires you to update to v1.1.6 of this integration :warning:

(sorry for the shouting, but I expect a lot of these reports popping up in the upcoming days/weeks).

6 Likes

did you mean version 1.1.6 ??? oh all works now like charm after update .thanks

1 Like

Hi, with this method do you have some errors by HA? In particular fetching data errors from update_coordinator.

New firmwares updates from Huawei

Thanks for the notification. I read diagonally through the updated modbus definitions in the release notes, but it contains little news. The only noteworthy thing is that a few new battery operating modes were added, which all seem related to the ‘EMMA’ AI thingy from Huawei. I haven’t seen EMMA appear in the FusionSolar webinterface of my inverter, so I’m unable to test it.

1 Like

Recently swapped over to your integration @wlcrs - nice work!
Decided to swing you some sponsor love, as should everybody else on this thread gaining from your efforts :wink:

Everything works perfectly other than a strange issue I’m seeing in my Influx/Grafana logging…
My brain has always preferred to see instantaneous active power usage vs kWh, so a basic formula gives me the figure I like to see on my dashboards:

      huawei_house_usage:
        friendly_name: "Huawei House Active Power Usage"
        value_template: "{{ (states('sensor.inverter_active_power') | float) - (states('sensor.power_meter_active_power') | float) }}"

What I’ve found since swapping to your integration are small transient figures logged as negative.
This is obviously impossible!
I believe this is due to the fact there are now two ‘devices’, and the small fraction of a time difference between both devices ‘reporting’ is causing bogus information to be logged in the template resultant figure.


(hanging out for these sporadic clouds to bugger off haha!)

Any ideas how I can combat this? I thought of rejecting negative figures in my fluxdb query but I’ve seen errors above zero as a result of the formula too.

Cheers!

2 Likes