Integration Solar inverter huawei 2000L

Today Is a bad day. I have lost connection two times and for now to reconnect i have to sconnect and reconnect the Sdongle. Even on fusionsolar app my system is offline.
When offline i can ping the ip address so i think the problem is in the modbus side, not in my router.
Is it happening only to me? Is there a solution?

I have a SUN2000-6ktl-L1 running firmware V200R001C00SPC119 with SDongle WLAN-LE running firmware V100R001C00SPC129.
I set up the parameters in the inverter as instruction in @wlcrs integration
For the integration setup:

IP of inverter 192.168.107.xxx (ip of my home LAN).
Port 502
Slave 1

Hello again.I have PI near the inversor so I connect directly via wifi. The past 3 days I am loosing connection specially at night. Any idea why?

Also if I use the serial connection what do I have to do? I have read the wiki and see where to connect the wires on the inversor but could not find your where to connect the USB pen.

thank you in advance

I recently got a sun2000 15ktl m2 installed and I’m trying to integrate it with HA. I have an SDongle as well

Inverter: V100R001C00SPC141
SDongle: V100R001C00SPC119

The SDongle is connected to my wifi and it seems that port 502 is open (checked with a port scanner).

With the FusionSolar app, under Device Commissioning, I can:

  • connect to the inverter while being on the Inverter’s AP, with ‘User’ and the pw I set while the installer was still here
  • connect to the SDongle while being on my home Wifi, with ‘Installer’ using 00000a as pw.

However, connnecting to the inverter with Installer/00000a says ‘Login failed. Try again’. If i connect to the inverter as ‘User’, in the settings I don’t have the Communcation configuration menu to set up either the RS485_1 or Modbus TCP related settings.

What could be the cause and what are my options? Could it be that the installer changed the default password of the Installer account on the inverter to be something else other than 00000a? (i’ve pinged him, hasn’t replied yet)

Thanks

yes I would say you do not have installer permissions …

Do you want to integrate your inverter into HA?
If yes try following the dongle method.
Use your dongle’s Ip in Wlcrs integration.

I have activated integration.
having tried to insert inverter connection ip to my router 192.168.178.38 port 6607 and to my surprise it worked perfectly. therefore we are not obliged to insert the internal ap inverter 182.168.200.1. My firmware SUN2000LV200R001C00SPC124 inverter sun2000 6ktl l1.

1 Like

OK, I switched from AP mode to Serial mode. I’ve connected pin 1 and 2 to a USB serial adapter. I enabled the RS485_1 setting as requested. I deleted my Huawei Solar integration and added it again with the option serial and slave 1. The integration tells me it found the inverter, but I won’t receive any data…

Sometimes the 2 devices appear (inverter and powermeter), but my entities stay unavailable. Any ideas?

Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py:156
First occurred: 11:52:45 (1 occurrences)
Last logged: 11:52:45

Aborting client creation due to error.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/backoff/_async.py", line 133, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 319, 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 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 150, in create_rtu
    await huawei_solar._initialize()
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 88, in _initialize
    self.time_zone = (await self.get(rn.TIME_ZONE)).value
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 217, in get
    return (await self.get_multiple([name], slave))[0]
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 259, in get_multiple
    response = await self._read_registers(
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 350, in _read_registers
    result = await _do_read()
  File "/usr/local/lib/python3.10/site-packages/backoff/_async.py", line 141, in retry
    await _call_handlers(on_giveup, *details)
  File "/usr/local/lib/python3.10/site-packages/backoff/_async.py", line 34, in _call_handlers
    await hdlr(details)
  File "/usr/local/lib/python3.10/site-packages/backoff/_async.py", line 16, in f
    return coro_or_func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 295, in backoff_giveup
    raise ReadException(
huawei_solar.exceptions.ReadException: Failed to read register 43006 after 5 tries

hello,

any ideas why my connection is so unstable? The device responds to ping all the time. i am using openwrt as a client connected to inverter wifi

wyyy|440x293

Logger: custom_components.huawei_solar
Source: helpers/update_coordinator.py:211
Integration: Huawei Solar
First occurred: 25 lipca 2022 14:05:50 (95 occurrences)
Last logged: 11:36:50

Timeout fetching HV2080031872_data_update_coordinator data!

Can you try again with version 1.1.1 ? I’ve had to do an ugly hack in the underlying pyModbus library to get things stable :neutral_face:

2 Likes

stable ping =/= stable connection. The integration clearly loses it’s connection from time to time. Due to the aggressive retry-mechanisms it manages to read some data sometimes, but you’ll need to look into improving your setup.

1 Like

@wlcrs
I installed your custom component in HACS.

But when i want to add the ingration and i search for it i can not find it.
What is the issue here?

image

Dear god, I’ve spend all morning trying to connect as I was sure it would be a problem over here. 1.1.1 seems to work great with serial mode! Tnx Thijs!

Edit: I see the sensor naming changed too? Might want to warn people clearly about this as it breaks cards etc…

Yeah, this was caused by following the new HA guidelines on naming entities. I agree that it is annoying for people that plan to move from the TCP to a serial connection. Existing installations should not be affected as the entity_ids are only generated the first time a new entity (=sensor/switch/etc) is added to HA by an integration. However, when you remove and add an integration again, those entity_ids are generated again.

I’ve added an extra warning in the release notes.

1 Like

because the integration also works by connecting to the ip address that my router fritx box 7590 assigns to my inverter, in my cas 192.168.178.45 with port 6607. what is the difference to connect to 192.168.200.1. connecting to 192.168.172.45 I see that everything works fine without the need for network bridges or anything else…

Because you don’t have the last inverter firmware.

The december update block access from house network, but if you did not update, you don’t need bridgets

1 Like

Hello everybody…

I can’t understand what I’m wrong … because I can’t set the sensors …

use lovelace…

immagine

#solar sensor ... name file solar_sensor-serbat.yaml
template:
  - platform: template
    sensors:
      grid_to_battery:
        friendly_name: "Grid to battery"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set ip = states('sensor.grid_active_power') | int %}
          {% set cdp = states('sensor.charge_discharge_power') | int %}
          {% if ip < 0 and cdp > 0 %}
              {{ (-1 * ip) | int }}
          {% else %}
              {{ (0) }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.grid_active_power') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.charge_discharge_power') not in [ 'unavailable', 'none', 'unknown' ]) }}
      grid_to_house:
        friendly_name: "Grid to house"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set g_c = states('sensor.grid_consumption2') | int %}
          {% set g_t_b = states('sensor.grid_to_battery') | int %}
          {{ (g_c-g_t_b) | int }}
        availability_template: >-
          {{ (states('sensor.grid_consumption2') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.grid_to_battery') not in [ 'unavailable', 'none', 'unknown' ]) }}
      generation_to_battery:
        friendly_name: "Generation to battery"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set b = states('sensor.battery_charge') | int %}
          {% set ap = states('sensor.input_power') | int %}
          {% if b > 0 and ap > 0 and b < ap %}
              {{ (b) | int }}
          {% elif b > 0 and ap > 0 and b > ap %}
              {{ (ap) | int }}
          {% else %}
              {{ (0) | int }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.battery_charge') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.input_power') not in [ 'unavailable', 'none', 'unknown' ]) }}
      generation_to_house:
        friendly_name: "Generation to house"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set pv = states('sensor.input_power') | int %}
          {% set g_t_b = states('sensor.generation_to_battery') | int %}
          {% set g_t_gr = states('sensor.generation_to_grid') | int %}
          {% if (pv - g_t_b - g_t_gr) > 0 %}
              {{ (pv - g_t_b - g_t_gr) | int }}
          {% else %}
              {{ (0) }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.input_power') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.generation_to_battery') not in [ 'unavailable', 'none', 'unknown' ]) 
              and (states('sensor.generation_to_grid') not in [ 'unavailable', 'none', 'unknown' ]) }}
      grid_consumption2:
        friendly_name: "Grid consumption2"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set u = states('sensor.grid_active_power') | int %}
          {% if u < 0 %}
              {{ (- u) | int }}
          {% else %}
              {{ (0) | int }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.grid_active_power') not in [ 'unavailable', 'none', 'unknown' ] )}}
      generation_to_grid:
        friendly_name: "Generation to grid"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set ip = states('sensor.input_power') | int %}
          {% set pmap = states('sensor.active_power') | int %}
          {% if pmap > 0 and ip > pmap%}
              {{ (pmap) | int }}
          {% else %}
              {{ (0) | int }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.input_power') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.active_power') not in [ 'unavailable', 'none', 'unknown' ]) }}
      battery_to_house:
        friendly_name: "Battery to house"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set u = states('sensor.charge_discharge_power') | int %}
          {% if u < 0 %}
              {{ (- u) | int }}
          {% else %}
              {{ (0) | int }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.charge_discharge_power') not in [ 'unavailable', 'none', 'unknown' ] ) }}
      battery_charge:
        friendly_name: "Battery charge"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set u = states('sensor.charge_discharge_power') | int %}
          {% if u > 0 %}
              {{ (u) | int }}
          {% else %}
              {{ (0) | int }}
          {% endif %}
        availability_template: >-
          {{ (states('sensor.charge_discharge_power') not in [ 'unavailable', 'none', 'unknown' ] ) }}
      house_consumption:
        friendly_name: "House consumption"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% set t = states('sensor.battery_to_house') | int %}
          {% set u = states('sensor.grid_to_house') | int %}
          {% set g = states('sensor.generation_to_house') | int %}
          {{ (t + u + g) }}
        availability_template: >-
          {{ (states('sensor.battery_to_house') not in [ 'unavailable', 'none', 'unknown' ] )
              and (states('sensor.grid_to_house') not in [ 'unavailable', 'none', 'unknown' ]) 
              and (states('sensor.generation_to_house') not in [ 'unavailable', 'none', 'unknown' ]) }}

in lovelace

cards:
  - type: horizontal-stack
    cards:
      - type: sensor
        entity: sensor.daily_yield  #
        detail: 4
      - type: sensor
        entity: sensor.battery_day_charge  #
        detail: 4
  - type: horizontal-stack
    cards:
    

      - type: custom:tesla-style-solar-power-card
        generation_to_house_entity: sensor.generation_to_house
        generation_to_grid_entity: sensor.generation_to_grid
        generation_to_battery_entity: sensor.generation_to_battery
        grid_consumption_entity: sensor.grid_consumption
        house_consumption_entity: sensor.house_consumption
        grid_to_house_entity: sensor.grid_to_house
        battery_to_house_entity: sensor.battery_to_house
        grid_to_battery_entity: sensor.grid_to_battery
        battery_extra_entity: sensor.battery_state_of_capacity
        hide_inactive_lines: 1
        show_gap: true


  - type: horizontal-stack
    
    
    
    
    
    
    
    
    
    
    
    
    cards:
    - type: custom:apexcharts-card
      header:
        show: true
        title: Power
        show_states: true
        colorize_states: true
      all_series_config:
        type: area
        opacity: 0.1
        stroke_width: 1
        group_by:
          func: last
          duration: 5m
      series:
        - entity: sensor.input_power
          color: lightgreen
          name: Produzione Pannelli
        - entity: sensor.active_power
          color: blue
          #name: Consumo casa          
        - entity: sensor.charge_discharge_power
          name: Battery Charge
          transform: return Math.max(0,x);
          color: orange
          #name: Carico batteria
        - entity: sensor.charge_discharge_power
          name: Battery Discharge
          color: '#800080'
          transform: return -Math.min(0,x);
          #name: Scarico batteria
        - entity: sensor.grid_active_power
          name: Grid Export
          transform: return Math.max(0,x);
          color: lime
          #name: Esportazione
        - entity: sensor.grid_active_power
          name: Grid Import
          color: red
          transform: return -Math.min(0,x);  
          #name: Importazione da rete

thank you all…

ok, solved for the insertion of the sensors, but something is wrong in the operations …

I always update now I have the latest firmware for inverters, SUN2000LV200R001C00SPC124 and last also battery, DGV100R002C00SPC114, system I have installed, my huawei access and as an installer.

Continuing the discussion from Integration Solar inverter huawei 2000L:

I always update now I have the latest firmware for inverters, SUN2000LV200R001C00SPC124 and last also battery, DGV100R002C00SPC114, system I have installed, my huawei access and as an installer.

hello @yousaf465 ! i`m back with a new inverter !!!

i tried again from scratch with my new inverter :slight_smile:

I did a clean install of the rooter (open wrt) and well, I saw in open wrt that my inverter ip was a bit strange 192.168.200.1 but also 192.168.200.100 :

so I tried to ping from HA this new IP and works!! 192,168.200.100

Then, intallation of integration also works with this IP!!!

Now, I have some data from sensors, but not sure to understand very well because very faraway from huawei solar application.

For example, I have 2 entity in total and 34 sensors. On the first one (sun 4ktl…) I able to identify the current production of the solar pannel but that’s it, not the house comsumption neither the exported exnergy to the grid… Do I did something wrong?

Congratulations
you have to create those sensors, check my previous posts on that.

1 Like